Handle missed partition ID during WAL replay
@@ -1621,7 +1621,12 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
* @param dataEntry Data entry to apply.
*/
private void applyUpdate(GridCacheContext cacheCtx, DataEntry dataEntry) throws IgniteCheckedException {
- GridDhtLocalPartition locPart = cacheCtx.topology().forceCreatePartition(dataEntry.partitionId());
+ int partId = dataEntry.partitionId();
+
+ if (partId == -1)
+ partId = cacheCtx.affinity().partition(dataEntry.key());
+
+ GridDhtLocalPartition locPart = cacheCtx.topology().forceCreatePartition(partId);
switch (dataEntry.op()) {
case CREATE:
@@ -1636,15 +1641,15 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
null);
if (dataEntry.partitionCounter() != 0)
- cacheCtx.offheap().onPartitionInitialCounterUpdated(dataEntry.partitionId(), dataEntry.partitionCounter());
+ cacheCtx.offheap().onPartitionInitialCounterUpdated(partId, dataEntry.partitionCounter());
break;
case DELETE:
- cacheCtx.offheap().remove(cacheCtx, dataEntry.key(), dataEntry.partitionId(), locPart);
+ cacheCtx.offheap().remove(cacheCtx, dataEntry.key(), partId, locPart);
if (dataEntry.partitionCounter() != 0)
- cacheCtx.offheap().onPartitionInitialCounterUpdated(dataEntry.partitionId(), dataEntry.partitionCounter());
+ cacheCtx.offheap().onPartitionInitialCounterUpdated(partId, dataEntry.partitionCounter());
break;
