Phillippko commented on code in PR #4118:
URL: https://github.com/apache/ignite-3/pull/4118#discussion_r1687856835
##########
modules/storage-rocksdb/src/main/java/org/apache/ignite/internal/storage/rocksdb/RocksDbMvPartitionStorage.java:
##########
@@ -599,17 +615,38 @@ public void addWriteCommitted(RowId rowId, @Nullable
BinaryRow row, HybridTimest
rowBytes = rowBuffer.array();
}
- try {
- writeBatch.put(helper.partCf, keyBuf.array(), rowBytes);
- } catch (RocksDBException e) {
- throw new StorageException("Failed to update a row in
storage: " + createStorageInfo(), e);
- }
- }
+ ByteBuffer keyBuf = prepareHeapKeyBuf(rowId);
- return null;
+ putTimestampDesc(keyBuf, commitTimestamp);
+
+ writeBatch.put(helper.partCf, keyBuf.array(), rowBytes);
+
+ updateEstimatedSize(writeBatch, isNewValueTombstone,
addResult);
+
+ return null;
+ } catch (RocksDBException e) {
+ throw new StorageException("Failed to update a row in storage:
" + createStorageInfo(), e);
+ }
});
}
+ private void updateEstimatedSize(WriteBatchWithIndex writeBatch, boolean
isNewValueTombstone, AddResult gcQueueAddResult)
+ throws RocksDBException {
+ if (isNewValueTombstone) {
+ if (gcQueueAddResult == AddResult.WAS_VALUE) {
+ long newSize = ESTIMATED_SIZE_UPDATER.decrementAndGet(this);
Review Comment:
Size was 2. First thread decremented size, got 1. Second thread decremented
size, got 0. Second writes to DB 0, then first writes 1. So in DB we have 1. Or
no?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]