Details
-
Improvement
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
Performance
-
Low Hanging Fruit
-
All
-
None
-
Description
Extracted this as a separate ticket per discussion on CASSANDRA-17044
In short, there are two purposes of this change:
- Move the code around to the more appropriate places (for example, CFS specific code for dropping table was moved from SM class to CFS class)
- Relax the synchronization when adding/removing keyspace instances in SM - instead of synchronizing the whole collection of keyspace instances, we only synchronize the related item (the original idea authored by blambov).
The current implementation works because a certain order of opening keyspaces is assumed. If a keyspace is already initialized, it is just returned without sync and sync is done only to initialize the keyspace. When synchronization is extended to the whole method, the system finds itself in a deadlock. This means that some keyspace is tried to be opened during initiazation. Currently it works fine because the keyspace which is not initialized yet is never tried to be opened asynchronously while initializing some other keyspace in a different thread. Hence the conclusion about fragility of the current solution.
Attachments
Issue Links
- causes
-
CASSANDRA-17658 Test Failures: org.apache.cassandra.metrics.KeyspaceMetricsTest.testMetricsCleanupOnDrop
- Resolved