Github user geomacy commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/617#discussion_r109957781
--- Diff:
core/src/main/java/org/apache/brooklyn/core/mgmt/persist/BrooklynMementoPersisterToObjectStore.java
---
@@ -674,6 +685,22 @@ private void delete(String subPath, String id,
PersistenceExceptionHandler excep
}
}
+ private void updatePlaneId(String planeId, PersistenceExceptionHandler
exceptionHandler) {
+ try {
+ if (planeId==null) {
+ LOG.warn("Null content for planeId");
+ }
+
+ String persistedPlaneId = read(PLANE_ID_FILE_NAME);
+ if (persistedPlaneId != null &&
!persistedPlaneId.equals(planeId)) {
+ throw new IllegalStateException("Persisted planeId found
(" + persistedPlaneId + ") but instance planeId is different (" + planeId + ").
Overwriting!");
--- End diff --
"Overwriting!"? does throwing the exception here not in fact skip the
overwrite? As per your comment on the description of the PR, "don't overwrite
persisted store planeId if different"?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---