Mmuzaf commented on a change in pull request #9317:
URL: https://github.com/apache/ignite/pull/9317#discussion_r692418848
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
##########
@@ -2699,10 +2699,9 @@ private RestoreLogicalState applyLogicalUpdates(
CacheGroupContext ctx =
cctx.cache().cacheGroup(rbRec.groupId());
if (ctx != null && !ctx.isLocal()) {
-
ctx.topology().forceCreatePartition(rbRec.partitionId());
+ GridDhtLocalPartition part =
ctx.topology().forceCreatePartition(rbRec.partitionId());
-
ctx.offheap().onPartitionInitialCounterUpdated(rbRec.partitionId(),
rbRec.start(),
- rbRec.range());
+
ctx.offheap().dataStore(part).updateCounter(rbRec.start(), rbRec.range());
Review comment:
Fixed.
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
##########
@@ -310,26 +308,28 @@ private void removeCacheData(int cacheId) {
}
}
- /**
- * @param part Partition.
- * @return Data store for given entry.
- */
- @Override public CacheDataStore dataStore(GridDhtLocalPartition part) {
+ /** {@inheritDoc} */
+ @Override public CacheDataStore dataStore(@Nullable GridDhtLocalPartition
part) {
if (grp.isLocal())
return locCacheDataStore;
- else {
- assert part != null;
- return part.dataStore();
- }
+ assert part != null;
+
+ return part.dataStore();
}
/**
- * @param part Partition.
- * @return Data store for given entry.
+ * @param partId Partition id.
+ * @param renting {@code true} if renting partitions must also be shown.
Review comment:
Fixed.
##########
File path:
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/CacheScanQueryFailoverTest.java
##########
@@ -172,7 +173,7 @@ public void testScanQueryOnEvictedPartition() throws
Exception {
// Force checkpoint to destroy evicted partitions store.
forceCheckpoint(grid0);
- GridTestUtils.assertThrowsAnyCause(log, iter1::next,
IgniteException.class, "Failed to get next data row");
+ GridTestUtils.assertThrows(log, iter1::next,
NoSuchElementException.class, null);
Review comment:
Fixed.
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
##########
@@ -624,7 +612,7 @@ public CacheDataStore dataStore(int part) {
/** {@inheritDoc} */
@Nullable @Override public CacheDataRow read(GridCacheContext cctx,
KeyCacheObject key)
throws IgniteCheckedException {
- CacheDataStore dataStore = dataStore(cctx, key);
+ CacheDataStore dataStore = dataStore(cctx.affinity().partition(key),
false);
Review comment:
Fixed.
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
##########
@@ -1290,18 +1271,18 @@ private Metas getOrAllocateCacheMetas() throws
IgniteCheckedException {
}
/** {@inheritDoc} */
- @Override public void preloadPartition(int part) throws
IgniteCheckedException {
+ @Override public void preloadPartition(int partId) throws
IgniteCheckedException {
if (grp.isLocal()) {
- dataStore(part).preload();
+ dataStore(null).preload();
return;
}
- GridDhtLocalPartition locPart = grp.topology().localPartition(part,
AffinityTopologyVersion.NONE, false, false);
+ GridDhtLocalPartition locPart = grp.topology().localPartition(partId,
AffinityTopologyVersion.NONE, false, false);
assert locPart != null && locPart.reservations() > 0;
- locPart.dataStore().preload();
+ dataStore(locPart).preload();
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]