dcapwell commented on code in PR #3664:
URL: https://github.com/apache/cassandra/pull/3664#discussion_r1833513556
##########
src/java/org/apache/cassandra/service/accord/AccordConfigurationService.java:
##########
@@ -67,23 +66,24 @@
@Simulate(with=MONITORS)
public class AccordConfigurationService extends
AbstractConfigurationService<AccordConfigurationService.EpochState,
AccordConfigurationService.EpochHistory> implements ChangeListener,
AccordEndpointMapper, AccordSyncPropagator.Listener, Shutdownable
{
- private static final Logger logger =
LoggerFactory.getLogger(AccordConfigurationService.class);
-
private final AccordSyncPropagator syncPropagator;
private final DiskStateManager diskStateManager;
+ @GuardedBy("this")
private EpochDiskState diskState = EpochDiskState.EMPTY;
private enum State { INITIALIZED, LOADING, STARTED, SHUTDOWN }
+ @GuardedBy("this")
private State state = State.INITIALIZED;
private volatile EndpointMapping mapping = EndpointMapping.EMPTY;
public enum SyncStatus { NOT_STARTED, NOTIFYING, COMPLETED }
static class EpochState extends
AbstractConfigurationService.AbstractEpochState
{
- SyncStatus syncStatus = SyncStatus.NOT_STARTED;
+ @GuardedBy("AccordConfigurationService.this")
Review Comment:
this is checked then we update disk state... so sharing the lock keeps
reasoning about correctness simpler
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]