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

Fix user experience when upgrading to 4.0 with compact tables

    XMLWordPrintableJSON

Details

    Description

      The code to handle compact tables has been removed from 4.0, and the intended upgrade path to 4.0 for users having compact tables on 3.x is that they must execute ALTER ... DROP COMPACT STORAGE on all of their compact tables before attempting the upgrade.

      Obviously, some users won't read the upgrade instructions (or miss a table) and may try upgrading despite still having compact tables. If they do so, the intent is that the node will not start, with a message clearly indicating the pre-upgrade step the user has missed. The user will then downgrade back the node(s) to 3.x, run the proper ALTER ... DROP COMPACT STORAGE, and then upgrade again.

      But while 4.0 does currently fail startup when finding any compact tables with a decent message, I believe the check is done too late during startup.

      Namely, that check is done as we read the tables schema, so within Schema.instance.loadFromDisk(). But by then, we've at least called SystemKeyspace.persistLocalMetadata()} and SystemKeyspaceMigrator40.migrate(), which will get into the commit log, and even possibly flush new na format sstables. As a results, a user might not be able to seemlessly restart the node on 3.x (to drop compact storage on the appropriate tables).

      Basically, we should make sure the check for compact tables done at 4.0 startup is done as a StartupCheck, before the node does anything.

      We should also add a test for this (checking that if you try upgrading to 4.0 with compact storage, you can downgrade back with no intervention whatsoever).

      Attachments

        1. Compact_storage_upgrade_tests.txt
          5 kB
          Ekaterina Dimitrova

        Issue Links

          Activity

            People

              e.dimitrova Ekaterina Dimitrova
              slebresne Sylvain Lebresne
              Ekaterina Dimitrova
              Andres de la Peña, Sylvain Lebresne
              Votes:
              0 Vote for this issue
              Watchers:
              5 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 - 20m
                  20m