CASSSIDECAR-373: Define storage provider interface and Cassandra implementation to support durable job tracking#339
Conversation
| { | ||
| BoundStatement statement = tableSchema.trySetActive().bind(clusterName, operationType, operationId); | ||
| statement.setConsistencyLevel(ConsistencyLevel.LOCAL_QUORUM); | ||
| statement.setSerialConsistencyLevel(ConsistencyLevel.LOCAL_SERIAL); |
There was a problem hiding this comment.
Shouldn't we be using global SERIAL to ensure the active operation will be consistent across all DCs?
There was a problem hiding this comment.
We are initially defaulting to LOCAL_SERIAL because GLOBAL_SERIAL for globally distributed clusters (eg: us-east, us-west, eu) would likely timeout. LOCAL_SERIAL can still guarantee that we only have one job ongoing per datacenter, assuming submitted nodes are restricted to that DC.
Once configuration is added for the operational job framework, we should allow consistency level to be set as needed.
There was a problem hiding this comment.
If we're going for per-DC jobs, then it may make sense to add this into the schema as well so that we can get the active job by DC.
There was a problem hiding this comment.
Added datacenter to ActiveClusterOps schema in 55bdd43
6c99923 to
e5a64df
Compare
…ementation to support durable job tracking
55bdd43 to
aa61a52
Compare
CASSSIDECAR-373
Implements
CassandraStorageProvider, the default Cassandra backed implementation of theStorageProviderinterface for durable operational job state.Changes
StorageProviderinterface, which adds a provider-agnostic abstraction for persisting, querying, and coordinating operational jobsOperationalJobRecordis the data transfer object representing persisted job stateOperationalJobConfigurationprovides configurable table TTL, and in the future can support remote Cassandra cluster connectionThree Cassandra table schemas:
cluster_ops— persists and tracks operational jobs (restarts, upgrades, etc.)cluster_ops_node_state— tracks per-node status within an operationactive_cluster_ops— provides mutual exclusion of concurrent operations via LWTDatabase accessors: (
ClusterOpsDatabaseAccessor,ClusterOpsNodeStateDatabaseAccessor,ActiveClusterOpsDatabaseAccessor)CassandraStorageProvidercomposes the three accessors, acts as thin delegation layerIntegration tests for all three database accessors
Future Work