Skip to content
Snippets Groups Projects
Commit 0428bbce authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Kirill Yukhin
Browse files

vinyl: fix use of dropped space in deferred DELETE handler

For deferred DELETE statements to be recovered after restart, we write
them to a special 'blackhole' system space, _vinyl_deferred_delete,
which doesn't store any data, but is logged in the WAL, as a normal
space. In the on_replace trigger installed for this space, we insert
deferred DELETE statements into the memory (L0) level of the LSM tree
corresponding to the space for which the statement was generated. We
also wait for L0 quota in the trigger. The problem is a space can be
dropped while we are waiting for quota, in which case the trigger
function will crash once it resumes execution.

To fix this, let's wait for quota before we write the information about
the deferred DELETE statement to the _vinyl_deferred_delete space and
check if the LSM tree was dropped after yield. This way, everything will
work as expected even if a new space is created with the same id,
because we don't yield after checking quota.

Closes #6448
parent 165d24f5
No related branches found
No related tags found
No related merge requests found
Loading
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