-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add EclipseStore to memory storage for persistence #1484
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue: It looks like someone removed the unit test runs in CI, which is hiding a handful of errors I'm seeing when building the project:
[ERROR] testDontFailRepairAfterTopologyChange(io.cassandrareaper.service.RepairRunnerTest) Time elapsed: 0.117 s <<< ERROR!
org.eclipse.serializer.persistence.exceptions.PersistenceExceptionTypeNotPersistable: Type not persistable: "class com.google.common.collect.ImmutableMapEntry".
at io.cassandrareaper.service.RepairRunnerTest.addNewRepairRun(RepairRunnerTest.java:1000)
at io.cassandrareaper.service.RepairRunnerTest.testDontFailRepairAfterTopologyChange(RepairRunnerTest.java:878)
[ERROR] getNodeMetricsInLocalDcAvailabilityForLocalDcNodeTest(io.cassandrareaper.service.RepairRunnerTest) Time elapsed: 0.101 s <<< ERROR!
org.eclipse.serializer.persistence.exceptions.PersistenceExceptionTypeNotPersistable: Type not persistable: "class com.google.common.collect.ImmutableMapEntry".
at io.cassandrareaper.service.RepairRunnerTest.addNewRepairRun(RepairRunnerTest.java:1000)
at io.cassandrareaper.service.RepairRunnerTest.getNodeMetricsInLocalDcAvailabilityForLocalDcNodeTest(RepairRunnerTest.java:1299)
[ERROR] testDontFailRepairAfterTopologyChangeIncrementalRepair(io.cassandrareaper.service.RepairRunnerTest) Time elapsed: 0.114 s <<< ERROR!
org.eclipse.serializer.persistence.exceptions.PersistenceExceptionTypeNotPersistable: Type not persistable: "class com.google.common.collect.ImmutableMapEntry".
at io.cassandrareaper.service.RepairRunnerTest.addNewRepairRun(RepairRunnerTest.java:1000)
at io.cassandrareaper.service.RepairRunnerTest.testDontFailRepairAfterTopologyChangeIncrementalRepair(RepairRunnerTest.java:1076)
[INFO] Running io.cassandrareaper.service.HeartTest
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.989 s - in io.cassandrareaper.service.HeartTest
[INFO] Running io.cassandrareaper.AssertionTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s - in io.cassandrareaper.AssertionTest
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] HttpCassandraManagementProxyTest.testSSLHotReload:818 » NoSuchFile /home/runne...
[ERROR] RepairRunResourceTest.displaysExplicitBlacklistedCompactionStrategies:365->addRepairRun:230 » PersistenceExceptionTypeNotPersistable
[ERROR] RepairRunResourceTest.doesNotDisplayBlacklistedCompactionStrategies:325->addRepairRun:230 » PersistenceExceptionTypeNotPersistable
[ERROR] RepairRunResourceTest.testAddRepairRun:253->addDefaultRepairRun:204->addRepairRun:230 » PersistenceExceptionTypeNotPersistable
[ERROR] RepairRunResourceTest.testModifyIntensity:512->addDefaultRepairRun:204->addRepairRun:230 » PersistenceExceptionTypeNotPersistable
[ERROR] RepairRunResourceTest.testPauseNotRunningRun:480->addDefaultRepairRun:204->addRepairRun:230 » PersistenceExceptionTypeNotPersistable
[ERROR] RepairRunResourceTest.testTriggerAlreadyRunningRun:403->addDefaultRepairRun:204->addRepairRun:230 » PersistenceExceptionTypeNotPersistable
[ERROR] RepairRunResourceTest.testTriggerNewRunAlreadyRunningRun:420->addDefaultRepairRun:204->addRepairRun:230 » PersistenceExceptionTypeNotPersistable
[ERROR] RepairRunnerTest.getNodeMetricsInLocalDcAvailabilityForLocalDcNodeTest:1299->addNewRepairRun:1000 » PersistenceExceptionTypeNotPersistable
[ERROR] RepairRunnerTest.testDontFailRepairAfterTopologyChange:878->addNewRepairRun:1000 » PersistenceExceptionTypeNotPersistable
[ERROR] RepairRunnerTest.testDontFailRepairAfterTopologyChangeIncrementalRepair:1076->addNewRepairRun:1000 » PersistenceExceptionTypeNotPersistable
We'd need to reintroduce running the unit tests in the "Build Reaper" job and investigate why we're getting these errors.
this.memoryStorageRoot.getClusters().entrySet().stream().forEach(entry -> { | ||
Cluster cluster = entry.getValue(); | ||
LOG.info("Loaded cluster: {} / seeds: {}", cluster.getName(), cluster.getSeedHosts()); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Todo: these lines can be removed, they were added for debugging purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do. I was thinking of leaving it in as it is a quick way to tell if the EclipseStore stuff is broken, but it is unnecessary noise in the logs at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Todo: This still needs to be moved to debug level at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got caught up trying to resolve the serialization issues and forgot to address your earlier comments. I'll address them all in another commit
src/server/src/main/java/io/cassandrareaper/storage/MemoryStorageFacade.java
Show resolved
Hide resolved
I'm seeing the error at runtime as well:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything is working great now!
just a few small things to fix and we're good to go.
this.embeddedStorage.storeAll(objects); | ||
this.embeddedStorage.storeRoot(); | ||
} catch (Throwable ex) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue: Can we catch a RuntimeException
instead of a Throwable
which is a bit too wide?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was put in to debug where/what was causing the not-persistable issue I was facing. I can probably just remove the try-catch all together, unless you think it would be helpful to catch it?
this.embeddedStorage.storeRoot(); | ||
} catch (Throwable ex) { | ||
ex.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Todo: This should be replaced by a call to the logger
ex.printStackTrace(); | |
LOG.error("Failed persisting Reaper state on disk", ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here, the stack trace was just making it easier to track down what was failing to persist. Now that I've fixed it, we probably don't need the try-catch at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Catching RuntimeExceptions is probably a good thing to do so we can have an error message that's easy to read.
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I can leave it in. Will change it from Throwable to RuntimeException.
this.memoryStorageRoot.getClusters().entrySet().stream().forEach(entry -> { | ||
Cluster cluster = entry.getValue(); | ||
LOG.info("Loaded cluster: {} / seeds: {}", cluster.getName(), cluster.getSeedHosts()); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Todo: This still needs to be moved to debug level at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work, thanks!
// use relative paths as we are likely running locally | ||
Path projectRoot = FileSystems.getDefault().getPath("..", "..", ".."); | ||
Path ks = projectRoot.resolve(".github/files/keystore.jks"); | ||
Path ts = projectRoot.resolve(".github/files/truststore.jks"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Praise: nice fix, thanks!
Fixes #1487