nizhikov commented on code in PR #11112:
URL: https://github.com/apache/ignite/pull/11112#discussion_r1432661053
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/dump/CreateDumpFutureTask.java:
##########
@@ -561,45 +586,60 @@ public boolean writeForIterator(
CacheObject val,
GridCacheVersion ver
) {
- boolean written = true;
+ String reason = null;
if (isAfterStart(ver))
- written = false;
- else if (changed.get(cache).contains(key))
- written = false;
- else
- write(cache, expireTime, key, val, ver);
+ reason = "greater version";
Review Comment:
Seems like javadoc must not be changed. Isn't it?
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/dump/CreateDumpFutureTask.java:
##########
@@ -614,6 +654,38 @@ private boolean isAfterStart(GridCacheVersion ver) {
return (startVer != null && ver.isGreater(startVer)) &&
!isolatedStreamerVer.equals(ver);
}
+ /**
+ * Iterator returned by {@link
IgniteCacheOffheapManager#reservedIterator(int, AffinityTopologyVersion)}
+ * iterates key in ascending order set by {@link
CacheDataTree#compare(BPlusIO, long, int, CacheSearchRow)}.
+ * So if key changed by the user (see {@link #writeChanged(int, long,
KeyCacheObject, CacheObject, GridCacheVersion)})
+ * is greater then last key written by partition iterator then it not
saved in dump, already, and must be written.
+ * Otherwise, key already saved by the iterator and must be skiped.
+ *
+ * @param cache Cache id.
+ * @param key Key to write with {@link #writeChanged(int, long,
KeyCacheObject, CacheObject, GridCacheVersion)}.
+ * @return {@code 0} if key written by the iterator, already. {@code
False} otherwise.
Review Comment:
Fixed
--
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]