fdb-record-layer icon indicating copy to clipboard operation
fdb-record-layer copied to clipboard

Version mutations aren't cleared out by delete records where

Open alecgrieser opened this issue 1 year ago • 0 comments

Versionstamp-related mutations are currently stored in a buffer in the JVM and flushed during commit. This is to support multiple updates to the same record happening during a single transaction. Right before commit, this data is flushed to disk.

However, this data structure is not cleared out when there is a deleteRecordsWhere operation. This means that if one:

  1. Inserts a record with a versionstamp then
  2. Issues a deleteRecordsWhere operation for that record, the result is
  3. The versionstamp (and versionstamp indexes) get inserted into the database, but the record itself does not

This leads to a missing split point exception when the record is read. As a fix, the versionstamp keys should be cleared out during deleteRecordsWhere as well. Alternatively, we could ban deleteRecordsWhere if there are outstanding versionstamp operations.

alecgrieser avatar Aug 29 '23 11:08 alecgrieser