[ 
https://issues.apache.org/jira/browse/CASSANDRA-19747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17863044#comment-17863044
 ] 

Stefan Miklosovic edited comment on CASSANDRA-19747 at 7/4/24 6:21 PM:
-----------------------------------------------------------------------

[CASSANDRA-19747-trunk|https://github.com/instaclustr/cassandra/tree/CASSANDRA-19747-trunk]
{noformat}
java17_pre-commit_tests                         
  ✓ j17_build                                        4m 48s
  ✓ j17_cqlsh_dtests_py311                            7m 2s
  ✓ j17_cqlsh_dtests_py311_vnode                     7m 15s
  ✓ j17_cqlsh_dtests_py38                            7m 18s
  ✓ j17_cqlsh_dtests_py38_vnode                      7m 14s
  ✓ j17_cqlshlib_cython_tests                        9m 39s
  ✓ j17_cqlshlib_tests                                7m 4s
  ✓ j17_dtests                                      36m 45s
  ✓ j17_dtests_latest                               36m 11s
  ✓ j17_unit_tests                                  14m 39s
  ✓ j17_unit_tests_repeat                             4m 2s
  ✓ j17_utests_latest                               17m 18s
  ✓ j17_utests_latest_repeat                         3m 57s
  ✓ j17_utests_oa_repeat                             4m 51s
  ✕ j17_dtests_vnode                                49m 31s
      bootstrap_test.TestBootstrap 
test_consistent_range_movement_false_with_replica_down_should_succeed
      bootstrap_test.TestBootstrap test_shutdown_wiped_node_cannot_join
  ✕ j17_jvm_dtests                                  23m 43s
      
org.apache.cassandra.distributed.test.NativeTransportEncryptionOptionsTest 
testOptionalMtlsModeDoNotAllowNonSSLConnections
      
org.apache.cassandra.distributed.test.NativeTransportEncryptionOptionsTest 
testEndpointVerificationEnabledIpNotInSAN
  ✕ j17_jvm_dtests_latest_vnode                     22m 13s
      org.apache.cassandra.distributed.test.tcm.CMSPlacementAfterMoveTest 
testMoveToCMS
      org.apache.cassandra.distributed.test.tcm.SplitBrainTest 
testSplitBrainStartup
  ✕ j17_utests_oa                                   14m 12s
      org.apache.cassandra.tcm.DiscoverySimulationTest discoveryTest
{noformat}
[java17_pre-commit_tests|https://app.circleci.com/pipelines/github/instaclustr/cassandra/4465/workflows/79911554-8523-485d-9fae-2a2bd8f0c70]


was (Author: smiklosovic):
[CASSANDRA-19747-trunk|https://github.com/instaclustr/cassandra/tree/CASSANDRA-19747-trunk]
{noformat}
java17_pre-commit_tests                         
  ✓ j17_build                                        4m 48s
  ✓ j17_cqlsh_dtests_py311                            7m 2s
  ✓ j17_cqlsh_dtests_py311_vnode                     7m 15s
  ✓ j17_cqlsh_dtests_py38                            7m 18s
  ✓ j17_cqlsh_dtests_py38_vnode                      7m 14s
  ✓ j17_cqlshlib_cython_tests                        9m 39s
  ✓ j17_cqlshlib_tests                                7m 4s
  ✓ j17_dtests                                      36m 45s
  ✓ j17_dtests_latest                               36m 11s
  ✓ j17_unit_tests                                  14m 39s
  ✓ j17_unit_tests_repeat                             4m 2s
  ✓ j17_utests_latest                               17m 18s
  ✓ j17_utests_latest_repeat                         3m 57s
  ✓ j17_utests_oa_repeat                             4m 51s
  ✕ j17_dtests_vnode                                49m 31s
      bootstrap_test.TestBootstrap 
test_consistent_range_movement_false_with_replica_down_should_succeed
      bootstrap_test.TestBootstrap test_shutdown_wiped_node_cannot_join
  ✕ j17_jvm_dtests                                  23m 43s
      
org.apache.cassandra.distributed.test.NativeTransportEncryptionOptionsTest 
testOptionalMtlsModeDoNotAllowNonSSLConnections
      
org.apache.cassandra.distributed.test.NativeTransportEncryptionOptionsTest 
testEndpointVerificationEnabledIpNotInSAN
  ✕ j17_jvm_dtests_latest_vnode                     22m 13s
      org.apache.cassandra.distributed.test.tcm.CMSPlacementAfterMoveTest 
testMoveToCMS
      org.apache.cassandra.distributed.test.tcm.SplitBrainTest 
testSplitBrainStartup
  ✕ j17_utests_oa                                   14m 12s
      org.apache.cassandra.tcm.DiscoverySimulationTest discoveryTest
{noformat}

[java17_pre-commit_tests|https://app.circleci.com/pipelines/github/instaclustr/cassandra/4465/workflows/79911554-8523-485d-9fae-2a2bd8f0c70


> Invalid schema.cql created by snapshot after dropping more than one field
> -------------------------------------------------------------------------
>
>                 Key: CASSANDRA-19747
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-19747
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Local/Snapshots
>            Reporter: Frank vissing
>            Assignee: Stefan Miklosovic
>            Priority: Normal
>             Fix For: 4.0.x, 4.1.x, 5.0.x, 5.x
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> After dropping at least 2 fields the schema.cql produced by _nodetool 
> snapshot_ is invalid (it is missing a comma)
> {code:sql}
> CREATE TABLE IF NOT EXISTS test.testtable (
>     field1 text PRIMARY KEY,
>     field2 text
>     field3 text
> ) WITH ID ...{code}
> expected outcome
> {code:sql}
> CREATE TABLE IF NOT EXISTS test.testtable (
>     field1 text PRIMARY KEY,
>     field2 text,
>     field3 text
> ) WITH ID ...{code}
> reproducing the isue is simple by running the following commands
> {code:sh}
> docker run -d --name cassandra cassandra:4.1.5
> echo "Wait for the container to start"
> until docker exec -ti cassandra nodetool status | grep UN;do sleep 
> 1;done;sleep 10
> echo "Create keyspace and table for test"
> docker exec -ti cassandra cqlsh -e "CREATE KEYSPACE IF NOT EXISTS test WITH 
> replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}; CREATE 
> TABLE IF NOT EXISTS test.testtable (field1 text PRIMARY KEY,field2 
> text,field3 text);"
> echo "Drop 2 fields"
> docker exec -ti cassandra cqlsh -e "ALTER TABLE test.testtable DROP (field2, 
> field3);"
> echo "Create snapshot and view schema.cql"
> docker exec -ti cassandra /opt/cassandra/bin/nodetool snapshot -t my_snapshot
> docker exec -ti cassandra find /var/lib/cassandra/data -name schema.cql  
> -exec cat {} +   {code}
> the full output of the sql generated by the reproduce is below
> {code:sql}
> CREATE TABLE IF NOT EXISTS test.testtable (
>     field1 text PRIMARY KEY,
>     field2 text
>     field3 text
> ) WITH ID = 0e9aa540-391f-11ef-945e-0be1221ff441
>     AND additional_write_policy = '99p'
>     AND bloom_filter_fp_chance = 0.01
>     AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>     AND cdc = false
>     AND comment = ''
>     AND compaction = {'class': 
> 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
> 'max_threshold': '32', 'min_threshold': '4'}
>     AND compression = {'chunk_length_in_kb': '16', 'class': 
> 'org.apache.cassandra.io.compress.LZ4Compressor'}
>     AND memtable = 'default'
>     AND crc_check_chance = 1.0
>     AND default_time_to_live = 0
>     AND extensions = {}
>     AND gc_grace_seconds = 864000
>     AND max_index_interval = 2048
>     AND memtable_flush_period_in_ms = 0
>     AND min_index_interval = 128
>     AND read_repair = 'BLOCKING'
>     AND speculative_retry = '99p';
> ALTER TABLE test.testtable DROP field2 USING TIMESTAMP 1719999102807000;
> ALTER TABLE test.testtable DROP field3 USING TIMESTAMP 1719999102807001;
> {code}
> Found this bug while trying to restore the schema from a backup  created by 
> copying a snapshot from a running node.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to