vinyl: prepare write iterator heap comparator for deferred DELETEs
In the scope of #2129, we won't delete the overwritten tuple from secondary indexes immediately on REPLACE. Instead we will defer generation of the DELETE statement until the primary index compaction. However, it may happen that the overwritten tuple and the tuple that overwrote it have the same secondary key parts, in which case the deferred DELETE is not needed and should be discarded on secondary index compaction. This patch makes the write iterator heap comparator function discard such useless deferred DELETEs. Note, this patch also removes the code that prioritises terminal statements over UPSERTs in the write iterator, which, according to the comment, may happen only during forced recovery. I don't see why we should do that, even during forced recovery, neither have I managed to find the reason in the commit history, so I dropped this code in order not to overburden the write iterator logic with some esoteric cases. Needed for #2129
Loading
Please register or sign in to comment