tkalkirill commented on code in PR #1706:
URL: https://github.com/apache/ignite-3/pull/1706#discussion_r1115274003
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/StorageUpdateHandler.java:
##########
@@ -252,10 +254,34 @@ private void tryRemoveFromIndexes(BinaryRow rowToRemove,
RowId rowId, Cursor<Rea
}
}
- private void removeFromIndex(BinaryRow row, RowId rowId) {
- for (TableSchemaAwareIndexStorage index : indexes.get().values()) {
- index.remove(row, rowId);
- }
+ /**
+ * Tries removing partition's oldest stale entry and its indexes.
+ *
+ * @param lowWatermark Low watermark for the vacuum.
+ */
+ public boolean vacuum(HybridTimestamp lowWatermark) {
+ return storage.runConsistently(() -> {
+ BinaryRowAndRowId vacuumed = storage.pollForVacuum(lowWatermark);
+
+ if (vacuumed == null) {
+ // Nothing was garbage collected.
+ return false;
+ }
+
+ BinaryRow binaryRow = vacuumed.binaryRow();
+
+ assert binaryRow != null;
Review Comment:
I do not agree with your reasoning, technically the situation above is
possible, it must be corrected at the beginning.
It is correct to do this in a separate ticket, we need to understand what we
must do to avoid such a situation.
For example, do not allow the first addWrite as a tombstone, or to somehow
handle the situation in gc.
--
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]