Skip to content
Snippets Groups Projects
Commit b98587e6 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

memtx: allow delete if out of memory (wallarm complaint)

parent f5bb804a
No related branches found
No related tags found
No related merge requests found
...@@ -72,6 +72,7 @@ enum { ...@@ -72,6 +72,7 @@ enum {
* can lead to, and, as a result, the max * can lead to, and, as a result, the max
* number of new block allocations. * number of new block allocations.
*/ */
RESERVE_EXTENTS_BEFORE_DELETE = 8,
RESERVE_EXTENTS_BEFORE_REPLACE = 16 RESERVE_EXTENTS_BEFORE_REPLACE = 16
}; };
...@@ -178,7 +179,9 @@ memtx_replace_all_keys(struct txn *txn, struct space *space, ...@@ -178,7 +179,9 @@ memtx_replace_all_keys(struct txn *txn, struct space *space,
* Ensure we have enough slack memory to guarantee * Ensure we have enough slack memory to guarantee
* successful statement-level rollback. * successful statement-level rollback.
*/ */
memtx_index_extent_reserve(RESERVE_EXTENTS_BEFORE_REPLACE); memtx_index_extent_reserve(new_tuple ?
RESERVE_EXTENTS_BEFORE_REPLACE :
RESERVE_EXTENTS_BEFORE_DELETE);
uint32_t i = 0; uint32_t i = 0;
try { try {
/* Update the primary key */ /* Update the primary key */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment