cassandra/src
Jon Haddad fe617688df Snapshot the last-written clustering instead of a stale reusable reference
CursorCompactor.mergePartition tracked the partition's last-written unfiltered
via a direct reference to the source cursor's descriptor (sstableCursors[0].unfiltered()).
That descriptor is reusable and gets overwritten in place as soon as the cursor reads
its next unfiltered -- including ones that are subsequently merged away or purged and
never actually written. By the time the partition closed and updateClusteringMetadata
was called, the reference could describe a clustering that was never written, corrupting
the sstable's min/max clustering metadata.

Fixed by copying the clustering into a dedicated, owned ClusteringDescriptor at the moment
something is genuinely written, rather than holding a reference into a cursor's mutable
scratch state. SSTableCursorWriter.updateClusteringMetadata now takes a ClusteringDescriptor
instead of an UnfilteredDescriptor to make that ownership explicit.

Found by an extended randomized differential soak run (hundreds of examples rather than
the default handful): a single-byte Statistics.db divergence between the iterator and
cursor paths that the logical JSON dump and coarse stats summary both missed, since
neither checks min/max clustering metadata directly.
2026-07-28 18:13:55 -07:00
..
antlr Allow unreserved keywords as user and identity names in USER and IDENTITY statements 2026-07-27 16:03:06 +02:00
java/org/apache/cassandra Snapshot the last-written clustering instead of a stale reusable reference 2026-07-28 18:13:55 -07:00
resources Remove Accord CQL words from the reserved keywords list 2025-05-02 12:51:36 -07:00