Skip to content

Commit

Permalink
gh-2422 FederatedStore ChangeGraphId & ChangeGraphAccess recovery info.
Browse files Browse the repository at this point in the history
  • Loading branch information
GCHQDev404 committed Jul 19, 2021
1 parent 687c293 commit 1541f82
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,9 @@ private boolean changeGraphAccess(final String graphId, final FederatedAccess ne
try {
federatedStoreCache.addGraphToCache(graphToMove, newFederatedAccess, true/*true because graphLibrary should have throw error*/);
} catch (final CacheOperationException e) {
//TODO FS recovery
String s = "Error occurred updating graphAccess. GraphStorage=updated, Cache=outdated. graphId:" + graphId;
LOGGER.error(s + " graphStorage access:{} cache access:{}", newFederatedAccess, oldAccess);
throw new StorageException(s, e);
String message = String.format("Error occurred updating graphAccess. GraphStorage=updated, Cache=outdated. graphId:%s. Recovery is possible from a restart if a persistent cache is being used, otherwise contact admin", graphId);
LOGGER.error(message + " graphStorage access:{} cache access:{}", newFederatedAccess, oldAccess);
throw new StorageException(message, e);
}
}

Expand Down Expand Up @@ -606,10 +605,9 @@ private boolean changeGraphId(final String graphId, final String newGraphId, fin
try {
federatedStoreCache.addGraphToCache(newGraphSerialisable, key, true/*true because graphLibrary should have throw error*/);
} catch (final CacheOperationException e) {
//TODO FS recovery
String s = "Error occurred updating graphId. GraphStorage=updated, Cache=outdated graphId.";
LOGGER.error(s + " graphStorage graphId:{} cache graphId:{}", newGraphId, graphId);
throw new StorageException(s, e);
String message = String.format("Error occurred updating graphId. GraphStorage=updated, Cache=outdated graphId. graphStorage graphId:%s cache graphId:%s. Recovery is possible from a restart if a persistent cache is being used, otherwise contact admin", newGraphId, graphId);
LOGGER.error(message);
throw new StorageException(message, e);
}
federatedStoreCache.deleteGraphFromCache(graphId);
}
Expand Down

0 comments on commit 1541f82

Please sign in to comment.