diff --git a/prj/coherence-core-components/src/main/java/com/tangosol/coherence/component/util/daemon/queueProcessor/service/grid/PartitionedService.java b/prj/coherence-core-components/src/main/java/com/tangosol/coherence/component/util/daemon/queueProcessor/service/grid/PartitionedService.java index 7b4081e796790..72a2182aef65c 100644 --- a/prj/coherence-core-components/src/main/java/com/tangosol/coherence/component/util/daemon/queueProcessor/service/grid/PartitionedService.java +++ b/prj/coherence-core-components/src/main/java/com/tangosol/coherence/component/util/daemon/queueProcessor/service/grid/PartitionedService.java @@ -27867,19 +27867,6 @@ public static class SnapshotController */ private volatile long __m_SnapshotNamesExpire; - /** - * A cache of failed snapshot names held for at most SNAPSHOT_NAMES_EXPIRE - * millis after a SnapshotListRequest. - */ - private String[] __m_SnapshotFailures; - - /** - * An absolute time when SnapshotFailures should no longer be used. - * - * @volatile - */ - private volatile long __m_SnapshotFailuresExpire; - /** * Property State * @@ -28478,26 +28465,6 @@ protected long getSnapshotNamesExpire() return __m_SnapshotNamesExpire; } - /** - * Getter for property SnapshotFailures.
- * A cache of snapshot names held for at most SNAPSHOT_NAMES_EXPIRE
- * millis after a SnapshotListRequest.
- */
- protected String[] getSnapshotFailures()
- {
- return __m_SnapshotFailures;
- }
-
- /**
- * An absolute time when SnapshotFailures should no longer be used.
- *
- * @volatile
- */
- protected long getSnapshotFailuresExpire()
- {
- return __m_SnapshotFailuresExpire;
- }
-
// From interface: com.tangosol.persistence.PersistenceManagerMBean
/**
* Return a list of snapshots that are available for recovery.
@@ -28537,41 +28504,6 @@ public String[] getSnapshots()
return asNames;
}
- /**
- * Return the list of failed snapshots.
- *
- * @return the list of failed snapshots
- */
- public String[] listFailedSnapshots()
- {
- PartitionedService service = getService();
- if (service == null || !service.isRunning())
- {
- return null;
- }
-
- if (Base.getSafeTimeMillis() < getSnapshotFailuresExpire() ||
- Thread.currentThread() == service.getThread())
- {
- // use the cached value if within the allowed staleness or if being asked
- // on the service thread, as it requires a poll to all storage-enabled members.
- // This question could only be asked meaningfully on the Management thread
- // but could be called during serialization of the model for initial
- // registration - see Registry.registerLocalModel()
- return getSnapshotFailures();
- }
-
- PartitionedService.SnapshotListRequest msgRequest = (PartitionedService.SnapshotListRequest)
- service.instantiateMessage("SnapshotListRequest");
- msgRequest.setToMemberSet(service.getOwnershipMemberSet());
- msgRequest.setSnapshotName(null);
- msgRequest.setFailed(true); // this ensures we get list of failed snapshots
-
- String[] asNames = (String[]) service.poll(msgRequest);
- setSnapshotFailures(asNames);
- return asNames;
- }
-
/**
* Return a Map
- * A cache of snapshot names held for at most SNAPSHOT_NAMES_EXPIRE
- * millis after a SnapshotListRequest.
- */
- public void setSnapshotFailures(String[] asNames)
- {
- // import com.tangosol.util.Base;
-
- __m_SnapshotFailures = asNames;
-
- setSnapshotFailuresExpire(asNames == null
- ? 0L : Base.getSafeTimeMillis() + SNAPSHOT_NAMES_EXPIRE);
- }
-
- /**
- * An absolute time when SnapshotFailures should no longer be used.
- *
- * @volatile
- */
- protected void setSnapshotFailuresExpire(long ldtExpire)
- {
- __m_SnapshotFailuresExpire = ldtExpire;
- }
// Accessor for the property "State"
/**
@@ -30576,26 +30436,15 @@ public static class SnapshotListRequest
*/
public static final String RESPONSE_STORES = "2";
- /**
- * This value indicates the response was for a list of failed snapshots.
- */
- public static final String RESPONSE_FAILED_SNAPSHOTS = "3";
-
/**
* Property SnapshotName
*
* If Snapshot is null this means that SnapshotListRequest should
- * retrieve the snapshots for the service (or failed snapshots if
- * __m_failed is set to true) otherwise the stores for the
+ * retrieve the snapshots for the service otherwise the stores for the
* snapshot specified by SnapshotName should be returned.
*/
private String __m_SnapshotName;
private static com.tangosol.util.ListMap __mapChildren;
-
- /**
- * If true request should retrieve list of failed snapshots.
- */
- private boolean __m_failed;
// Static initializer
static
@@ -30726,15 +30575,6 @@ public String getSnapshotName()
return __m_SnapshotName;
}
- /**
- * Returns true if SnapshotListRequest should retrieve list
- * of failed snapshots.
- */
- public boolean getFailed()
- {
- return __m_failed;
- }
-
// Declared at the super level
protected com.tangosol.coherence.component.net.Poll instantiatePoll()
{
@@ -30786,16 +30626,8 @@ public void onReceived()
if (sSnapshotName == null)
{
- if (getFailed())
- {
- String[] asFailedSnapshots = CachePersistenceHelper.getFailedSnapshots(env);
- msgResponse.setValue (new Object[] {RESPONSE_FAILED_SNAPSHOTS, asFailedSnapshots});
- }
- else
- {
- // respond with list of snapshots
- msgResponse.setValue (new Object[] {RESPONSE_SNAPSHOTS, env.listSnapshots()});
- }
+ // respond with list of snapshots
+ msgResponse.setValue (new Object[] {RESPONSE_SNAPSHOTS, env.listSnapshots()});
}
else
{
@@ -30836,7 +30668,6 @@ public void read(com.tangosol.io.ReadBuffer.BufferInput input)
boolean fNull = input.readBoolean();
setSnapshotName(fNull ? null : input.readUTF());
- setFailed(fNull && input.readBoolean());
}
// Accessor for the property "SnapshotName"
@@ -30851,15 +30682,6 @@ public void setSnapshotName(String sSnapshotName)
__m_SnapshotName = sSnapshotName;
}
- /**
- * Set to true if SnapshotListRequest should retrieve list
- * of failed snapshots.
- */
- public void setFailed(boolean bFailed)
- {
- __m_failed = bFailed;
- }
-
// Declared at the super level
public void write(com.tangosol.io.WriteBuffer.BufferOutput output)
throws java.io.IOException
@@ -30872,10 +30694,6 @@ public void write(com.tangosol.io.WriteBuffer.BufferOutput output)
{
output.writeUTF(getSnapshotName());
}
- if (fNull)
- {
- output.writeBoolean(getFailed());
- }
}
// ---- class: com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService$SnapshotListRequest$Poll
@@ -30904,10 +30722,6 @@ public static class Poll
*/
private transient java.util.Set __m_Snapshots;
- /**
- * The set of failed snapshot names returned by the SnapshotListRequests.
- */
- private transient java.util.Set __m_FailedSnapshots;
/**
* Property Stores
*
@@ -31007,15 +30821,6 @@ public java.util.Set getSnapshots()
return __m_Snapshots;
}
- /**
- * The set of names of failed snapshots
- * returned by the SnapshotListRequests.
- */
- public java.util.Set getFailedSnapshots()
- {
- return __m_FailedSnapshots;
- }
-
// Accessor for the property "Stores"
/**
* Getter for property Stores.
@@ -31040,18 +30845,13 @@ protected void onCompletion()
// import java.util.Map;
// import java.util.Set;
- Set setSnapshots = getSnapshots();
- Set setFailedSnapshots = getFailedSnapshots();
- Map mapStores = getStores();
+ Set setSnapshots = getSnapshots();
+ Map mapStores = getStores();
if (setSnapshots != null)
{
setResult(setSnapshots.toArray(new String[setSnapshots.size()]));
}
- else if (setFailedSnapshots != null)
- {
- setResult(setFailedSnapshots.toArray(new String[setFailedSnapshots.size()]));
- }
else
{
setResult(mapStores);
@@ -31096,25 +30896,6 @@ public void onResponse(com.tangosol.coherence.component.net.Message msg)
setSnapshots.add(asSnapshots[i]);
}
}
- else if (PartitionedService.SnapshotListRequest.RESPONSE_FAILED_SNAPSHOTS.equals(oResult[0]))
- {
- // list of snapshots was asked for
- Set setFailedSnapshots = getFailedSnapshots();
- if (setFailedSnapshots == null)
- {
- setFailedSnapshots = new TreeSet();
- setFailedSnapshots(setFailedSnapshots);
- }
-
- Object[] asFailedSnapshots = (Object[]) oResult[1]; // logically String[] but POF widens it
- if (asFailedSnapshots != null)
- {
- for (int i = 0, c = asFailedSnapshots.length; i < c; i++)
- {
- setFailedSnapshots.add(asFailedSnapshots[i]);
- }
- }
- }
else
{
// list of stores per snapshot was asked for from each member.
@@ -31152,14 +30933,6 @@ public void setSnapshots(java.util.Set setSnapshots)
{
__m_Snapshots = setSnapshots;
}
-
- /**
- * Set the names of failed snapshots returned by the SnapshotListRequests.
- */
- public void setFailedSnapshots(java.util.Set setFailedSnapshots)
- {
- __m_FailedSnapshots = setFailedSnapshots;
- }
// Accessor for the property "Stores"
/**
diff --git a/prj/coherence-core/src/main/java/com/tangosol/internal/management/resources/PersistenceResource.java b/prj/coherence-core/src/main/java/com/tangosol/internal/management/resources/PersistenceResource.java
index 01046abc17572..fcf0e9f7d9b69 100644
--- a/prj/coherence-core/src/main/java/com/tangosol/internal/management/resources/PersistenceResource.java
+++ b/prj/coherence-core/src/main/java/com/tangosol/internal/management/resources/PersistenceResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates.
+ * Copyright (c) 2000, 2025, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* https://oss.oracle.com/licenses/upl.
@@ -38,9 +38,6 @@ public void addRoutes(RequestRouter router, String sPathRoot)
{
router.addGet(sPathRoot, this::get);
router.addGet(sPathRoot + "/snapshots", this::getSnapshots);
- router.addGet(sPathRoot + "/snapshots/{" + SNAPSHOT_NAME + "}/status", this::getSnapshotStatus);
- router.addGet(sPathRoot + "/snapshots/{" + SNAPSHOT_NAME + "}/recover/status", this::getSnapshotRecoveryStatus);
- router.addGet(sPathRoot + "/failedSnapshots", this::getFailedSnapshots);
router.addGet(sPathRoot + "/archives", this::getArchives);
router.addGet(sPathRoot + "/archiveStores/{" + SNAPSHOT_NAME + "}", this::getArchiveStores);
@@ -80,17 +77,6 @@ public Response getSnapshots(HttpRequest request)
filterAttributes, getLinksFilter(request)));
}
- /**
- * Return list of failed snapshots for a service.
- *
- * @return the response object
- */
- public Response getFailedSnapshots(HttpRequest request)
- {
- return response(getResponseFromMBeanOperation(request, getQuery(request),
- "items", "listFailedSnapshots", null, null));
- }
-
/**
* Return list of archived snapshots of a service.
*
@@ -117,34 +103,6 @@ public Response getArchiveStores(HttpRequest request)
"archiveStores", "listArchivedSnapshotStores", aoArguments, asSignature));
}
- /**
- * Return the status of the specific snapshot.
- *
- * @return the response object
- */
- public Response getSnapshotStatus(HttpRequest request)
- {
- String sSnapshotName = request.getFirstPathParameter(SNAPSHOT_NAME);
- String[] asSignature = {String.class.getName()};
- Object[] aoArguments = {sSnapshotName};
- return response(getResponseFromMBeanOperation(request, getQuery(request),
- "status" , "getSnapshotStatus", aoArguments, asSignature));
- }
-
- /**
- * Return the recovery status of the specific snapshot.
- *
- * @return the response object
- */
- public Response getSnapshotRecoveryStatus(HttpRequest request)
- {
- String sSnapshotName = request.getFirstPathParameter(SNAPSHOT_NAME);
- String[] asSignature = {String.class.getName()};
- Object[] aoArguments = {sSnapshotName};
- return response(getResponseFromMBeanOperation(request, getQuery(request),
- "status" , "getSnapshotRecoveryStatus", aoArguments, asSignature));
- }
-
// ----- Post API -------------------------------------------------------
/**
diff --git a/prj/coherence-core/src/main/java/com/tangosol/persistence/CachePersistenceHelper.java b/prj/coherence-core/src/main/java/com/tangosol/persistence/CachePersistenceHelper.java
index 5fa68ac0736db..80f1bbb55fdfa 100644
--- a/prj/coherence-core/src/main/java/com/tangosol/persistence/CachePersistenceHelper.java
+++ b/prj/coherence-core/src/main/java/com/tangosol/persistence/CachePersistenceHelper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates.
+ * Copyright (c) 2000, 2022, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* https://oss.oracle.com/licenses/upl.
@@ -9,7 +9,6 @@
import com.oracle.coherence.common.base.Logger;
import com.oracle.coherence.persistence.FatalAccessException;
-import com.oracle.coherence.persistence.PersistenceEnvironment;
import com.oracle.coherence.persistence.PersistenceException;
import com.oracle.coherence.persistence.PersistentStore;
@@ -47,7 +46,6 @@
import com.tangosol.net.partition.PartitionSet;
import com.tangosol.net.partition.VersionAwareMapListener;
-import com.tangosol.persistence.bdb.BerkeleyDBEnvironment;
import com.tangosol.persistence.bdb.BerkeleyDBManager;
import com.tangosol.util.Base;
@@ -66,16 +64,9 @@
import java.io.File;
import java.io.FileInputStream;
-import java.io.FileNotFoundException;
import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.FileWriter;
import java.io.IOException;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
@@ -1518,145 +1509,6 @@ public ReadBuffer visitFromKey()
};
}
- public static void recordRecoveryStatus(PersistenceEnvironment env, String sSnapshot, boolean bRecoverySuccess, String sReason)
- {
- if (!(env instanceof BerkeleyDBEnvironment))
- {
- return;
- }
-
- File dirSnapshots = ((BerkeleyDBEnvironment) env).getPersistenceSnapshotDirectory();
- Properties props = new Properties();
- props.setProperty(RECOVERY_META_VERSION, "0");
- props.setProperty(RECOVERY_META_STATUS_PROPERTY,
- bRecoverySuccess
- ? RECOVERY_STATUS_SUCCESS
- : String.format("%s: %s", RECOVERY_STATUS_FAILURE, sReason));
- Writer writer = null;
- try
- {
- File propsFile = dirSnapshots.toPath().resolve(sSnapshot).resolve(RECOVERY_META_FILENAME).toFile();
- writer = new FileWriter(propsFile);
- props.store(writer, RECOVERY_META_HEADER);
- }
- catch (IOException e)
- {
- Logger.fine(String.format("Cannot write properties file %s for snapshot '%s'", RECOVERY_META_FILENAME, sSnapshot));
- }
- finally
- {
- if (writer != null)
- {
- try
- {
- writer.close();
- }
- catch (IOException ignored)
- {
- }
- }
- }
- }
-
- /**
- * Return snapshot status.
- *
- * @param env the {@link PersistenceEnvironment} to query
- * @param sName the snapshot name
- *
- * @return the snapshot status, or null if it is not possible
- * to obtain the status.
- */
- public static String getSnapshotStatus(PersistenceEnvironment env, String sName)
- {
- if (!(env instanceof BerkeleyDBEnvironment))
- {
- return null;
- }
-
- File dirSnapshot = new File(((BerkeleyDBEnvironment) env).getPersistenceSnapshotDirectory(), sName);
- if (!dirSnapshot.isDirectory() || !dirSnapshot.canRead() || !dirSnapshot.canExecute())
- {
- return SNAPSHOT_STATUS_NOT_FOUND;
- }
-
- try
- {
- getSnapshotPersistenceTools(dirSnapshot).validate();
- }
- catch (RuntimeException e)
- {
- Throwable cause = e.getCause();
- return String.format("%s: %s", RECOVERY_STATUS_FAILURE, cause == null ? e.getMessage() : cause.getMessage());
- }
- return SNAPSHOT_STATUS_COMPLETED;
- }
-
- /**
- * Return recovery status for the given snapshot.
- *
- * @param env the {@link PersistenceEnvironment} to query
- * @param sName the snapshot name
- *
- * @return the snapshot recovery status, or null if it is not
- * possible to obtain the status.
- */
- public static String getSnapshotRecoveryStatus(PersistenceEnvironment env, String sName)
- {
- if (!(env instanceof BerkeleyDBEnvironment))
- {
- return null;
- }
-
- File dirSnapshot = new File(((BerkeleyDBEnvironment) env).getPersistenceSnapshotDirectory(), sName);
- if (!dirSnapshot.isDirectory() || !dirSnapshot.canRead() || !dirSnapshot.canExecute())
- {
- return SNAPSHOT_STATUS_NOT_FOUND;
- }
-
- try (Reader reader = new FileReader(new File(dirSnapshot, RECOVERY_META_FILENAME)))
- {
- Properties props = new Properties();
- props.load(reader);
- return props.getProperty(RECOVERY_META_STATUS_PROPERTY);
- }
- catch (FileNotFoundException e)
- {
- return SNAPSHOT_STATUS_NOT_FOUND;
- }
- catch (IOException | RuntimeException e)
- {
- return String.format("%s: %s", RECOVERY_STATUS_FAILURE, e.getMessage());
- }
- }
-
- public static String[] getFailedSnapshots(PersistenceEnvironment env)
- {
- PersistenceEnvironment persistEnv = SafePersistenceWrappers.unwrap(env);
- if (!(persistEnv instanceof BerkeleyDBEnvironment))
- {
- return null;
- }
-
- // respond with list of failed snapshots
- File dirSnapshots = ((BerkeleyDBEnvironment) persistEnv).getPersistenceSnapshotDirectory();
- String[] asSnapshots = persistEnv.listSnapshots();
-
- List