tkalkirill commented on code in PR #4465:
URL: https://github.com/apache/ignite-3/pull/4465#discussion_r1778473500


##########
modules/metastorage-api/src/main/java/org/apache/ignite/internal/metastorage/MetaStorageManager.java:
##########
@@ -272,4 +274,31 @@ public interface MetaStorageManager extends 
IgniteComponent {
 
     /** Unregisters a Meta Storage revision update listener. */
     void unregisterRevisionUpdateListener(RevisionUpdateListener listener);
+
+    /**
+     * Compacts outdated key versions and removes tombstones of metastorage 
locally.
+     *
+     * <p>We do not compact the only and last version of the key unless it is 
a tombstone.</p>
+     *
+     * <p>Let's look at some examples, let's say we have the following keys 
with their versions:</p>
+     * <ul>
+     *     <li>Key "foo" with versions that have revisions (1, 3, 5) - "foo" 
[1, 3, 5].</li>
+     *     <li>Key "bar" with versions that have revisions (1, 2, 5) the last 
revision is a tombstone - "bar" [1, 2, 5 tomb].</li>
+     * </ul>
+     *
+     * <p>Let's look at examples of invoking the current method and what will 
be in the storage after:</p>
+     * <ul>
+     *     <li>Compaction revision is {@code 1}: "foo" [3, 5], "bar" [2, 5 
tomb].</li>
+     *     <li>Compaction revision is {@code 2}: "foo" [3, 5], "bar" [5 
tomb].</li>
+     *     <li>Compaction revision is {@code 3}: "foo" [5], "bar" [5 
tomb].</li>
+     *     <li>Compaction revision is {@code 4}: "foo" [5], "bar" [5 
tomb].</li>
+     *     <li>Compaction revision is {@code 5}: "foo" [5].</li>
+     *     <li>Compaction revision is {@code 6}: "foo" [5].</li>
+     * </ul>
+     *
+     * @param revision Revision up to which the metastorage keys will be 
compacted.

Review Comment:
   thanks



-- 
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]

Reply via email to