Skip to content

fix(TTL expired tombstones): Test TTL-expired tombstones according to new sstable dump format #10180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yarongilor
Copy link
Contributor

@yarongilor yarongilor commented Feb 24, 2025

The new format of scylla "sstable dump-data" command dumps the data as is, unlike in the past versions. The test of longevity_tombstone_gc_test.py should count and parse the ttl-expired tombstones according to this format.
Refs: #9980

Testing

PR pre-checks (self review)

  • I added the relevant backport labels
  • I didn't leave commented-out/debugging code

Reminders

  • Add New configuration option and document them (in sdcm/sct_config.py)
  • Add unit tests to cover my changes (under unit-test/ folder)
  • Update the Readme/doc folder relevant to this change (if needed)

@yarongilor
Copy link
Contributor Author

A failure example can now look like:

2025-02-24 08:47:51.271: (TestFrameworkEvent Severity.ERROR) period_type=one-time event_id=8d83da1b-581e-4de5-90bc-855601a99cac, source=TombstoneGcLongevityTest.test_switch_tombstone_gc_modes (longevity_tombstone_gc_test.TombstoneGcLongevityTest)() message=Traceback (most recent call last):
File "/home/ubuntu/scylla-cluster-tests/longevity_tombstone_gc_test.py", line 109, in test_switch_tombstone_gc_modes
sstable_utils.verify_post_repair_ttl_expired_tombstones(table_repair_date=table_repair_date, sstables=sstables)
File "/home/ubuntu/scylla-cluster-tests/sdcm/utils/sstable/sstable_utils.py", line 430, in verify_post_repair_ttl_expired_tombstones
raise NonDeletedTombstonesFound(
sdcm.utils.sstable.sstable_utils.NonDeletedTombstonesFound: Found pre-repair time (2025-02-24 08:44:36) tombstones in a post-repair sstable (/var/lib/scylla/data/scylla_bench/test-1d7d1f90f28b11ef90a5a5a7d02a31e1/me-3go2_0odk_56we8276s8fyobqq5d-big-Data.db): [({'token': '-9223275991055562814', 'raw': '00080000000a0000701d', 'value': '42949701661'}, '2025-02-24 08:44:19z')]

@yarongilor
Copy link
Contributor Author

yarongilor commented Feb 24, 2025

The test found an un-expected TTLed tombstone and failed.

TTL-expired tombstones remained in SSTables beyond the expected GC time. Given that the garbage collection window should be max(gc_grace_seconds, propagation_delay_in_seconds) = 4 minutes, tombstones should have been removed by 09:18:32, but were still present when the test checked recently(5 minutes)-created-sstables at 09:23:50.

propagation delay = gc-grace-seconds = 240 (4 minutes):

< t:2025-02-24 09:14:36,831 f:common.py       l:1326 c:utils                p:DEBUG > Executing CQL 'ALTER TABLE scylla_bench.test with gc_grace_seconds = 864000 and tombstone_gc = {'mode': 'repair', 'propagation_delay_in_seconds':'240'};' ...
< t:2025-02-24 09:14:37,265 f:db_log_reader.py l:125  c:sdcm.db_log_reader   p:DEBUG > 2025-02-24T09:14:37.203+00:00 longevity-tombstone-gc-modes-master-db-node-04791186-3     !INFO | scylla[5250]:  [shard 0:sl:d] migration_manager - Update table 'scylla_bench.test' From org.apache.cassandra.config.CFMetaData@0x600008ba6c00[cfId=314535d0-f28b-11ef-ba34-112f89eecde5,ksName==scylla_bench,cfName=test,cfType=Standard,comparator=org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.LongType,org.apache.cassandra.db.marshal.UTF8Type),comment=,tombstoneGcOptions={"mode":"disabled","propagation_delay_in_seconds":"240"},gcGraceSeconds=240,minCompactionThreshold=4,maxCompactionThreshold=32,columnMetadata=[ColumnDefinition{name=pk, type=org.apache.cassandra.db.marshal.LongType, kind=PARTITION_KEY, componentIndex=0, droppedAt=-9223372036854775808}, ColumnDefinition{name=ck, type=org.apache.cassandra.db.marshal.LongType, kind=CLUSTERING_COLUMN, componentIndex=0, droppedAt=-9223372036854775808}, ColumnDefinition{name=v, type=org.apache.cassandra.db.marshal.BytesType, kind=REGULAR, componentIndex=null, droppedAt=-9223372036854775808}],compactionStrategyClass=class org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy,compactionStrategyOptions={compaction_window_size=5, compaction_window_unit=MINUTES, enabled=true},compressionParameters={sstable_compression=org.apache.cassandra.io.compress.LZ4Compressor},bloomFilterFpChance=0.01,memtableFlushPeriod=0,caching={"keys":"ALL","rows_per_partition":"ALL"},cdc={},defaultTimeToLive=240,minIndexInterval=128,maxIndexInterval=2048,speculativeRetry=99.0PERCENTILE,tablets={},triggers=[],isDense=false,in_memory=false,version=3230a740-f28b-11ef-9a88-ce7de62bf2a1,droppedColumns={},collections={},indices={}] To org.apache.cassandra.config.CFMetaData@0x60000a8d6000[cfId=314535d0-f28b-11ef-ba34-112f89eecde5,ksName==scylla_bench,cfName=test,cfType=Standard,comparator=org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.LongType,org.apache.cassandra.db.marshal.UTF8Type),comment=,tombstoneGcOptions={"mode":"repair","propagation_delay_in_seconds":"240"},gcGraceSeconds=864000,minCompactionThreshold=4,maxCompactionThreshold=32,columnMetadata=[ColumnDefinition{name=pk, type=org.apache.cassandra.db.marshal.LongType, kind=PARTITION_KEY, componentIndex=0, droppedAt=-9223372036854775808}, ColumnDefinition{name=ck, type=org.apache.cassandra.db.marshal.LongType, kind=CLUSTERING_COLUMN, componentIndex=0, droppedAt=-9223372036854775808}, ColumnDefinition{name=v, type=org.apache.cassandra.db.marshal.BytesType, kind=REGULAR, componentIndex=null, droppedAt=-9223372036854775808}],compactionStrategyClass=class org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy,compactionStrategyOptions={compaction_window_size=5, compaction_window_unit=MINUTES, enabled=true},compressionParameters={sstable_compression=org.apache.cassandra.io.compress.LZ4Compressor},bloomFilterFpChance=0.01,memtableFlushPeriod=0,caching={"keys":"ALL","rows_per_partition":"ALL"},cdc={},defaultTimeToLive=240,minIndexInterval=128,maxIndexInterval=2048,speculativeRetry=99.0PERCENTILE,tablets={},triggers=[],isDense=false,in_memory=false,version=c4d54110-f28f-11ef-ba34-112f89eecde5,droppedColumns={},collections={},indices={}]

TTL expired tombstone deletion time is: '2025-02-24 09:11:23z'

repair time for node-1 is 2025-02-24 09:14:51:

< t:2025-02-24 09:14:50,555 f:remote_base.py  l:560  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: Running command "/usr/bin/nodetool  repair -pr scylla_bench test"...
< t:2025-02-24 09:14:50,557 f:remote_base.py  l:560  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.168>: Running command "/usr/bin/nodetool  repair -pr scylla_bench test"...
< t:2025-02-24 09:14:50,558 f:remote_base.py  l:560  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.136>: Running command "/usr/bin/nodetool  repair -pr scylla_bench test"...
< t:2025-02-24 09:14:51,219 f:base.py         l:143  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: Command "/usr/bin/nodetool  repair -pr scylla_bench test" finished with status 0
< t:2025-02-24 09:14:51,219 f:cluster.py      l:2672 c:sdcm.cluster_aws     p:DEBUG > Node longevity-tombstone-gc-modes-master-db-node-04791186-1 [54.247.217.87 | 10.4.2.45]: Command '/usr/bin/nodetool  repair -pr scylla_bench test' duration -> 0.663982969999779 s
< t:2025-02-24 09:15:22,742 f:base.py         l:143  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.136>: Command "/usr/bin/nodetool  repair -pr scylla_bench test" finished with status 0
< t:2025-02-24 09:15:22,742 f:cluster.py      l:2672 c:sdcm.cluster_aws     p:DEBUG > Node longevity-tombstone-gc-modes-master-db-node-04791186-3 [54.216.87.246 | 10.4.0.136]: Command '/usr/bin/nodetool  repair -pr scylla_bench test' duration -> 32.184071518999644 s
< t:2025-02-24 09:15:25,243 f:base.py         l:143  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.168>: Command "/usr/bin/nodetool  repair -pr scylla_bench test" finished with status 0
< t:2025-02-24 09:15:25,243 f:cluster.py      l:2672 c:sdcm.cluster_aws     p:DEBUG > Node longevity-tombstone-gc-modes-master-db-node-04791186-2 [54.194.73.240 | 10.4.0.168]: Command '/usr/bin/nodetool  repair -pr scylla_bench test' duration -> 34.68587234500001 s

Looked for sstables of the last 5 minutes (09:18:51 and on):

< t:2025-02-24 09:23:51,366 f:db_log_reader.py l:125  c:sdcm.db_log_reader   p:DEBUG > 2025-02-24T09:23:51.344+00:00 longevity-tombstone-gc-modes-master-db-node-04791186-1   !NOTICE | sudo[6618]: scyllaadm : (command continued) /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwo_0jpvk2f9cdip0fu4rl-big-Data.db -maxdepth 1 -type f -cmin -5
< t:2025-02-24 09:23:51,367 f:db_log_reader.py l:125  c:sdcm.db_log_reader   p:DEBUG > 2025-02-24T09:23:51.344+00:00 longevity-tombstone-gc-modes-master-db-node-04791186-1     !INFO | sudo[6618]: pam_unix(sudo:session): session opened for user root(uid=0) by scyllaadm(uid=1000)
< t:2025-02-24 09:23:51,367 f:db_log_reader.py l:125  c:sdcm.db_log_reader   p:DEBUG > 2025-02-24T09:23:51.344+00:00 longevity-tombstone-gc-modes-master-db-node-04791186-1     !INFO | sudo[6618]: pam_unix(sudo:session): session closed for user root
< t:2025-02-24 09:23:51,481 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwm_05cwg2clndqzsh53mp-big-Data.db
< t:2025-02-24 09:23:51,482 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwm_06n742clndqzsh53mp-big-Data.db
< t:2025-02-24 09:23:51,482 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwm_0bsds2clndqzsh53mp-big-Data.db
< t:2025-02-24 09:23:51,482 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwm_14xrk2clndqzsh53mp-big-Data.db
< t:2025-02-24 09:23:51,482 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwn_5jjn42f9cdip0fu4rl-big-Data.db
< t:2025-02-24 09:23:51,482 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwn_5m48g2f9cdip0fu4rl-big-Data.db
< t:2025-02-24 09:23:51,482 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwn_5ntyo2f9cdip0fu4rl-big-Data.db
< t:2025-02-24 09:23:51,482 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwo_0jpvk2f9cdip0fu4rl-big-Data.db
< t:2025-02-24 09:23:51,483 f:base.py         l:143  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: Command "sudo find /var/lib/scylla/data/scylla_bench/test-*/*-big-Data.db -maxdepth 1 -type f -cmin -5" finished with status 0
< t:2025-02-24 09:23:51,483 f:sstable_utils.py l:59   c:SstableUtils         p:DEBUG > Got 8 sstables filtered by last 5 minutes
< t:2025-02-24 09:23:51,483 f:longevity_tombstone_gc_test.py l:103  c:TombstoneGcLongevityTest p:DEBUG > Starting sstable dump to verify correctness of tombstones for 8 sstables

Failure event - a recently created sstable contains an "old" (pre-repair) tombstone ('2025-02-24 09:11:23z') :

2025-02-24 09:24:44.115: (TestFrameworkEvent Severity.ERROR) period_type=one-time event_id=548b14d3-609e-4d51-a554-090b041a02ef, source=TombstoneGcLongevityTest.test_switch_tombstone_gc_modes (longevity_tombstone_gc_test.TombstoneGcLongevityTest)() message=Traceback (most recent call last):
File "/home/ubuntu/scylla-cluster-tests/longevity_tombstone_gc_test.py", line 105, in test_switch_tombstone_gc_modes
sstable_utils.verify_post_repair_ttl_expired_tombstones(table_repair_date=table_repair_date, sstables=sstables)
File "/home/ubuntu/scylla-cluster-tests/sdcm/utils/sstable/sstable_utils.py", line 377, in verify_post_repair_ttl_expired_tombstones
raise NonDeletedTombstonesFound(
sdcm.utils.sstable.sstable_utils.NonDeletedTombstonesFound: Found pre-repair time (2025-02-24 09:14:32) tombstones in a post-repair sstable (/var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwm_05cwg2clndqzsh53mp-big-Data.db): [({'token': '-9216196284248430950', 'raw': '0008000000ad00000004', 'value': '743029342212'}, '2025-02-24 09:11:23z')]

@tchaikov , @asias , can you please advise? could it be a test issue incorrectly expecting sstable to clear tombstones? or a scylla issue?

@yarongilor yarongilor force-pushed the fix_test_switch_tombstone_gc_modes branch from a684d95 to 167db25 Compare February 25, 2025 17:11
@yarongilor
Copy link
Contributor Author

yarongilor commented Feb 26, 2025

The test found an un-expected TTLed tombstone and failed.

TTL-expired tombstones remained in SSTables beyond the expected GC time. Given that the garbage collection window should be max(gc_grace_seconds, propagation_delay_in_seconds) = 4 minutes, tombstones should have been removed by 09:18:32, but were still present when the test checked recently(5 minutes)-created-sstables at 09:23:50.

propagation delay = gc-grace-seconds = 240 (4 minutes):

< t:2025-02-24 09:14:36,831 f:common.py       l:1326 c:utils                p:DEBUG > Executing CQL 'ALTER TABLE scylla_bench.test with gc_grace_seconds = 864000 and tombstone_gc = {'mode': 'repair', 'propagation_delay_in_seconds':'240'};' ...
< t:2025-02-24 09:14:37,265 f:db_log_reader.py l:125  c:sdcm.db_log_reader   p:DEBUG > 2025-02-24T09:14:37.203+00:00 longevity-tombstone-gc-modes-master-db-node-04791186-3     !INFO | scylla[5250]:  [shard 0:sl:d] migration_manager - Update table 'scylla_bench.test' From org.apache.cassandra.config.CFMetaData@0x600008ba6c00[cfId=314535d0-f28b-11ef-ba34-112f89eecde5,ksName==scylla_bench,cfName=test,cfType=Standard,comparator=org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.LongType,org.apache.cassandra.db.marshal.UTF8Type),comment=,tombstoneGcOptions={"mode":"disabled","propagation_delay_in_seconds":"240"},gcGraceSeconds=240,minCompactionThreshold=4,maxCompactionThreshold=32,columnMetadata=[ColumnDefinition{name=pk, type=org.apache.cassandra.db.marshal.LongType, kind=PARTITION_KEY, componentIndex=0, droppedAt=-9223372036854775808}, ColumnDefinition{name=ck, type=org.apache.cassandra.db.marshal.LongType, kind=CLUSTERING_COLUMN, componentIndex=0, droppedAt=-9223372036854775808}, ColumnDefinition{name=v, type=org.apache.cassandra.db.marshal.BytesType, kind=REGULAR, componentIndex=null, droppedAt=-9223372036854775808}],compactionStrategyClass=class org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy,compactionStrategyOptions={compaction_window_size=5, compaction_window_unit=MINUTES, enabled=true},compressionParameters={sstable_compression=org.apache.cassandra.io.compress.LZ4Compressor},bloomFilterFpChance=0.01,memtableFlushPeriod=0,caching={"keys":"ALL","rows_per_partition":"ALL"},cdc={},defaultTimeToLive=240,minIndexInterval=128,maxIndexInterval=2048,speculativeRetry=99.0PERCENTILE,tablets={},triggers=[],isDense=false,in_memory=false,version=3230a740-f28b-11ef-9a88-ce7de62bf2a1,droppedColumns={},collections={},indices={}] To org.apache.cassandra.config.CFMetaData@0x60000a8d6000[cfId=314535d0-f28b-11ef-ba34-112f89eecde5,ksName==scylla_bench,cfName=test,cfType=Standard,comparator=org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.LongType,org.apache.cassandra.db.marshal.UTF8Type),comment=,tombstoneGcOptions={"mode":"repair","propagation_delay_in_seconds":"240"},gcGraceSeconds=864000,minCompactionThreshold=4,maxCompactionThreshold=32,columnMetadata=[ColumnDefinition{name=pk, type=org.apache.cassandra.db.marshal.LongType, kind=PARTITION_KEY, componentIndex=0, droppedAt=-9223372036854775808}, ColumnDefinition{name=ck, type=org.apache.cassandra.db.marshal.LongType, kind=CLUSTERING_COLUMN, componentIndex=0, droppedAt=-9223372036854775808}, ColumnDefinition{name=v, type=org.apache.cassandra.db.marshal.BytesType, kind=REGULAR, componentIndex=null, droppedAt=-9223372036854775808}],compactionStrategyClass=class org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy,compactionStrategyOptions={compaction_window_size=5, compaction_window_unit=MINUTES, enabled=true},compressionParameters={sstable_compression=org.apache.cassandra.io.compress.LZ4Compressor},bloomFilterFpChance=0.01,memtableFlushPeriod=0,caching={"keys":"ALL","rows_per_partition":"ALL"},cdc={},defaultTimeToLive=240,minIndexInterval=128,maxIndexInterval=2048,speculativeRetry=99.0PERCENTILE,tablets={},triggers=[],isDense=false,in_memory=false,version=c4d54110-f28f-11ef-ba34-112f89eecde5,droppedColumns={},collections={},indices={}]

TTL expired tombstone deletion time is: '2025-02-24 09:11:23z'

repair time for node-1 is 2025-02-24 09:14:51:

< t:2025-02-24 09:14:50,555 f:remote_base.py  l:560  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: Running command "/usr/bin/nodetool  repair -pr scylla_bench test"...
< t:2025-02-24 09:14:50,557 f:remote_base.py  l:560  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.168>: Running command "/usr/bin/nodetool  repair -pr scylla_bench test"...
< t:2025-02-24 09:14:50,558 f:remote_base.py  l:560  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.136>: Running command "/usr/bin/nodetool  repair -pr scylla_bench test"...
< t:2025-02-24 09:14:51,219 f:base.py         l:143  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: Command "/usr/bin/nodetool  repair -pr scylla_bench test" finished with status 0
< t:2025-02-24 09:14:51,219 f:cluster.py      l:2672 c:sdcm.cluster_aws     p:DEBUG > Node longevity-tombstone-gc-modes-master-db-node-04791186-1 [54.247.217.87 | 10.4.2.45]: Command '/usr/bin/nodetool  repair -pr scylla_bench test' duration -> 0.663982969999779 s
< t:2025-02-24 09:15:22,742 f:base.py         l:143  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.136>: Command "/usr/bin/nodetool  repair -pr scylla_bench test" finished with status 0
< t:2025-02-24 09:15:22,742 f:cluster.py      l:2672 c:sdcm.cluster_aws     p:DEBUG > Node longevity-tombstone-gc-modes-master-db-node-04791186-3 [54.216.87.246 | 10.4.0.136]: Command '/usr/bin/nodetool  repair -pr scylla_bench test' duration -> 32.184071518999644 s
< t:2025-02-24 09:15:25,243 f:base.py         l:143  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.168>: Command "/usr/bin/nodetool  repair -pr scylla_bench test" finished with status 0
< t:2025-02-24 09:15:25,243 f:cluster.py      l:2672 c:sdcm.cluster_aws     p:DEBUG > Node longevity-tombstone-gc-modes-master-db-node-04791186-2 [54.194.73.240 | 10.4.0.168]: Command '/usr/bin/nodetool  repair -pr scylla_bench test' duration -> 34.68587234500001 s

Looked for sstables of the last 5 minutes (09:18:51 and on):

< t:2025-02-24 09:23:51,366 f:db_log_reader.py l:125  c:sdcm.db_log_reader   p:DEBUG > 2025-02-24T09:23:51.344+00:00 longevity-tombstone-gc-modes-master-db-node-04791186-1   !NOTICE | sudo[6618]: scyllaadm : (command continued) /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwo_0jpvk2f9cdip0fu4rl-big-Data.db -maxdepth 1 -type f -cmin -5
< t:2025-02-24 09:23:51,367 f:db_log_reader.py l:125  c:sdcm.db_log_reader   p:DEBUG > 2025-02-24T09:23:51.344+00:00 longevity-tombstone-gc-modes-master-db-node-04791186-1     !INFO | sudo[6618]: pam_unix(sudo:session): session opened for user root(uid=0) by scyllaadm(uid=1000)
< t:2025-02-24 09:23:51,367 f:db_log_reader.py l:125  c:sdcm.db_log_reader   p:DEBUG > 2025-02-24T09:23:51.344+00:00 longevity-tombstone-gc-modes-master-db-node-04791186-1     !INFO | sudo[6618]: pam_unix(sudo:session): session closed for user root
< t:2025-02-24 09:23:51,481 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwm_05cwg2clndqzsh53mp-big-Data.db
< t:2025-02-24 09:23:51,482 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwm_06n742clndqzsh53mp-big-Data.db
< t:2025-02-24 09:23:51,482 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwm_0bsds2clndqzsh53mp-big-Data.db
< t:2025-02-24 09:23:51,482 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwm_14xrk2clndqzsh53mp-big-Data.db
< t:2025-02-24 09:23:51,482 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwn_5jjn42f9cdip0fu4rl-big-Data.db
< t:2025-02-24 09:23:51,482 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwn_5m48g2f9cdip0fu4rl-big-Data.db
< t:2025-02-24 09:23:51,482 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwn_5ntyo2f9cdip0fu4rl-big-Data.db
< t:2025-02-24 09:23:51,482 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: /var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwo_0jpvk2f9cdip0fu4rl-big-Data.db
< t:2025-02-24 09:23:51,483 f:base.py         l:143  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.45>: Command "sudo find /var/lib/scylla/data/scylla_bench/test-*/*-big-Data.db -maxdepth 1 -type f -cmin -5" finished with status 0
< t:2025-02-24 09:23:51,483 f:sstable_utils.py l:59   c:SstableUtils         p:DEBUG > Got 8 sstables filtered by last 5 minutes
< t:2025-02-24 09:23:51,483 f:longevity_tombstone_gc_test.py l:103  c:TombstoneGcLongevityTest p:DEBUG > Starting sstable dump to verify correctness of tombstones for 8 sstables

Failure event - a recently created sstable contains an "old" (pre-repair) tombstone ('2025-02-24 09:11:23z') :

2025-02-24 09:24:44.115: (TestFrameworkEvent Severity.ERROR) period_type=one-time event_id=548b14d3-609e-4d51-a554-090b041a02ef, source=TombstoneGcLongevityTest.test_switch_tombstone_gc_modes (longevity_tombstone_gc_test.TombstoneGcLongevityTest)() message=Traceback (most recent call last):
File "/home/ubuntu/scylla-cluster-tests/longevity_tombstone_gc_test.py", line 105, in test_switch_tombstone_gc_modes
sstable_utils.verify_post_repair_ttl_expired_tombstones(table_repair_date=table_repair_date, sstables=sstables)
File "/home/ubuntu/scylla-cluster-tests/sdcm/utils/sstable/sstable_utils.py", line 377, in verify_post_repair_ttl_expired_tombstones
raise NonDeletedTombstonesFound(
sdcm.utils.sstable.sstable_utils.NonDeletedTombstonesFound: Found pre-repair time (2025-02-24 09:14:32) tombstones in a post-repair sstable (/var/lib/scylla/data/scylla_bench/test-314535d0f28b11efba34112f89eecde5/me-3go2_0pwm_05cwg2clndqzsh53mp-big-Data.db): [({'token': '-9216196284248430950', 'raw': '0008000000ad00000004', 'value': '743029342212'}, '2025-02-24 09:11:23z')]

@tchaikov , @asias , can you please advise? could it be a test issue incorrectly expecting sstable to clear tombstones? or a scylla issue?

A test also failed with other gc-mode like "immediate", so something with ttl-expired-tombstones is not clear here:

< t:2025-02-25 09:44:54,720 f:longevity_tombstone_gc_test.py l:91   c:TombstoneGcLongevityTest p:INFO  > change gc-grace-seconds back to default of 10 days and tombstone-gc mode to 'repair'
< t:2025-02-25 09:44:55,652 f:longevity_tombstone_gc_test.py l:26   c:TombstoneGcLongevityTest p:INFO  > Run a flush for scylla_bench on nodes
< t:2025-02-25 09:45:06,767 f:longevity_tombstone_gc_test.py l:31   c:TombstoneGcLongevityTest p:INFO  > Run a repair for scylla_bench.test on nodes
< t:2025-02-25 09:49:36,478 f:longevity_tombstone_gc_test.py l:39   c:TombstoneGcLongevityTest p:INFO  > Run a major compaction for scylla_bench.test on node
< t:2025-02-25 09:52:00,107 f:longevity_tombstone_gc_test.py l:99   c:TombstoneGcLongevityTest p:INFO  > verify no tombstones exist in post-repair-created sstables
< t:2025-02-25 09:52:00,127 f:sstable_utils.py l:185  c:SstableUtils         p:DEBUG > Number of rows in repair_time results: 2
< t:2025-02-25 09:52:00,127 f:sstable_utils.py l:186  c:SstableUtils         p:DEBUG > Last row in repair_time results: Row(repair_time=datetime.datetime(2025, 2, 25, 9, 44, 30))
< t:2025-02-25 09:52:00,129 f:sstable_utils.py l:197  c:SstableUtils         p:DEBUG > Found table-repair-date: 2025-02-25 09:44:30, Ended 2 minutes ago
< t:2025-02-25 09:52:00,631 f:sstable_utils.py l:61   c:SstableUtils         p:DEBUG > Got 0 sstables filtered by last 2 minutes
< t:2025-02-25 09:52:00,632 f:longevity_tombstone_gc_test.py l:103  c:TombstoneGcLongevityTest p:DEBUG > Starting sstable dump to verify correctness of tombstones for 0 sstables
< t:2025-02-25 09:52:00,632 f:longevity_tombstone_gc_test.py l:107  c:TombstoneGcLongevityTest p:INFO  > Change tombstone-gc mode to 'immediate'
< t:2025-02-25 09:52:01,501 f:longevity_tombstone_gc_test.py l:112  c:TombstoneGcLongevityTest p:INFO  > Wait a duration of schema-agreement and propagation_delay_in_seconds
< t:2025-02-25 09:56:55,966 f:longevity_tombstone_gc_test.py l:116  c:TombstoneGcLongevityTest p:INFO  > Wait for s-b load to finish
< t:2025-02-25 10:18:12,513 f:sstable_utils.py l:61   c:SstableUtils         p:DEBUG > Got 31 sstables (not filtered by time)


< t:2025-02-25 10:38:59,749 f:longevity_tombstone_gc_test.py l:119  c:TombstoneGcLongevityTest p:INFO  > Wait a duration of propagation_delay_in_seconds
< t:2025-02-25 10:43:07,830 f:longevity_tombstone_gc_test.py l:122  c:TombstoneGcLongevityTest p:INFO  > Run a major compaction for user-table on node
< t:2025-02-25 10:45:53,037 f:longevity_tombstone_gc_test.py l:125  c:TombstoneGcLongevityTest p:INFO  > Verify no compacted tombstones in sstables
< t:2025-02-25 10:45:53,539 f:sstable_utils.py l:61   c:SstableUtils         p:DEBUG > Got 28 sstables filtered by last 48 minutes
< t:2025-02-25 10:45:53,539 f:longevity_tombstone_gc_test.py l:129  c:TombstoneGcLongevityTest p:DEBUG > Starting sstabledump to verify correctness of tombstones for 28 sstables
< t:2025-02-25 10:46:02,136 f:sstable_utils.py l:236  c:SstableUtils         p:DEBUG > Tombstones are found in SSTable /var/lib/scylla/data/scylla_bench/test-7eb736f0f35911ef87b911ce3ccae8e9/me-3go3_0trw_4o93k2ue9qrk1qwgaz-big-Data.db.
< t:2025-02-25 10:46:09,587 f:sstable_utils.py l:319  c:SstableUtils         p:DEBUG > Found 190 TTL-expired tombstones for SSTable /var/lib/scylla/data/scylla_bench/test-7eb736f0f35911ef87b911ce3ccae8e9/me-3go3_0trw_4o93k2ue9qrk1qwgaz-big-Data.db
< t:2025-02-25 10:46:27,249 f:file_logger.py  l:101  c:sdcm.sct_events.file_logger p:ERROR > 2025-02-25 10:46:23.339: (TestFrameworkEvent Severity.ERROR) period_type=one-time event_id=6a73bf17-d55b-4cdc-b5ec-6cfce7364f7a, source=TombstoneGcLongevityTest.test_switch_tombstone_gc_modes (longevity_tombstone_gc_test.TombstoneGcLongevityTest)() message=Traceback (most recent call last):
< t:2025-02-25 10:46:27,249 f:file_logger.py  l:101  c:sdcm.sct_events.file_logger p:ERROR >   File "/home/ubuntu/scylla-cluster-tests/longevity_tombstone_gc_test.py", line 133, in test_switch_tombstone_gc_modes
< t:2025-02-25 10:49:27,531 f:tester.py       l:3715 c:TombstoneGcLongevityTest p:DEBUG > Email data: {'backend': 'aws', 'build_id': '40', 'job_url': 'https://jenkins.scylladb.com/job/scylla-staging/job/yarongilor/job/byo-longevity-test-yg2/40/', 'end_time': '2025-02-25 10:47:15', 'events_summary': {'NORMAL': 49, 'WARNING': 19, 'ERROR': 1}, 'last_events': {'CRITICAL': [], 'ERROR': ['2025-02-25 10:46:23.339: (TestFrameworkEvent Severity.ERROR) period_type=one-time event_id=6a73bf17-d55b-4cdc-b5ec-6cfce7364f7a, source=TombstoneGcLongevityTest.test_switch_tombstone_gc_modes (longevity_tombstone_gc_test.TombstoneGcLongevityTest)() message=Traceback (most recent call last):\nFile "/home/ubuntu/scylla-cluster-tests/longevity_tombstone_gc_test.py", line 133, in test_switch_tombstone_gc_modes\nassert not tombstone_deletion_info, f"Found unexpected existing tombstones: {tombstone_deletion_info} for sstable: {sstable}"\nAssertionError: Found unexpected existing tombstones: [({\'key\': {\'token\': \'-9221377397302716968\', \'raw\': \'00080000009c0000000a\', \'value\': \'670014898186\'}, \'clustering_elements\': [{\'type\': \'clustering-row\', \'key\': {\'raw\': \'0008e7d895cc49138534\', \'value\': \'-1740476551346813644\'}, \'marker\': {\'timestamp\': 1740479939264448}, \'columns\': {\'v\': {\'is_live\': False, \'type\': \'regular\', \'timestamp\': 1740479939264448, \'deletion_time\': \'2025-02-25 10:38:59z\'}}}, {\'type\': \'clustering-row\', \'key\': {\'raw\': \'0008e7d895cc49def889\', \'value\': \'-1740476551333480311\'}, \'marker\': {\'timestamp\': 1740479939221991}, \'columns\': {\'v\': {\'is_live\': False, \'type\': \'regular\', \'timestamp\': 1740479939221991, \'deletion_time\': \'2025-02-25 10:38:59z\'}}}, {\'type\': \'clustering-row\', \'key\': {\'raw\': \'0008e7d895cc4aaa6bde\', \'value\': \'-1740476551320146978\'}, \'marker\': {\'timestamp\': 1740479939191608}, \'columns\': {\'v\': {\'is_live\': False, \'type\': \'regular\', \'timestamp\': 1740479939191608, \'deletion_time\': \'2025-02-25 10:38:59z\'}}}, {\'type\': \'clustering-row\', \'key\': {\'raw\': \'0008e7d895cc4b75df33\', \'value\': \'-1740476551306813645\'},

@yarongilor
Copy link
Contributor Author

@tchaikov , @denesb , @pehala ,
the above issue is blocking the testing of tombstone-gc-modes longevity_tombstone_gc_test.py.
If necessary i can open an issue for it or also try reproducing in Dtest. Please advise.

@denesb
Copy link

denesb commented Mar 3, 2025

< t:2025-02-25 10:49:27,531 f:tester.py l:3715 c:TombstoneGcLongevityTest p:DEBUG > Email data: {'backend': 'aws', 'build_id': '40', 'job_url': 'https://jenkins.scylladb.com/job/scylla-staging/job/yarongilor/job/byo-longevity-test-yg2/40/', 'end_time': '2025-02-25 10:47:15', 'events_summary': {'NORMAL': 49, 'WARNING': 19, 'ERROR': 1}, 'last_events': {'CRITICAL': [], 'ERROR': ['2025-02-25 10:46:23.339: (TestFrameworkEvent Severity.ERROR) period_type=one-time event_id=6a73bf17-d55b-4cdc-b5ec-6cfce7364f7a, source=TombstoneGcLongevityTest.test_switch_tombstone_gc_modes (longevity_tombstone_gc_test.TombstoneGcLongevityTest)() message=Traceback (most recent call last):\nFile "/home/ubuntu/scylla-cluster-tests/longevity_tombstone_gc_test.py", line 133, in test_switch_tombstone_gc_modes\nassert not tombstone_deletion_info, f"Found unexpected existing tombstones: {tombstone_deletion_info} for sstable: {sstable}"\nAssertionError: Found unexpected existing tombstones: [({'key': {'token': '-9221377397302716968', 'raw': '00080000009c0000000a', 'value': '670014898186'}, 'clustering_elements': [{'type': 'clustering-row', 'key': {'raw': '0008e7d895cc49138534', 'value': '-1740476551346813644'}, 'marker': {'timestamp': 1740479939264448}, 'columns': {'v': {'is_live': False, 'type': 'regular', 'timestamp': 1740479939264448, 'deletion_time': '2025-02-25 10:38:59z'}}}, {'type': 'clustering-row', 'key': {'raw': '0008e7d895cc49def889', 'value': '-1740476551333480311'}, 'marker': {'timestamp': 1740479939221991}, 'columns': {'v': {'is_live': False, 'type': 'regular', 'timestamp': 1740479939221991, 'deletion_time': '2025-02-25 10:38:59z'}}}, {'type': 'clustering-row', 'key': {'raw': '0008e7d895cc4aaa6bde', 'value': '-1740476551320146978'}, 'marker': {'timestamp': 1740479939191608}, 'columns': {'v': {'is_live': False, 'type': 'regular', 'timestamp': 1740479939191608, 'deletion_time': '2025-02-25 10:38:59z'}}}, {'type': 'clustering-row', 'key': {'raw': '0008e7d895cc4b75df33', 'value': '-1740476551306813645'},

It is unclear to me what this test expects. Note that regardless of the mode, tombstones don't just disappear after they become purgeable, they need a compaction to run to purge them. Even then, compaction can fail to purge tombstones because of overlap checks (be that false-positive or true-positive). Overlap checks look at memtables, commitlog and other sstables. So for best results: use /storage_service/keyspace_compaction/$keyspace?flush_memtables=1 (but this will only work reliably if there is a single user table).

@yarongilor
Copy link
Contributor Author

< t:2025-02-25 10:49:27,531 f:tester.py l:3715 c:TombstoneGcLongevityTest p:DEBUG > Email data: {'backend': 'aws', 'build_id': '40', 'job_url': 'https://jenkins.scylladb.com/job/scylla-staging/job/yarongilor/job/byo-longevity-test-yg2/40/', 'end_time': '2025-02-25 10:47:15', 'events_summary': {'NORMAL': 49, 'WARNING': 19, 'ERROR': 1}, 'last_events': {'CRITICAL': [], 'ERROR': ['2025-02-25 10:46:23.339: (TestFrameworkEvent Severity.ERROR) period_type=one-time event_id=6a73bf17-d55b-4cdc-b5ec-6cfce7364f7a, source=TombstoneGcLongevityTest.test_switch_tombstone_gc_modes (longevity_tombstone_gc_test.TombstoneGcLongevityTest)() message=Traceback (most recent call last):\nFile "/home/ubuntu/scylla-cluster-tests/longevity_tombstone_gc_test.py", line 133, in test_switch_tombstone_gc_modes\nassert not tombstone_deletion_info, f"Found unexpected existing tombstones: {tombstone_deletion_info} for sstable: {sstable}"\nAssertionError: Found unexpected existing tombstones: [({'key': {'token': '-9221377397302716968', 'raw': '00080000009c0000000a', 'value': '670014898186'}, 'clustering_elements': [{'type': 'clustering-row', 'key': {'raw': '0008e7d895cc49138534', 'value': '-1740476551346813644'}, 'marker': {'timestamp': 1740479939264448}, 'columns': {'v': {'is_live': False, 'type': 'regular', 'timestamp': 1740479939264448, 'deletion_time': '2025-02-25 10:38:59z'}}}, {'type': 'clustering-row', 'key': {'raw': '0008e7d895cc49def889', 'value': '-1740476551333480311'}, 'marker': {'timestamp': 1740479939221991}, 'columns': {'v': {'is_live': False, 'type': 'regular', 'timestamp': 1740479939221991, 'deletion_time': '2025-02-25 10:38:59z'}}}, {'type': 'clustering-row', 'key': {'raw': '0008e7d895cc4aaa6bde', 'value': '-1740476551320146978'}, 'marker': {'timestamp': 1740479939191608}, 'columns': {'v': {'is_live': False, 'type': 'regular', 'timestamp': 1740479939191608, 'deletion_time': '2025-02-25 10:38:59z'}}}, {'type': 'clustering-row', 'key': {'raw': '0008e7d895cc4b75df33', 'value': '-1740476551306813645'},

It is unclear to me what this test expects. Note that regardless of the mode, tombstones don't just disappear after they become purgeable, they need a compaction to run to purge them. Even then, compaction can fail to purge tombstones because of overlap checks (be that false-positive or true-positive). Overlap checks look at memtables, commitlog and other sstables. So for best results: use /storage_service/keyspace_compaction/$keyspace?flush_memtables=1 (but this will only work reliably if there is a single user table).

@denesb , AFAIK, this test is based on tombstones-gc functionality, as also tested in Dtest like in https://github.com/scylladb/scylla-dtest/blame/4fdd2393c3f271d5716906f74b577686a73bef2e/compaction_test.py#L283.
In this scenario, it similarly run, for example, a nodetool flush and compact before checking tombstone state.
The test is indeed involve with a single table, that's the table of scylla_bench.test.
This test passed ok, in past versions like 5.3 (with sstabledump util) like in: https://argus.scylladb.com/tests/scylla-cluster-tests/5b52e150-0894-4376-9fdf-a50312ed6287
Please advise for any possible wrong assumptions of the test, or if the logic of Scylla is changed.

(col_data["deletion_time"]
for row in partition.get("clustering_elements", [])
for col_data in row.get("columns", {}).values()
if "deletion_time" in col_data),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will match both live cells which have TTL as well as expired ones.

Copy link
Contributor Author

@yarongilor yarongilor Mar 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@denesb , following your and Kefu's suggestions i concluded "deletion_time" only present for ttl-expired tombstones. Indeed, when tested, it looks like non-expired cells has no "deletion_time", rather it has "expiry" instead. example for live cell:

{"sstables":{"/var/lib/scylla/data/scylla_bench/test-883a9260eea111efabef9647978d48d9/me-3gnx_0pqw_2u8k02uhw2g687mhsg-big-Data.db":[{"key":{"token":"16290705325071","raw":"00080000000b000008f9","value":"47244642553"},"clustering_elements":[{"type"
:"clustering-row","key":{"raw":"0008e7da6eeebcaeb407","value":"-1739956334378437625"},"marker":{"timestamp":1739956351291315,"ttl":"240s","expiry":"2025-02-19 09:16:31z"},"columns":{"v":{"is_live":true,"type":"regular","timestamp":1739956351291315
,"ttl":"240s","expiry":"2025-02-19 09:16:31z","value":"00000000000000000000"}}},

Example for a tombstone non-live (ttl-expired) cell:

{"sstables":{"/var/lib/scylla/data/scylla_bench/test-883a9260eea111efabef9647978d48d9/me-3gnx_0sy7_1xnps214se2r0gj72o-big-Data.db":[{"key":{"token":"-9223362767843183216","raw":"0008000000180005c8c7","value":"103079594183"},"clustering_elements":[
{"type":"clustering-row","key":{"raw":"0008e7da6dca50dad56f","value":"-1739957590317935249"},"marker":{"timestamp":1739960371561769},"columns":{"v":{"is_live":false,"type":"regular","timestamp":1739960371561769,"deletion_time":"2025-02-19 10:19:31
z"}}}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned already, it is possible that TTL'ed cell is expired already but in the sstable, it still appears as a live cell with TTL (already expired TTL). When the sstable is rewritten, this is updated, but there isn't a deadline for this, ScyllaDB can do this so late that the TTL'd cells are dropped immediately as they are already garbage collectible.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In light of you response below, I think this is not the reason the test is failing. If anything, this mistake just make the test pass because it won't notice expired cells, still left in sstables.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @denesb . So if i understand correctly, even though the test waits propagation delay and TTL expiration, it is still no certain that the major compaction will generate all new sstables without the tombstones.
@pehala , i think if this is the case, then this test is less relevant or quite useless.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you wait max(propagation-delay, TTL), then do flush+major, you should see no tombstones at all, nor any cells which look live but are expired actually (TTL is up).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test passed ok after reordering some test steps.

@@ -130,5 +129,5 @@ def test_switch_tombstone_gc_modes(self):
self.log.debug('Starting sstabledump to verify correctness of tombstones for %s sstables',
len(sstables))
for sstable in sstables:
tombstone_deletion_info = sstable_utils.get_compacted_tombstone_deletion_info(sstable=sstable)
tombstone_deletion_info = sstable_utils.get_ttl_expired_tombstone_deletion_info(sstable=sstable)
Copy link

@denesb denesb Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this method intended to return? Currently it returns any partition which has at least one cell with either a tombstone or a TTL'd cell (live or expired). Is this intended?

Copy link
Contributor Author

@yarongilor yarongilor Mar 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@denesb ,No, it is expected to return only a partition that has a tombstone (in one of it's rows).
As described in above comment of #10180 (comment).
So the test expect no tombstones exist at all at it's end, but a partition with a tombstone row cell is found, failing this validation.
The test scenario is:
running s-b load like:

scylla-bench -workload=timeseries -mode=write -replication-factor=3 -partition-count=400 -clustering-row-count=10000 -clustering-row-size=200 -concurrency=10 -rows-per-request=1 -start-timestamp=1740475139106848950 -connection-count 10 -max-rate 30000 -timeout=120s -retry-number=30 -retry-interval=80ms,1s -duration=80m

Altering the s-b table during test steps like:

< t:2025-02-25 09:18:38,953 f:common.py       l:1318 c:utils                p:DEBUG > Executing CQL 'ALTER TABLE scylla_bench.test with gc_grace_seconds = 240 and default_time_to_live = 240 and compaction = {'class':'TimeWindowCompactionStrategy', 'compaction_window_size': 5, 'compaction_window_unit': 'MINUTES'} and tombstone_gc = {'mode': 'disabled', 'propagation_delay_in_seconds':'240'};' ...
< t:2025-02-25 09:18:38,954 f:common.py       l:1326 c:utils                p:DEBUG > Executing CQL 'ALTER TABLE scylla_bench.test with gc_grace_seconds = 240 and default_time_to_live = 240 and compaction = {'class':'TimeWindowCompactionStrategy', 'compaction_window_size': 5, 'compaction_window_unit': 'MINUTES'} and tombstone_gc = {'mode': 'disabled', 'propagation_delay_in_seconds':'240'};' ...
< t:2025-02-25 09:44:54,739 f:common.py       l:1318 c:utils                p:DEBUG > Executing CQL 'ALTER TABLE scylla_bench.test with gc_grace_seconds = 864000 and tombstone_gc = {'mode': 'repair', 'propagation_delay_in_seconds':'240'};' ...
< t:2025-02-25 09:44:54,740 f:common.py       l:1326 c:utils                p:DEBUG > Executing CQL 'ALTER TABLE scylla_bench.test with gc_grace_seconds = 864000 and tombstone_gc = {'mode': 'repair', 'propagation_delay_in_seconds':'240'};' ...
< t:2025-02-25 09:52:00,653 f:common.py       l:1318 c:utils                p:DEBUG > Executing CQL 'ALTER TABLE scylla_bench.test with tombstone_gc = {'mode': 'immediate', 'propagation_delay_in_seconds':'300'};' ...
< t:2025-02-25 09:52:00,653 f:common.py       l:1326 c:utils                p:DEBUG > Executing CQL 'ALTER TABLE scylla_bench.test with tombstone_gc = {'mode': 'immediate', 'propagation_delay_in_seconds':'300'};' ...

So, after modifying to 'mode': 'immediate', the test waits for load to finish, runs a flush and major compaction and expects no tombstones at all. But it did find some tombstones of ttl-expired partition row cell. (s-b writes a simple key value column pattern).
As for s-b write pattern, i guess it doesn't update a partial partition or row, only full partition content. Is there a chance that an expired cell doesn't become a tombstone because of other non-expired cells in the same partition?
i think, according to s-b pattern, all partition rows are expected to expire at the same time.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, after modifying to 'mode': 'immediate', the test waits for load to finish, runs a flush and major compaction and expects no tombstones at all. But it did find some tombstones of ttl-expired partition row cell. (s-b writes a simple key value column pattern).

I see, I think I finally understand what the test is doing.

As for s-b write pattern, i guess it doesn't update a partial partition or row, only full partition content. Is there a chance that an expired cell doesn't become a tombstone because of other non-expired cells in the same partition?

No, converting TTL'd cells to tombstone is independent of other content of the partition, with the exception of higher order tombstones (with later timestamp). When those are present, ScyllaDB will drop the cell (live or not) as it is shadowed by the higher order tombtone.

i think, according to s-b pattern, all partition rows are expected to expire at the same time.

Removing default_time_to_live only applies to data written after this alter. Previous data will still have the earlier TTL applied to it. Compaction doesn't change this.

Also, even with 'mode': 'immediate', we still have propagation_delay, tombstones will not be eligible for garbage-collection before this expires. So if you want all tombstones to be gone, you need to wait for the load to stop, then wait propagation_delay seconds and only then do the flush+major. You also need to make sure that default_time_to_live seconds have passed since the last alter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i'll recheck if there's a testing issue in:

'ALTER TABLE scylla_bench.test with gc_grace_seconds = 864000 and tombstone_gc = {'mode': 'repair', 'propagation_delay_in_seconds':'240'};'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test passed ok after reordering some test steps.

@yarongilor yarongilor force-pushed the fix_test_switch_tombstone_gc_modes branch 13 times, most recently from 35a969b to b763b9f Compare March 17, 2025 13:52
@yarongilor
Copy link
Contributor Author

yarongilor commented Mar 17, 2025

The test passed ok after applying some limitations.
It can be reviewed and merged this way and leave more complexed scenarios to apply in Dtest.

Some log output looks like:

< t:2025-03-17 14:08:52,868 f:longevity_tombstone_gc_test.py l:52   c:TombstoneGcLongevityTest p:INFO  > Dropping the s-b keyspace before continuing with next tombstone-gc-mode
< t:2025-03-17 14:08:54,022 f:longevity_tombstone_gc_test.py l:55   c:TombstoneGcLongevityTest p:INFO  > Recreating the s-b keyspace and table after it was dropped
< t:2025-03-17 14:08:55,693 f:longevity_tombstone_gc_test.py l:119  c:TombstoneGcLongevityTest p:INFO  > change gc-grace-seconds to default of 10 days and tombstone-gc mode to 'repair'
< t:2025-03-17 14:08:56,782 f:longevity_tombstone_gc_test.py l:109  c:TombstoneGcLongevityTest p:INFO  > Wait a duration of propagation_delay_in_seconds
< t:2025-03-17 14:12:56,881 f:longevity_tombstone_gc_test.py l:102  c:TombstoneGcLongevityTest p:INFO  > Run and verify completion of stress command
< t:2025-03-17 14:17:34,195 f:longevity_tombstone_gc_test.py l:27   c:TombstoneGcLongevityTest p:INFO  > Run a flush for scylla_bench on nodes
< t:2025-03-17 14:17:37,333 f:longevity_tombstone_gc_test.py l:39   c:TombstoneGcLongevityTest p:INFO  > Run a major compaction for scylla_bench.test on node
< t:2025-03-17 14:19:41,917 f:longevity_tombstone_gc_test.py l:33   c:TombstoneGcLongevityTest p:INFO  > Run a repair for scylla_bench.test on nodes
< t:2025-03-17 14:19:46,554 f:longevity_tombstone_gc_test.py l:109  c:TombstoneGcLongevityTest p:INFO  > Wait a duration of propagation_delay_in_seconds
< t:2025-03-17 14:23:46,655 f:longevity_tombstone_gc_test.py l:114  c:TombstoneGcLongevityTest p:INFO  > Wait a duration of TTL
< t:2025-03-17 14:28:46,742 f:longevity_tombstone_gc_test.py l:39   c:TombstoneGcLongevityTest p:INFO  > Run a major compaction for scylla_bench.test on node
< t:2025-03-17 14:28:51,260 f:longevity_tombstone_gc_test.py l:131  c:TombstoneGcLongevityTest p:INFO  > verify no tombstones exist in post-repair-created sstables
< t:2025-03-17 14:28:51,280 f:sstable_utils.py l:183  c:SstableUtils         p:DEBUG > Number of rows in repair_time results: 32
< t:2025-03-17 14:28:51,280 f:sstable_utils.py l:184  c:SstableUtils         p:DEBUG > Last row in repair_time results: Row(repair_time=datetime.datetime(2025, 3, 17, 14, 19, 29))
< t:2025-03-17 14:28:51,283 f:sstable_utils.py l:193  c:SstableUtils         p:DEBUG > Found table-repair-date: 2025-03-17 14:19:29
< t:2025-03-17 14:28:51,283 f:sstable_utils.py l:196  c:SstableUtils         p:DEBUG > The full delta seconds from now is: 562
< t:2025-03-17 14:28:51,283 f:sstable_utils.py l:198  c:SstableUtils         p:DEBUG > The delta seconds from now, subtracting propagation delay, is: 322
< t:2025-03-17 14:28:51,283 f:sstable_utils.py l:201  c:SstableUtils         p:DEBUG > The neto delta in minutes is: 5
< t:2025-03-17 14:28:52,342 f:sstable_utils.py l:59   c:SstableUtils         p:DEBUG > Got 160 sstables filtered by last 5 minutes
< t:2025-03-17 14:28:52,342 f:longevity_tombstone_gc_test.py l:136  c:TombstoneGcLongevityTest p:DEBUG > Starting sstable dump to verify correctness of tombstones for 160 sstables
< t:2025-03-17 14:28:52,390 f:sstable_utils.py l:213  c:SstableUtils         p:DEBUG > SStable /var/lib/scylla/data/scylla_bench/test-5c8562b0033911f0a6a7654599b8da22/me-3gon_147y_4u1fk26vrl7h89e08x-big-Data.db exists on node: longevity-tombstone-gc-modes-master-db-node-645bf0c9-1
< t:2025-03-17 14:28:52,488 f:sstable_utils.py l:213  c:SstableUtils         p:DEBUG > SStable /var/lib/scylla/data/scylla_bench/test-5c8562b0033911f0a6a7654599b8da22/me-3gon_147y_4u1fk26vrl7h89e08x-big-Data.db exists on node: longevity-tombstone-gc-modes-master-db-node-645bf0c9-1
< t:2025-03-17 14:28:53,128 f:sstable_utils.py l:245  c:SstableUtils         p:DEBUG > No tombstones found in SSTable /var/lib/scylla/data/scylla_bench/test-5c8562b0033911f0a6a7654599b8da22/me-3gon_147y_4u1fk26vrl7h89e08x-big-Data.db.
< t:2025-03-17 14:28:53,128 f:sstable_utils.py l:331  c:SstableUtils         p:DEBUG > Found 0 TTL-expired tombstones for SSTable [2025-03-17 14:28:46] /var/lib/scylla/data/scylla_bench/test-5c8562b0033911f0a6a7654599b8da22/me-3gon_147y_4u1fk26vrl7h89e08x-big-Data.db
< t:2025-03-17 14:31:20,195 f:sstable_utils.py l:245  c:SstableUtils         p:DEBUG > No tombstones found in SSTable /var/lib/scylla/data/scylla_bench/test-5c8562b0033911f0a6a7654599b8da22/me-3gon_1482_4p3yo26vrl7h89e08x-big-Data.db.
< t:2025-03-17 14:31:20,196 f:sstable_utils.py l:331  c:SstableUtils         p:DEBUG > Found 0 TTL-expired tombstones for SSTable [2025-03-17 14:28:50] /var/lib/scylla/data/scylla_bench/test-5c8562b0033911f0a6a7654599b8da22/me-3gon_1482_4p3yo26vrl7h89e08x-big-Data.db
< t:2025-03-17 14:31:20,739 f:longevity_tombstone_gc_test.py l:52   c:TombstoneGcLongevityTest p:INFO  > Dropping the s-b keyspace before continuing with next tombstone-gc-mode
< t:2025-03-17 14:31:21,904 f:longevity_tombstone_gc_test.py l:55   c:TombstoneGcLongevityTest p:INFO  > Recreating the s-b keyspace and table after it was dropped
< t:2025-03-17 14:31:23,853 f:longevity_tombstone_gc_test.py l:143  c:TombstoneGcLongevityTest p:INFO  > Change tombstone-gc mode to 'immediate'
< t:2025-03-17 14:31:25,001 f:longevity_tombstone_gc_test.py l:148  c:TombstoneGcLongevityTest p:INFO  > Wait a duration of schema-agreement and propagation_delay_in_seconds
< t:2025-03-17 14:32:10,439 f:longevity_tombstone_gc_test.py l:109  c:TombstoneGcLongevityTest p:INFO  > Wait a duration of propagation_delay_in_seconds
< t:2025-03-17 14:36:10,445 f:longevity_tombstone_gc_test.py l:102  c:TombstoneGcLongevityTest p:INFO  > Run and verify completion of stress command
< t:2025-03-17 14:40:12,960 f:longevity_tombstone_gc_test.py l:109  c:TombstoneGcLongevityTest p:INFO  > Wait a duration of propagation_delay_in_seconds
< t:2025-03-17 14:44:12,981 f:longevity_tombstone_gc_test.py l:114  c:TombstoneGcLongevityTest p:INFO  > Wait a duration of TTL
< t:2025-03-17 14:49:16,588 f:longevity_tombstone_gc_test.py l:154  c:TombstoneGcLongevityTest p:INFO  > Run a major compaction for user-table on node
< t:2025-03-17 14:51:21,273 f:longevity_tombstone_gc_test.py l:157  c:TombstoneGcLongevityTest p:INFO  > Verify no compacted tombstones in sstables
< t:2025-03-17 14:51:21,778 f:sstable_utils.py l:59   c:SstableUtils         p:DEBUG > Got 160 sstables (not filtered by time)
< t:2025-03-17 14:51:21,778 f:longevity_tombstone_gc_test.py l:159  c:TombstoneGcLongevityTest p:DEBUG > Starting sstabledump to verify correctness of tombstones for 160 sstables
< t:2025-03-17 14:51:21,826 f:sstable_utils.py l:213  c:SstableUtils         p:DEBUG > SStable /var/lib/scylla/data/scylla_bench/test-7ff418b0033c11f08117b51abb849059/me-3gon_1564_443sg26vrl7h89e08x-big-Data.db exists on node: longevity-tombstone-gc-modes-master-db-node-645bf0c9-1
< t:2025-03-17 14:51:21,925 f:sstable_utils.py l:213  c:SstableUtils         p:DEBUG > SStable /var/lib/scylla/data/scylla_bench/test-7ff418b0033c11f08117b51abb849059/me-3gon_1564_443sg26vrl7h89e08x-big-Data.db exists on node: longevity-tombstone-gc-modes-master-db-node-645bf0c9-1
< t:2025-03-17 14:51:22,350 f:sstable_utils.py l:245  c:SstableUtils         p:DEBUG > No tombstones found in SSTable /var/lib/scylla/data/scylla_bench/test-7ff418b0033c11f08117b51abb849059/me-3gon_1564_443sg26vrl7h89e08x-big-Data.db.
< t:2025-03-17 14:51:22,350 f:sstable_utils.py l:331  c:SstableUtils         p:DEBUG > Found 0 TTL-expired tombstones for SSTable [2025-03-17 14:49:16] /var/lib/scylla/data/scylla_bench/test-7ff418b0033c11f08117b51abb849059/me-3gon_1564_443sg26vrl7h89e08x-big-Data.db
< t:2025-03-17 14:53:59,995 f:sstable_utils.py l:213  c:SstableUtils         p:DEBUG > SStable /var/lib/scylla/data/scylla_bench/test-7ff418b0033c11f08117b51abb849059/me-3gon_1568_5u9g026vrl7h89e08x-big-Data.db exists on node: longevity-tombstone-gc-modes-master-db-node-645bf0c9-1
< t:2025-03-17 14:54:00,659 f:sstable_utils.py l:245  c:SstableUtils         p:DEBUG > No tombstones found in SSTable /var/lib/scylla/data/scylla_bench/test-7ff418b0033c11f08117b51abb849059/me-3gon_1568_5u9g026vrl7h89e08x-big-Data.db.
< t:2025-03-17 14:54:00,659 f:sstable_utils.py l:331  c:SstableUtils         p:DEBUG > Found 0 TTL-expired tombstones for SSTable [2025-03-17 14:49:20] /var/lib/scylla/data/scylla_bench/test-7ff418b0033c11f08117b51abb849059/me-3gon_1568_5u9g026vrl7h89e08x-big-Data.db
< t:2025-03-17 14:54:00,659 f:longevity_tombstone_gc_test.py l:52   c:TombstoneGcLongevityTest p:INFO  > Dropping the s-b keyspace before continuing with next tombstone-gc-mode
< t:2025-03-17 14:54:04,877 f:longevity_tombstone_gc_test.py l:55   c:TombstoneGcLongevityTest p:INFO  > Recreating the s-b keyspace and table after it was dropped
< t:2025-03-17 14:54:06,832 f:longevity_tombstone_gc_test.py l:167  c:TombstoneGcLongevityTest p:INFO  > change gc-grace-seconds to 240 and tombstone-gc mode to 'disabled'
< t:2025-03-17 14:54:08,092 f:longevity_tombstone_gc_test.py l:109  c:TombstoneGcLongevityTest p:INFO  > Wait a duration of propagation_delay_in_seconds
< t:2025-03-17 14:58:08,129 f:longevity_tombstone_gc_test.py l:102  c:TombstoneGcLongevityTest p:INFO  > Run and verify completion of stress command
< t:2025-03-17 15:02:10,648 f:longevity_tombstone_gc_test.py l:109  c:TombstoneGcLongevityTest p:INFO  > Wait a duration of propagation_delay_in_seconds
< t:2025-03-17 15:06:10,745 f:longevity_tombstone_gc_test.py l:114  c:TombstoneGcLongevityTest p:INFO  > Wait a duration of TTL
< t:2025-03-17 15:08:27,353 f:sstable_utils.py l:59   c:SstableUtils         p:DEBUG > Got 41 sstables (not filtered by time)
< t:2025-03-17 15:11:15,764 f:longevity_tombstone_gc_test.py l:177  c:TombstoneGcLongevityTest p:INFO  > Count the initial number of tombstones
< t:2025-03-17 15:11:16,309 f:sstable_utils.py l:59   c:SstableUtils         p:DEBUG > Got 163 sstables (not filtered by time)

...
< t:2025-03-17 15:14:50,119 f:sstable_utils.py l:153  c:SstableUtils         p:DEBUG > Found 0 TTL-expired tombstones in SSTable /var/lib/scylla/data/scylla_bench/test-ac5b8f70033f11f0a6a7654599b8da22/me-3gon_166r_13ngw26vrl7h89e08x-big-Data.db
< t:2025-03-17 15:14:50,169 f:sstable_utils.py l:213  c:SstableUtils         p:DEBUG > SStable /var/lib/scylla/data/scylla_bench/test-ac5b8f70033f11f0a6a7654599b8da22/me-3gon_166r_255s026vrl7h89e08x-big-Data.db exists on node: longevity-tombstone-gc-modes-master-db-node-645bf0c9-1
< t:2025-03-17 15:14:51,654 f:sstable_utils.py l:153  c:SstableUtils         p:DEBUG > Found 0 TTL-expired tombstones in SSTable /var/lib/scylla/data/scylla_bench/test-ac5b8f70033f11f0a6a7654599b8da22/me-3gon_166r_255s026vrl7h89e08x-big-Data.db
< t:2025-03-17 15:14:51,654 f:sstable_utils.py l:43   c:SstableUtils         p:DEBUG > Got 0 tombstones for scylla_bench.test
< t:2025-03-17 15:14:51,654 f:longevity_tombstone_gc_test.py l:27   c:TombstoneGcLongevityTest p:INFO  > Run a flush for scylla_bench on nodes
< t:2025-03-17 15:14:56,298 f:longevity_tombstone_gc_test.py l:33   c:TombstoneGcLongevityTest p:INFO  > Run a repair for scylla_bench.test on nodes
< t:2025-03-17 15:15:01,439 f:longevity_tombstone_gc_test.py l:39   c:TombstoneGcLongevityTest p:INFO  > Run a major compaction for scylla_bench.test on node
< t:2025-03-17 15:15:06,496 f:sstable_utils.py l:59   c:SstableUtils         p:DEBUG > Got 160 sstables (not filtered by time)
< t:2025-03-17 15:18:07,905 f:sstable_utils.py l:153  c:SstableUtils         p:DEBUG > Found 3031 TTL-expired tombstones in SSTable /var/lib/scylla/data/scylla_bench/test-ac5b8f70033f11f0a6a7654599b8da22/me-3gon_16d5_4dr0g26vrl7h89e08x-big-Data.db
< t:2025-03-17 15:18:07,954 f:sstable_utils.py l:213  c:SstableUtils         p:DEBUG > SStable /var/lib/scylla/data/scylla_bench/test-ac5b8f70033f11f0a6a7654599b8da22/me-3gon_16d5_4ee5s26vrl7h89e08x-big-Data.db exists on node: longevity-tombstone-gc-modes-master-db-node-645bf0c9-1
< t:2025-03-17 15:18:08,892 f:sstable_utils.py l:153  c:SstableUtils         p:DEBUG > Found 29660 TTL-expired tombstones in SSTable /var/lib/scylla/data/scylla_bench/test-ac5b8f70033f11f0a6a7654599b8da22/me-3gon_16d5_4ee5s26vrl7h89e08x-big-Data.db
< t:2025-03-17 15:18:08,941 f:sstable_utils.py l:213  c:SstableUtils         p:DEBUG > SStable /var/lib/scylla/data/scylla_bench/test-ac5b8f70033f11f0a6a7654599b8da22/me-3gon_16d5_4f90w26vrl7h89e08x-big-Data.db exists on node: longevity-tombstone-gc-modes-master-db-node-645bf0c9-1
< t:2025-03-17 15:18:09,855 f:sstable_utils.py l:153  c:SstableUtils         p:DEBUG > Found 24864 TTL-expired tombstones in SSTable /var/lib/scylla/data/scylla_bench/test-ac5b8f70033f11f0a6a7654599b8da22/me-3gon_16d5_4f90w26vrl7h89e08x-big-Data.db
< t:2025-03-17 15:18:09,855 f:sstable_utils.py l:43   c:SstableUtils         p:DEBUG > Got 1736976 tombstones for scylla_bench.test

@yarongilor yarongilor marked this pull request as ready for review March 17, 2025 17:08
@yarongilor yarongilor force-pushed the fix_test_switch_tombstone_gc_modes branch from b763b9f to 7690dd5 Compare March 19, 2025 15:58
@yarongilor yarongilor requested a review from pehala March 19, 2025 15:59
pehala
pehala previously approved these changes Mar 19, 2025
@yarongilor yarongilor force-pushed the fix_test_switch_tombstone_gc_modes branch 2 times, most recently from afd2ed4 to 6a5d404 Compare March 20, 2025 15:30
@yarongilor
Copy link
Contributor Author

@pehala , conflicts are resolved now (your approval was dismissed )

@yarongilor yarongilor requested review from fruch, soyacz and pehala March 20, 2025 15:34
@yarongilor
Copy link
Contributor Author

@scylladb/qa-maintainers ping for review

@yarongilor
Copy link
Contributor Author

yarongilor commented Apr 2, 2025

@scylladb/qa-maintainers ping for review

@scylladb/qa-maintainers yet another ping for review/merge

cc: @pehala

soyacz
soyacz previously approved these changes Apr 3, 2025
Copy link
Contributor

@soyacz soyacz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

besides one question, LGTM (but I didn't verify test logic much)

@@ -1,6 +1,6 @@
test_duration: 200

stress_cmd: ["scylla-bench -workload=timeseries -mode=write -replication-factor=3 -partition-count=400 -clustering-row-count=10000 -clustering-row-size=200 -concurrency=10 -rows-per-request=1 -start-timestamp=SET_WRITE_TIMESTAMP -connection-count 10 -max-rate 30000 -timeout=120s -retry-number=30 -retry-interval=80ms,1s -duration=80m"]
stress_cmd: ["scylla-bench -workload=timeseries -mode=write -replication-factor=3 -partition-count=400 -clustering-row-count=10000 -clustering-row-size=200 -concurrency=10 -rows-per-request=1 -start-timestamp=SET_WRITE_TIMESTAMP -connection-count 10 -max-rate 30000 -timeout=120s -retry-number=30 -retry-interval=80ms,1s -duration=4m"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is 4m enough or just leftover from testing?
Btw. shouldn't it just insert all the intended data and end without overwrites?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, the test is modified due to former stability issues.
please read in title of last commit:

fix(test_switch_tombstone_gc_modes): run stress in cycles for each test step

Run stress per tombstone-gc-mode step of the test.
This way, stress writes are not mixed between different gc-modes and causes confusions.

@fruch
Copy link
Contributor

fruch commented Apr 3, 2025

@yarongilor

  1. please stop using byo, it's hard to track it in Argus, which run are related to this PR which are not. please use the clone feature of argus, to clone jobs into your staging

  2. please reference in this PR, a full run of the test or tests affected

  3. if unit tests are failing, please look into it, and write down if it's something known (or raise an issue if unrelated to the PR)

  4. we shouldn't merge until a green light from @denesb (or someone on his behalf)

)

self.log.debug("Found %s tombstones in SSTable %s", num_tombstones, sstable)
f"sudo awk -F 'deletion_time' '{{print NF-1}}' {self.REMOTE_SSTABLEDUMP_PATH}",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use awk (and why with sudo), when we have a structured output (JSON) that you can parse with jq.
Also, this indiscriminate matching of deletion_time might include things which have no TTL, like regular tombstones.
To match only TTL expired tombstones, you need to match only the following entities:

  • row marker
  • cells -- both regular and collection cells

And nothing else. Higher-order tombstones also have deletion_time but they are not subject to TTL and thus would constitute false-positive matches here.

Copy link
Contributor Author

@yarongilor yarongilor Apr 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, so for avoiding confusions and false-positive, the method is renamed "count_tombstones". So currently no differentiation of tombstone type, which is sufficient for this test.
We could consider using jq for the next steps, but that would also introduce a stronger dependency on implementation details.
In any case we better use it first by adding ttl tests to dtest.

sstable_data = dump_data['sstables'].get(sstable, [])

# Extract entries that contain a tombstone
tombstones_deletion_info = [entry for entry in sstable_data if 'tombstone' in entry]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will match only the partition tombstone.
Is this intended?

Copy link
Contributor Author

@yarongilor yarongilor Apr 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, with this regard, SCT, so far, only handles partition tombstone.
Yet it is a good point and meant to be addressed in tombstone test plan and in tests.
It may first be covered in either Dtest or test.py.
I opened an SCT issue for that - #10595.

@yarongilor
Copy link
Contributor Author

yarongilor commented Apr 6, 2025

@yarongilor

  1. please stop using byo, it's hard to track it in Argus, which run are related to this PR which are not. please use the clone feature of argus, to clone jobs into your staging
  2. please reference in this PR, a full run of the test or tests affected
  3. if unit tests are failing, please look into it, and write down if it's something known (or raise an issue if unrelated to the PR)
  4. we shouldn't merge until a green light from @denesb (or someone on his behalf)

Retested and passed ok in: https://argus.scylladb.com/tests/scylla-cluster-tests/3fc207e3-5343-4eea-a438-673cfe439cd5

@yarongilor yarongilor force-pushed the fix_test_switch_tombstone_gc_modes branch 2 times, most recently from 51ab889 to 7138f9e Compare April 6, 2025 17:28
@yarongilor yarongilor requested a review from denesb April 7, 2025 07:05
@soyacz
Copy link
Contributor

soyacz commented Apr 7, 2025

@yarongilor please rebase

yarongilor added 2 commits April 7, 2025 11:10
…o new sstable dump format

The new format of scylla "sstable dump-data" command dumps the data as is, unlike in the past versions.
The test of longevity_tombstone_gc_test.py should count and parse the ttl-expired tombstones according to this format.
Refs: scylladb#9980
…st step

Run stress per tombstone-gc-mode step of the test.
This way, stress writes are not mixed between different gc-modes and causes confusions.
@yarongilor yarongilor force-pushed the fix_test_switch_tombstone_gc_modes branch from 7138f9e to f71e728 Compare April 7, 2025 08:10
@yarongilor
Copy link
Contributor Author

@yarongilor please rebase

@soyacz , rebased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants