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

StackOverflowError on ALTER after many previous schema changes

    XMLWordPrintableJSON

Details

    Description

      Since 4.1, TableMetadataRefCache re-wraps its fields in Collections.unmodifiableMap on every local schema update. This causes TableMetadataRefCache's Map fields to reference chains of nested UnmodifiableMaps. Eventually, this leads to a StackOverflowError on get(), which has to traverse lots of these maps to fetch the actual value.

      https://github.com/apache/cassandra/blob/4059faf5b948c5a285c25fb0f2e4c4288ee7c305/src/java/org/apache/cassandra/schema/TableMetadataRefCache.java#L53

      The issue goes away on restart, since TableMetadataRefCache is reloaded from disk.

      See CASSANDRA-17044, when TableMetadataRefCache was introduced. This issue was discovered on a real test cluster where schema changes were failing, via a heap dump.

      Attachments

        Issue Links

          Activity

            People

              aratnofsky Abe Ratnofsky
              aratnofsky Abe Ratnofsky
              Abe Ratnofsky
              Caleb Rackliffe, Jacek Lewandowski
              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 10m
                  1h 10m