Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-17071

Relax schema synchronization when opening a keyspace

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 4.1-alpha1, 4.1
    • Cluster/Schema
    • None

    Description

      Extracted this as a separate ticket per discussion on CASSANDRA-17044

      In short, there are two purposes of this change:

      1. 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)
      2. 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

          Activity

            People

              jlewandowski Jacek Lewandowski
              jlewandowski Jacek Lewandowski
              Jacek Lewandowski
              Alex Petrov, Branimir Lambov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m