Skip to content

Commit b67d4d8

Browse files
committed
Bug 37393929 - [37181866->24.09.1] RFA: Snapshot creation failed disabling active persistence with IllegalArgumentException: unknown extent identifier
[git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v24.09/": change = 112936]
1 parent d8df594 commit b67d4d8

File tree

4 files changed

+45
-372
lines changed

4 files changed

+45
-372
lines changed

prj/coherence-core-components/src/main/java/com/tangosol/coherence/component/util/daemon/queueProcessor/service/grid/PartitionedService.java

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
import java.util.concurrent.ConcurrentHashMap;
119119
import java.util.concurrent.ConcurrentLinkedQueue;
120120
import java.util.concurrent.CopyOnWriteArrayList;
121+
import java.util.concurrent.CopyOnWriteArraySet;
121122
import java.util.concurrent.atomic.AtomicInteger;
122123
import java.util.concurrent.atomic.AtomicLong;
123124

@@ -5249,7 +5250,7 @@ public void onFinalizeAssignPrimary(java.util.Map mapConfig)
52495250
{
52505251
int iPartition = ((Integer) iter.next()).intValue();
52515252
PartitionedService.PartitionControl control = getPartitionControl(iPartition);
5252-
5253+
52535254
control.unlock();
52545255
}
52555256
}
@@ -8382,7 +8383,7 @@ public boolean recoverPartition(int iPartition, com.oracle.coherence.persistence
83828383
}
83838384

83848385
com.tangosol.persistence.CachePersistenceHelper.seal(storeTo, this, /*oToken*/ null);
8385-
8386+
83868387
ctrl.setRecovered(true);
83878388

83888389
return true;
@@ -21109,7 +21110,7 @@ public static abstract class PartitionControl
2110921110
* transitively by partition transfer, but have not been ensured with
2111021111
* this PartitionControl's PersistentBackupStore.
2111121112
*/
21112-
private com.tangosol.net.internal.CopyOnWriteLongList __m_PersistentBackupExtents;
21113+
private CopyOnWriteArraySet<Long> __m_PersistentBackupExtents;
2111321114

2111421115
/**
2111521116
* Property PersistentBackupStore
@@ -21133,7 +21134,7 @@ public static abstract class PartitionControl
2113321134
* transitively by partition transfer, but have not been ensured with
2113421135
* this PartitionControl's PersistentStore.
2113521136
*/
21136-
private com.tangosol.net.internal.CopyOnWriteLongList __m_PersistentExtents;
21137+
private CopyOnWriteArraySet<Long> __m_PersistentExtents;
2113721138

2113821139
/**
2113921140
* Property PersistentStore
@@ -22248,7 +22249,7 @@ public java.util.concurrent.atomic.AtomicInteger getPersistenceTasks()
2224822249
* transitively by partition transfer, but have not been ensured with
2224922250
* this PartitionControl's PersistentBackupStore.
2225022251
*/
22251-
public com.tangosol.net.internal.CopyOnWriteLongList getPersistentBackupExtents()
22252+
public CopyOnWriteArraySet<Long> getPersistentBackupExtents()
2225222253
{
2225322254
return __m_PersistentBackupExtents;
2225422255
}
@@ -22281,7 +22282,7 @@ public com.oracle.coherence.persistence.PersistentStore getPersistentEventsStore
2228122282
* transitively by partition transfer, but have not been ensured with
2228222283
* this PartitionControl's PersistentStore.
2228322284
*/
22284-
public com.tangosol.net.internal.CopyOnWriteLongList getPersistentExtents()
22285+
public CopyOnWriteArraySet<Long> getPersistentExtents()
2228522286
{
2228622287
return __m_PersistentExtents;
2228722288
}
@@ -22957,9 +22958,9 @@ protected void setPersistenceTasks(java.util.concurrent.atomic.AtomicInteger int
2295722958
* transitively by partition transfer, but have not been ensured with
2295822959
* this PartitionControl's PersistentBackupStore.
2295922960
*/
22960-
public void setPersistentBackupExtents(com.tangosol.net.internal.CopyOnWriteLongList listExtents)
22961+
public void setPersistentBackupExtents(CopyOnWriteArraySet<Long> setExtents)
2296122962
{
22962-
__m_PersistentBackupExtents = listExtents;
22963+
__m_PersistentBackupExtents = setExtents;
2296322964
}
2296422965

2296522966
// Accessor for the property "PersistentBackupStore"
@@ -22990,9 +22991,9 @@ protected void setPersistentEventsStore(com.oracle.coherence.persistence.Persist
2299022991
* transitively by partition transfer, but have not been ensured with
2299122992
* this PartitionControl's PersistentStore.
2299222993
*/
22993-
public void setPersistentExtents(com.tangosol.net.internal.CopyOnWriteLongList listExtents)
22994+
public void setPersistentExtents(CopyOnWriteArraySet<Long> setExtents)
2299422995
{
22995-
__m_PersistentExtents = listExtents;
22996+
__m_PersistentExtents = setExtents;
2299622997
}
2299722998

2299822999
// Accessor for the property "PersistentStore"
@@ -26694,6 +26695,11 @@ public void onActivePersistenceFailure(com.oracle.coherence.persistence.Persiste
2669426695
{
2669526696
PartitionedService service = (PartitionedService) get_Module();
2669626697
PersistentStore store = e.getPersistentStore();
26698+
if (store == null)
26699+
{
26700+
throw e;
26701+
}
26702+
2669726703
int nPartition = GUIDHelper.getPartition(store.getId());
2669826704
PartitionedService.PartitionControl ctrl = service.getPartitionControl(nPartition);
2669926705
int nLockState = ctrl.getLockType();

prj/coherence-core-components/src/main/java/com/tangosol/coherence/component/util/daemon/queueProcessor/service/grid/partitionedService/PartitionedCache.java

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
import com.tangosol.net.events.internal.InterceptorManager;
7878
import com.tangosol.net.events.internal.ServiceDispatcher;
7979
import com.tangosol.net.events.internal.StorageDispatcher;
80-
import com.tangosol.net.internal.CopyOnWriteLongList;
8180
import com.tangosol.net.internal.EntryInfo;
8281
import com.tangosol.net.internal.MemberInfo;
8382
import com.tangosol.net.internal.PartitionInfo;
@@ -150,6 +149,7 @@
150149
import java.util.Map;
151150
import java.util.Set;
152151
import java.util.concurrent.ConcurrentHashMap;
152+
import java.util.concurrent.CopyOnWriteArraySet;
153153
import java.util.concurrent.atomic.AtomicInteger;
154154
import java.util.concurrent.atomic.AtomicLong;
155155
import java.util.concurrent.atomic.AtomicReferenceArray;
@@ -3777,7 +3777,7 @@ protected void movePartition(int iPartition, int iBackupTo)
37773777
}
37783778

37793779
if (iBackupTo == 0)
3780-
{
3780+
{
37813781
ctrl.preparePersistentExtents();
37823782
}
37833783
else
@@ -8453,7 +8453,7 @@ protected boolean persistChanges(com.tangosol.coherence.component.net.RequestCon
84538453
Collection colPartStatus = (Collection) entry.getValue();
84548454
PartitionedCache.PartitionControl ctrlPartition = (PartitionedCache.PartitionControl) getPartitionControl(nPartition);
84558455
PersistentStore store = ctrlPartition.ensureOpenPersistentStore(/*storeFrom*/ null, /*fSeal*/ true);
8456-
8456+
84578457
// commit changes to the persisted partition atomically
84588458
Object oToken = store.begin(collector, ctrlPartition);
84598459
try
@@ -8468,9 +8468,9 @@ protected boolean persistChanges(com.tangosol.coherence.component.net.RequestCon
84688468
long lExtentId = storage.getCacheId();
84698469
ReadBuffer bufKey = status.getKey();
84708470
ReadBuffer bufValue = status.getMergedNewValue();
8471-
8471+
84728472
ctrlPartition.ensurePersistentExtent(lExtentId);
8473-
8473+
84748474
if (bufValue == null)
84758475
{
84768476
// remove
@@ -8535,7 +8535,7 @@ protected boolean persistChanges(com.tangosol.coherence.component.net.RequestCon
85358535
boolean fPersistEvents = storeEvents != null && status.getMapEventsRaw() != null;
85368536

85378537
ctrl.ensurePersistentExtent(lExtentId);
8538-
8538+
85398539
Object oToken = store.begin(fPersistEvents ? null : collector, ctrl);
85408540
try
85418541
{
@@ -31335,8 +31335,8 @@ public void __init()
3133531335
try
3133631336
{
3133731337
setDeferredBackups(new com.tangosol.util.CircularArrayList());
31338-
setPersistentBackupExtents(new com.tangosol.net.internal.CopyOnWriteLongList());
31339-
setPersistentExtents(new com.tangosol.net.internal.CopyOnWriteLongList());
31338+
setPersistentBackupExtents(new CopyOnWriteArraySet());
31339+
setPersistentExtents(new CopyOnWriteArraySet());
3134031340
setVersionCounter(new java.util.concurrent.atomic.AtomicLong());
3134131341
}
3134231342
catch (java.lang.Exception e)
@@ -31460,22 +31460,22 @@ public boolean ensureBackupPersistentExtent(long lExtentId)
3146031460
// import com.tangosol.persistence.CachePersistenceHelper as com.tangosol.persistence.CachePersistenceHelper;
3146131461
// import com.tangosol.util.LongArray;
3146231462
// import java.util.Map;
31463-
31464-
CopyOnWriteLongList listExtents = getPersistentBackupExtents();
31465-
Map mapGraveyard = ((PartitionedCache) get_Module()).getStorageGraveyard();
31463+
31464+
CopyOnWriteArraySet<Long> setExtents = getPersistentBackupExtents();
31465+
Map mapGraveyard = ((PartitionedCache) get_Module()).getStorageGraveyard();
3146631466

3146731467
if (mapGraveyard.containsKey(Long.valueOf(lExtentId)))
3146831468
{
3146931469
return false;
3147031470
}
3147131471

3147231472
// backup partition recovery not relevant
31473-
if (listExtents.contains(lExtentId))
31473+
if (setExtents.contains(lExtentId))
3147431474
{
3147531475
boolean fCreatedExtent = false;
3147631476
synchronized (this)
3147731477
{
31478-
if (fCreatedExtent = listExtents.contains(lExtentId))
31478+
if (fCreatedExtent = setExtents.contains(lExtentId))
3147931479
{
3148031480
LongArray laCaches = null;
3148131481

@@ -31490,7 +31490,7 @@ public boolean ensureBackupPersistentExtent(long lExtentId)
3149031490
com.tangosol.persistence.CachePersistenceHelper.storeCacheNames(store, laCaches);
3149131491
}
3149231492

31493-
listExtents.remove(lExtentId);
31493+
setExtents.remove(lExtentId);
3149431494
}
3149531495
}
3149631496

@@ -31526,22 +31526,22 @@ public boolean ensurePersistentExtent(long lExtentId)
3152631526
// import com.tangosol.persistence.CachePersistenceHelper as com.tangosol.persistence.CachePersistenceHelper;
3152731527
// import com.tangosol.util.LongArray;
3152831528
// import java.util.Map;
31529-
31530-
CopyOnWriteLongList listExtents = getPersistentExtents();
31531-
Map mapGraveyard = ((PartitionedCache) get_Module()).getStorageGraveyard();
31532-
31529+
31530+
CopyOnWriteArraySet<Long> setExtents = getPersistentExtents();
31531+
Map mapGraveyard = ((PartitionedCache) get_Module()).getStorageGraveyard();
31532+
3153331533
if (mapGraveyard.containsKey(Long.valueOf(lExtentId)))
3153431534
{
3153531535
return false;
3153631536
}
31537-
31538-
if (listExtents.contains(lExtentId) && !isRecovering())
31537+
31538+
if (setExtents.contains(lExtentId) && !isRecovering())
3153931539
{
3154031540
PersistentStore storeEvents = getPersistentEventsStore();
3154131541
boolean fCreatedExtent = false;
3154231542
synchronized (this)
3154331543
{
31544-
if (fCreatedExtent = listExtents.contains(lExtentId))
31544+
if (fCreatedExtent = setExtents.contains(lExtentId))
3154531545
{
3154631546
LongArray laCaches = null;
3154731547
PersistentStore[] aStore = new PersistentStore[] {ensureOpenPersistentStore(), storeEvents};
@@ -31560,7 +31560,7 @@ public boolean ensurePersistentExtent(long lExtentId)
3156031560
}
3156131561
}
3156231562

31563-
listExtents.remove(lExtentId);
31563+
setExtents.remove(lExtentId);
3156431564
}
3156531565
}
3156631566

@@ -31610,8 +31610,8 @@ public void preparePersistentBackupExtents()
3161031610
// import com.tangosol.util.LongArray;
3161131611
// import com.tangosol.util.LongArray$Iterator as com.tangosol.util.LongArray.Iterator;
3161231612

31613-
LongArray laCaches = ((PartitionedCache) get_Module()).getPersistentCacheIds();
31614-
CopyOnWriteLongList listExtents = getPersistentBackupExtents();
31613+
LongArray laCaches = ((PartitionedCache) get_Module()).getPersistentCacheIds();
31614+
CopyOnWriteArraySet<Long> setExtents = getPersistentBackupExtents();
3161531615

3161631616
// need to "ensure" all of the cache-ids
3161731617
for (com.tangosol.util.LongArray.Iterator iter = laCaches.iterator(); iter.hasNext(); )
@@ -31620,7 +31620,7 @@ public void preparePersistentBackupExtents()
3162031620

3162131621
long lCacheId = iter.getIndex();
3162231622

31623-
listExtents.add(lCacheId);
31623+
setExtents.add(lCacheId);
3162431624
}
3162531625
}
3162631626

@@ -31678,9 +31678,9 @@ public void preparePersistentExtents(com.tangosol.util.LongArray laExtentsExclud
3167831678
// import com.tangosol.util.LongArray;
3167931679
// import com.tangosol.util.LongArray$Iterator as com.tangosol.util.LongArray.Iterator;
3168031680

31681-
LongArray laCaches = ((PartitionedCache) get_Module()).getPersistentCacheIds();
31682-
CopyOnWriteLongList listExtents = getPersistentExtents();
31683-
31681+
LongArray laCaches = ((PartitionedCache) get_Module()).getPersistentCacheIds();
31682+
CopyOnWriteArraySet<Long> setExtents = getPersistentExtents();
31683+
3168431684
// need to "ensure" all of the cache-ids outside of the excludes
3168531685
for (com.tangosol.util.LongArray.Iterator iter = laCaches.iterator(); iter.hasNext(); )
3168631686
{
@@ -31691,7 +31691,7 @@ public void preparePersistentExtents(com.tangosol.util.LongArray laExtentsExclud
3169131691
if (laExtentsExclude == null ||
3169231692
!laExtentsExclude.exists(lCacheId))
3169331693
{
31694-
listExtents.add(lCacheId);
31694+
setExtents.add(lCacheId);
3169531695
}
3169631696
}
3169731697
}

0 commit comments

Comments
 (0)