Skip to content

Commit 76b0471

Browse files
committed
Bug 37393930 - [37181866->25.03] RFA: Snapshot creation failed disabling active persistence with IllegalArgumentException: unknown extent identifier
[git-p4: depot-paths = "//dev/coherence-ce/main/": change = 112928]
1 parent 9f09f58 commit 76b0471

File tree

4 files changed

+47
-372
lines changed

4 files changed

+47
-372
lines changed

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

Lines changed: 18 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;
@@ -19057,6 +19058,7 @@ public void read(com.tangosol.io.ReadBuffer.BufferInput input)
1905719058
boolean fStores = input.readBoolean();
1905819059
if (fStores)
1905919060
{
19061+
_trace("**MG** OwnershipResponse.read servicememberset: " + service.getServiceMemberSet(), 3);
1906019062
boolean fStoresCompat = service.isVersionCompatible(OwnershipResponse::isLazyOpenCompatible);
1906119063
int cStores = input.readInt();
1906219064
PersistentStoreInfo[] aInfo = new PersistentStoreInfo[cStores];
@@ -19170,6 +19172,7 @@ public void write(com.tangosol.io.WriteBuffer.BufferOutput output)
1917019172
{
1917119173
if (fStoresCompat)
1917219174
{
19175+
//_trace("**MG** write OwnershipResponse: " + ExternalizableHelper.getStreamFormat(aInfo[i]), 3);
1917319176
ExternalizableHelper.writeObject(output, aInfo[i]);
1917419177
}
1917519178
else
@@ -21109,7 +21112,7 @@ public static abstract class PartitionControl
2110921112
* transitively by partition transfer, but have not been ensured with
2111021113
* this PartitionControl's PersistentBackupStore.
2111121114
*/
21112-
private com.tangosol.net.internal.CopyOnWriteLongList __m_PersistentBackupExtents;
21115+
private CopyOnWriteArraySet<Long> __m_PersistentBackupExtents;
2111321116

2111421117
/**
2111521118
* Property PersistentBackupStore
@@ -21133,7 +21136,7 @@ public static abstract class PartitionControl
2113321136
* transitively by partition transfer, but have not been ensured with
2113421137
* this PartitionControl's PersistentStore.
2113521138
*/
21136-
private com.tangosol.net.internal.CopyOnWriteLongList __m_PersistentExtents;
21139+
private CopyOnWriteArraySet<Long> __m_PersistentExtents;
2113721140

2113821141
/**
2113921142
* Property PersistentStore
@@ -22248,7 +22251,7 @@ public java.util.concurrent.atomic.AtomicInteger getPersistenceTasks()
2224822251
* transitively by partition transfer, but have not been ensured with
2224922252
* this PartitionControl's PersistentBackupStore.
2225022253
*/
22251-
public com.tangosol.net.internal.CopyOnWriteLongList getPersistentBackupExtents()
22254+
public CopyOnWriteArraySet<Long> getPersistentBackupExtents()
2225222255
{
2225322256
return __m_PersistentBackupExtents;
2225422257
}
@@ -22281,7 +22284,7 @@ public com.oracle.coherence.persistence.PersistentStore getPersistentEventsStore
2228122284
* transitively by partition transfer, but have not been ensured with
2228222285
* this PartitionControl's PersistentStore.
2228322286
*/
22284-
public com.tangosol.net.internal.CopyOnWriteLongList getPersistentExtents()
22287+
public CopyOnWriteArraySet<Long> getPersistentExtents()
2228522288
{
2228622289
return __m_PersistentExtents;
2228722290
}
@@ -22957,9 +22960,9 @@ protected void setPersistenceTasks(java.util.concurrent.atomic.AtomicInteger int
2295722960
* transitively by partition transfer, but have not been ensured with
2295822961
* this PartitionControl's PersistentBackupStore.
2295922962
*/
22960-
public void setPersistentBackupExtents(com.tangosol.net.internal.CopyOnWriteLongList listExtents)
22963+
public void setPersistentBackupExtents(CopyOnWriteArraySet<Long> setExtents)
2296122964
{
22962-
__m_PersistentBackupExtents = listExtents;
22965+
__m_PersistentBackupExtents = setExtents;
2296322966
}
2296422967

2296522968
// Accessor for the property "PersistentBackupStore"
@@ -22990,9 +22993,9 @@ protected void setPersistentEventsStore(com.oracle.coherence.persistence.Persist
2299022993
* transitively by partition transfer, but have not been ensured with
2299122994
* this PartitionControl's PersistentStore.
2299222995
*/
22993-
public void setPersistentExtents(com.tangosol.net.internal.CopyOnWriteLongList listExtents)
22996+
public void setPersistentExtents(CopyOnWriteArraySet<Long> setExtents)
2299422997
{
22995-
__m_PersistentExtents = listExtents;
22998+
__m_PersistentExtents = setExtents;
2299622999
}
2299723000

2299823001
// Accessor for the property "PersistentStore"
@@ -26694,6 +26697,11 @@ public void onActivePersistenceFailure(com.oracle.coherence.persistence.Persiste
2669426697
{
2669526698
PartitionedService service = (PartitionedService) get_Module();
2669626699
PersistentStore store = e.getPersistentStore();
26700+
if (store == null)
26701+
{
26702+
throw e;
26703+
}
26704+
2669726705
int nPartition = GUIDHelper.getPartition(store.getId());
2669826706
PartitionedService.PartitionControl ctrl = service.getPartitionControl(nPartition);
2669926707
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)