Conversation
The failure detector is now configurable via cassandra.custom_failure_detector_class
k-rus
left a comment
There was a problem hiding this comment.
Looks good to my best ability. Just some nits.
I have few comments, which is up to you if you think it is worth to fix:
- There is duplicated code between tests to initialise a ring. It might be good to share it instead of duplicating. This can help to read tests and maintain them in future.
- There is an inconsistency in comments where some comments start with capital letter and others not. I guess the code style tools do not support fixing such formatting.
| } | ||
|
|
||
| @Test | ||
| public void testStateBootReplacingFailsForLiveNode() throws UnknownHostException |
There was a problem hiding this comment.
It seems that the initialisation code, which creates a ring, is the same between the tests. It might be good to replace duplicated code with a single function call if possible.
It is a suggestion, but not required :)
There was a problem hiding this comment.
This is a good idea but I couldn't come up with a scheme that I liked since we need to access various objects both inside the unified method and in the test-specific bits so we'd either end up passing around containers of stuff or wrap everything in another object.
| } | ||
|
|
||
| @Test | ||
| public void testReplacingLiveNodeFails() throws UnknownHostException |
There was a problem hiding this comment.
Same comment about initialisation code, which creates the ring.
|
|
||
| SchemaMigrationEvent e3 = new SchemaMigrationEvent(SchemaMigrationEvent.MigrationManagerEventType.TASK_CREATED, deadEndpoint, null); | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Since I am new to Java, I don't know if it is expected to have a new line at the end of a file. I guess such things would be automatically resolved by formatting tool.
There was a problem hiding this comment.
I generally leave this up to my IDE which seems to insert newlines at the end of files and is a common pattern in cassandra -- probably because the majority of us are using IntelliJ.
There was a problem hiding this comment.
But here it wasn't inserted and in another new file :)
jacek-lewandowski
left a comment
There was a problem hiding this comment.
Some comments from me as well, feel free to apply or ignore, there is nothing critical
| MBEAN_REGISTRATION_CLASS("org.apache.cassandra.mbean_registration_class"), | ||
|
|
||
| /** Which class to use for failure detection */ | ||
| CUSTOM_FAILURE_DETECTOR_PROPERTY("cassandra.custom_failure_detector_class"); |
There was a problem hiding this comment.
maybe we could follow the convention and prepend the property name with org.apache.? wdyt?
There was a problem hiding this comment.
We could do this but it will break CNDB's existing configs and is probably better to be done separately from this port. I'll open another ticket so we can coordinate this name change.
There was a problem hiding this comment.
I suppose that CNDB will have a separate configuration for Converged Cassandra anyway. @JeremiahDJordan wdyt about this kind of changes?
There was a problem hiding this comment.
For reference, this option is currently embedded in the code (not an external config file) for the CNDB writer and CNDB coordinator.
|
|
||
| public interface IFailureDetector | ||
| { | ||
| IFailureDetector instance = CUSTOM_FAILURE_DETECTOR_PROPERTY.getString() == null ? |
There was a problem hiding this comment.
Maybe instead of this and CustomFailureDetector we could have a FailureDetectorFactory which would provide the instance of the appropriate implementation?
There was a problem hiding this comment.
Sure. What would be the benefits? A simpler interface for the initialising the instance field?
There was a problem hiding this comment.
Well, factory is the design pattern which is used to obtain the certain implementation
| new FailureDetector() : | ||
| CustomFailureDetector.make(CUSTOM_FAILURE_DETECTOR_PROPERTY.getString()); | ||
|
|
||
| public static final Predicate<InetAddressAndPort> isEndpointAlive = instance::isAlive; |
There was a problem hiding this comment.
Could those two guys not be static?
| } | ||
|
|
||
| if (FailureDetector.instance.isAlive(oldNode)) | ||
| if (IFailureDetector.instance.isAlive(oldNode)) |
There was a problem hiding this comment.
General comment for this file - if we made those methods which access failure detector non-static, we could have a final field with the failure detector instance which is initialized in the constructor of StorageService. If at some point we wanted to test StorageService class in isolation, we could provide a mock for the failure detector and made make it easier to test
There was a problem hiding this comment.
I like this idea, but I'd like it even more if we made the change at the same time as we tested StorageService in isolation rather than making the tweak now in anticipation of future changes.
Co-authored-by: Ruslan Fomkin <Ruslan.Fomkin@gmail.com>
Co-authored-by: Ruslan Fomkin <Ruslan.Fomkin@gmail.com>
|
Kudos, SonarCloud Quality Gate passed! |
|
Agree with minimal change for the initial porting. |
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959)
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b)
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b)
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559)
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559) STAR-868 Fix rebase compile issues STAR-868 Fix test failures with InstanceAlreadyExistsException for FailureDetector due to bad cherry-pick conflict resolution in FailureDetector
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559) STAR-868 Fix rebase compile issues STAR-868 Fix test failures with InstanceAlreadyExistsException for FailureDetector due to bad cherry-pick conflict resolution in FailureDetector
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559) STAR-868 Fix rebase compile issues STAR-868 Fix test failures with InstanceAlreadyExistsException for FailureDetector due to bad cherry-pick conflict resolution in FailureDetector
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559) STAR-868 Fix rebase compile issues STAR-868 Fix test failures with InstanceAlreadyExistsException for FailureDetector due to bad cherry-pick conflict resolution in FailureDetector
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559) STAR-868 Fix rebase compile issues STAR-868 Fix test failures with InstanceAlreadyExistsException for FailureDetector due to bad cherry-pick conflict resolution in FailureDetector
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559) STAR-868 Fix rebase compile issues STAR-868 Fix test failures with InstanceAlreadyExistsException for FailureDetector due to bad cherry-pick conflict resolution in FailureDetector
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559) STAR-868 Fix rebase compile issues STAR-868 Fix test failures with InstanceAlreadyExistsException for FailureDetector due to bad cherry-pick conflict resolution in FailureDetector (Rebase of commit 0f828a0)
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559) STAR-868 Fix rebase compile issues STAR-868 Fix test failures with InstanceAlreadyExistsException for FailureDetector due to bad cherry-pick conflict resolution in FailureDetector (Rebase of commit 0f828a0)
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559) STAR-868 Fix rebase compile issues STAR-868 Fix test failures with InstanceAlreadyExistsException for FailureDetector due to bad cherry-pick conflict resolution in FailureDetector (Rebase of commit 0f828a0)
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559) STAR-868 Fix rebase compile issues STAR-868 Fix test failures with InstanceAlreadyExistsException for FailureDetector due to bad cherry-pick conflict resolution in FailureDetector (Rebase of commit 0f828a0)
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559) STAR-868 Fix rebase compile issues STAR-868 Fix test failures with InstanceAlreadyExistsException for FailureDetector due to bad cherry-pick conflict resolution in FailureDetector (Rebase of commit 0f828a0)
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559) STAR-868 Fix rebase compile issues STAR-868 Fix test failures with InstanceAlreadyExistsException for FailureDetector due to bad cherry-pick conflict resolution in FailureDetector (Rebase of commit 0f828a0)
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559) STAR-868 Fix rebase compile issues STAR-868 Fix test failures with InstanceAlreadyExistsException for FailureDetector due to bad cherry-pick conflict resolution in FailureDetector (Rebase of commit 0f828a0)
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559) STAR-868 Fix rebase compile issues STAR-868 Fix test failures with InstanceAlreadyExistsException for FailureDetector due to bad cherry-pick conflict resolution in FailureDetector (Rebase of commit 0f828a0)
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559) STAR-868 Fix rebase compile issues STAR-868 Fix test failures with InstanceAlreadyExistsException for FailureDetector due to bad cherry-pick conflict resolution in FailureDetector (Rebase of commit 0f828a0)
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559) STAR-868 Fix rebase compile issues STAR-868 Fix test failures with InstanceAlreadyExistsException for FailureDetector due to bad cherry-pick conflict resolution in FailureDetector (Rebase of commit 0f828a0)
… port (#245) (cherry picked from commit adf34e3) (cherry picked from commit f2a9b43) (cherry picked from commit 68ea688) (cherry picked from commit 4c04a81) (+1 squashed commit) Squashed commits: [47787240498] STAR-842: Port pluggable Failure Detector (#237) The failure detector is now configurable via cassandra.custom_failure_detector_class (cherry picked from commit 8127d43) (cherry picked from commit d9625b6) (cherry picked from commit 3197439) (cherry picked from commit dc27959) (cherry picked from commit 294407b) (cherry picked from commit 5fb2559) STAR-868 Fix rebase compile issues STAR-868 Fix test failures with InstanceAlreadyExistsException for FailureDetector due to bad cherry-pick conflict resolution in FailureDetector (Rebase of commit 0f828a0)








The failure detector is now configurable via cassandra.custom_failure_detector_class