fdb-record-layer
fdb-record-layer copied to clipboard
ungrouped RecordCountKey leaves data behind if dropped
If a RecordMetaData has an ungrouped RecordCountKey, and the RecordCountKey is removed, data will be left behind by checkVersion.
The code that clears existing data https://github.com/FoundationDB/fdb-record-layer/blob/b74cbc2e7abd93697740917ad5d41afadcef3737/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/provider/foundationdb/FDBRecordStore.java#L4845
Uses:
context.clear(getSubspace().range(Tuple.from(RECORD_COUNT_KEY)));
which won't clear data that is stored at:
getSubspace().pack(Tuple.from(RECORD_COUNT_KEY));