diff --git a/.circleci/config.yml b/.circleci/config.yml index 864919b8f418..dce5c2feed1f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,7 +24,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -80,7 +80,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -90,7 +90,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -111,10 +111,10 @@ jobs: j17_dtests: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -187,7 +187,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -197,7 +197,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -220,7 +220,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -304,7 +304,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -314,7 +314,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -369,7 +369,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -379,7 +379,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -402,7 +402,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -458,7 +458,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -468,7 +468,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -489,10 +489,10 @@ jobs: j11_dtests_latest_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -591,7 +591,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -601,7 +601,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -656,7 +656,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -666,7 +666,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -690,7 +690,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -774,7 +774,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -784,7 +784,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -804,10 +804,10 @@ jobs: j17_cqlsh_dtests_py38_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -882,7 +882,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -892,7 +892,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -912,10 +912,10 @@ jobs: j17_dtests_vnode_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1036,7 +1036,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1046,7 +1046,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -1066,10 +1066,10 @@ jobs: j11_dtests_vnode_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1168,7 +1168,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1178,7 +1178,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -1199,10 +1199,10 @@ jobs: j17_cqlsh_dtests_py311_latest: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1277,7 +1277,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1287,7 +1287,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -1310,7 +1310,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1394,7 +1394,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1404,7 +1404,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -1428,7 +1428,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1484,7 +1484,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1494,7 +1494,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -1518,7 +1518,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1602,7 +1602,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1612,7 +1612,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -1632,10 +1632,10 @@ jobs: j11_cqlsh_dtests_py38_latest: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1710,7 +1710,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1720,7 +1720,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -1744,7 +1744,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1800,7 +1800,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1810,7 +1810,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -1830,10 +1830,10 @@ jobs: j11_cqlsh_dtests_py311: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -1908,7 +1908,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -1918,7 +1918,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -1939,10 +1939,10 @@ jobs: j17_dtests_large_vnode_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2041,7 +2041,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2051,7 +2051,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -2071,10 +2071,10 @@ jobs: j17_dtests_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2195,7 +2195,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2205,7 +2205,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -2228,7 +2228,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2312,7 +2312,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2322,7 +2322,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -2346,7 +2346,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2402,7 +2402,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2412,7 +2412,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -2432,10 +2432,10 @@ jobs: j17_cqlsh_dtests_py311: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2510,7 +2510,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2520,7 +2520,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -2540,10 +2540,10 @@ jobs: j11_cqlsh_dtests_py38: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2618,7 +2618,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2628,7 +2628,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -2652,7 +2652,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2708,7 +2708,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2718,7 +2718,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -2741,7 +2741,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2797,7 +2797,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2807,7 +2807,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -2831,7 +2831,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -2915,7 +2915,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -2925,7 +2925,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -2948,7 +2948,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -3110,7 +3110,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3120,7 +3120,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -3141,10 +3141,10 @@ jobs: j11_dtests_large_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -3195,7 +3195,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3205,7 +3205,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -3226,10 +3226,10 @@ jobs: j11_dtests_large_vnode_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -3328,7 +3328,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3338,7 +3338,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -3359,10 +3359,10 @@ jobs: j11_dtests_large: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -3413,7 +3413,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3423,7 +3423,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -3447,7 +3447,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -3503,7 +3503,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3513,7 +3513,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -3537,7 +3537,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -3621,7 +3621,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3631,7 +3631,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -3652,10 +3652,10 @@ jobs: j11_upgrade_dtests_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -3754,7 +3754,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3764,7 +3764,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -3788,7 +3788,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -3872,7 +3872,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -3882,7 +3882,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -3905,7 +3905,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -4067,7 +4067,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4077,7 +4077,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -4173,7 +4173,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4183,7 +4183,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -4206,7 +4206,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -4290,7 +4290,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4300,7 +4300,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -4324,7 +4324,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -4380,7 +4380,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4390,7 +4390,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -4413,7 +4413,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -4497,7 +4497,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4507,7 +4507,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -4568,7 +4568,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4578,7 +4578,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -4602,7 +4602,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -4658,7 +4658,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4668,7 +4668,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -4692,7 +4692,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -4748,7 +4748,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4758,7 +4758,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -4851,7 +4851,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4861,7 +4861,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -4923,7 +4923,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -4933,7 +4933,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -4957,7 +4957,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -5013,7 +5013,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5023,7 +5023,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -5126,7 +5126,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5136,7 +5136,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -5160,7 +5160,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -5244,7 +5244,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5254,7 +5254,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -5316,7 +5316,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5326,7 +5326,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -5350,7 +5350,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -5406,7 +5406,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5416,7 +5416,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -5437,10 +5437,10 @@ jobs: j17_dtests_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -5513,7 +5513,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5523,7 +5523,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -5543,10 +5543,10 @@ jobs: j11_dtests_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -5645,7 +5645,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5655,7 +5655,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -5679,7 +5679,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -5763,7 +5763,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5773,7 +5773,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -5797,7 +5797,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -5881,7 +5881,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -5891,7 +5891,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -5912,10 +5912,10 @@ jobs: j17_dtests_latest_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -6014,7 +6014,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6024,7 +6024,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -6047,7 +6047,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -6103,7 +6103,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6113,7 +6113,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -6134,10 +6134,10 @@ jobs: j11_upgrade_dtests: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -6188,7 +6188,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6198,7 +6198,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -6219,10 +6219,10 @@ jobs: j11_dtests_large_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -6321,7 +6321,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6331,7 +6331,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -6355,7 +6355,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -6411,7 +6411,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6421,7 +6421,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -6482,7 +6482,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6492,7 +6492,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -6512,10 +6512,10 @@ jobs: j17_dtests_large_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -6566,7 +6566,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6576,7 +6576,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -6596,10 +6596,10 @@ jobs: j11_cqlsh_dtests_py38_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -6674,7 +6674,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6684,7 +6684,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -6708,7 +6708,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -6764,7 +6764,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6774,7 +6774,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -6798,7 +6798,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -6854,7 +6854,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6864,7 +6864,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -6885,10 +6885,10 @@ jobs: j11_cqlsh_dtests_py311_latest: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -6963,7 +6963,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -6973,7 +6973,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -7027,7 +7027,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7037,7 +7037,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -7057,10 +7057,10 @@ jobs: j11_cqlsh_dtests_py311_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -7135,7 +7135,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7145,7 +7145,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -7169,7 +7169,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -7253,7 +7253,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7263,7 +7263,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -7283,10 +7283,10 @@ jobs: j17_cqlsh_dtests_py38_latest: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -7361,7 +7361,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7371,7 +7371,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -7391,10 +7391,10 @@ jobs: j17_cqlsh_dtests_py311_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -7469,7 +7469,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7479,7 +7479,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -7502,7 +7502,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 1 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -7586,7 +7586,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7596,7 +7596,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -7617,10 +7617,10 @@ jobs: j17_dtests_latest: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -7693,7 +7693,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7703,7 +7703,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -7726,7 +7726,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -7810,7 +7810,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7820,7 +7820,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -7881,7 +7881,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7891,7 +7891,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -7987,7 +7987,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -7997,7 +7997,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -8021,7 +8021,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -8077,7 +8077,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8087,7 +8087,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -8108,10 +8108,10 @@ jobs: j11_dtests_latest: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -8162,7 +8162,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8172,7 +8172,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -8226,7 +8226,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8236,7 +8236,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -8257,10 +8257,10 @@ jobs: j11_dtests: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -8311,7 +8311,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8321,7 +8321,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -8342,10 +8342,10 @@ jobs: j17_cqlsh_dtests_py38: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -8420,7 +8420,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8430,7 +8430,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -8453,7 +8453,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -8537,7 +8537,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8547,7 +8547,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -8570,7 +8570,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -8626,7 +8626,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8636,7 +8636,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -8656,10 +8656,10 @@ jobs: j17_dtests_large: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -8710,7 +8710,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8720,7 +8720,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -8743,7 +8743,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -8799,7 +8799,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8809,7 +8809,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -8871,7 +8871,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8881,7 +8881,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -8904,7 +8904,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -8960,7 +8960,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -8970,7 +8970,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -8990,10 +8990,10 @@ jobs: j11_dtests_vnode: docker: - image: apache/cassandra-testing-ubuntu2004-java11-w-dependencies:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -9044,7 +9044,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -9054,7 +9054,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -9078,7 +9078,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -9134,7 +9134,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -9144,7 +9144,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -9164,10 +9164,10 @@ jobs: j17_dtests_large_repeat: docker: - image: apache/cassandra-testing-ubuntu2004-java11:latest - resource_class: medium + resource_class: large working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -9266,7 +9266,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -9276,7 +9276,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -9299,7 +9299,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -9355,7 +9355,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -9365,7 +9365,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -9388,7 +9388,7 @@ jobs: resource_class: medium working_directory: ~/ shell: /bin/bash -eo pipefail -l - parallelism: 4 + parallelism: 25 steps: - attach_workspace: at: /home/cassandra @@ -9444,7 +9444,7 @@ jobs: - CCM_MAX_HEAP_SIZE: 1024M - CCM_HEAP_NEWSIZE: 256M - REPEATED_TESTS_STOP_ON_FAILURE: false - - REPEATED_UTESTS: null + - REPEATED_UTESTS: org.apache.cassandra.db.virtual.SlowQueriesTableTest,org.apache.cassandra.db.virtual.LogMessagesTableTest,org.apache.cassandra.db.virtual.AbstractLoggerVirtualTableTest - REPEATED_UTESTS_COUNT: 500 - REPEATED_UTESTS_FQLTOOL: null - REPEATED_UTESTS_FQLTOOL_COUNT: 500 @@ -9454,7 +9454,7 @@ jobs: - REPEATED_UTESTS_STRESS_COUNT: 500 - REPEATED_SIMULATOR_DTESTS: null - REPEATED_SIMULATOR_DTESTS_COUNT: 500 - - REPEATED_JVM_DTESTS: null + - REPEATED_JVM_DTESTS: org.apache.cassandra.distributed.test.VirtualTableLogsTest,org.apache.cassandra.distributed.test.SlowQueryDeserTest,org.apache.cassandra.distributed.test.SlowQueriesAppenderTest,org.apache.cassandra.distributed.test.AbstractVirtualLogsTableTest - REPEATED_JVM_DTESTS_COUNT: 500 - REPEATED_JVM_UPGRADE_DTESTS: null - REPEATED_JVM_UPGRADE_DTESTS_COUNT: 500 @@ -9481,302 +9481,741 @@ workflows: - j11_build: requires: - start_j11_build + upstream: + start_j11_build: + - success - start_j11_unit_tests: type: approval - j11_unit_tests: requires: - start_j11_unit_tests - j11_build + upstream: + start_j11_unit_tests: + - success + j11_build: + - success + - start_j11_unit_tests_repeat: + type: approval + - j11_unit_tests_repeat: + requires: + - start_j11_unit_tests_repeat + - j11_build + upstream: + start_j11_unit_tests_repeat: + - success + j11_build: + - success - start_j11_jvm_dtests: type: approval - j11_jvm_dtests: requires: - start_j11_jvm_dtests - j11_build + upstream: + start_j11_jvm_dtests: + - success + j11_build: + - success - start_j11_jvm_dtests_latest_vnode: type: approval - j11_jvm_dtests_latest_vnode: requires: - start_j11_jvm_dtests_latest_vnode - j11_build + upstream: + start_j11_jvm_dtests_latest_vnode: + - success + j11_build: + - success + - start_j11_jvm_dtests_repeat: + type: approval + - j11_jvm_dtests_repeat: + requires: + - start_j11_jvm_dtests_repeat + - j11_build + upstream: + start_j11_jvm_dtests_repeat: + - success + j11_build: + - success + - start_j11_jvm_dtests_latest_vnode_repeat: + type: approval + - j11_jvm_dtests_latest_vnode_repeat: + requires: + - start_j11_jvm_dtests_latest_vnode_repeat + - j11_build + upstream: + start_j11_jvm_dtests_latest_vnode_repeat: + - success + j11_build: + - success - start_j17_jvm_dtests: type: approval - j17_jvm_dtests: requires: - start_j17_jvm_dtests - j11_build + upstream: + start_j17_jvm_dtests: + - success + j11_build: + - success - start_j17_jvm_dtests_latest_vnode: type: approval - j17_jvm_dtests_latest_vnode: requires: - start_j17_jvm_dtests_latest_vnode - j11_build + upstream: + start_j17_jvm_dtests_latest_vnode: + - success + j11_build: + - success + - start_j17_jvm_dtests_repeat: + type: approval + - j17_jvm_dtests_repeat: + requires: + - start_j17_jvm_dtests_repeat + - j11_build + upstream: + start_j17_jvm_dtests_repeat: + - success + j11_build: + - success + - start_j17_jvm_dtests_latest_vnode_repeat: + type: approval + - j17_jvm_dtests_latest_vnode_repeat: + requires: + - start_j17_jvm_dtests_latest_vnode_repeat + - j11_build + upstream: + start_j17_jvm_dtests_latest_vnode_repeat: + - success + j11_build: + - success - start_j11_simulator_dtests: type: approval - j11_simulator_dtests: requires: - start_j11_simulator_dtests - j11_build + upstream: + start_j11_simulator_dtests: + - success + j11_build: + - success - start_j11_cqlshlib_tests: type: approval - j11_cqlshlib_tests: requires: - start_j11_cqlshlib_tests - j11_build + upstream: + start_j11_cqlshlib_tests: + - success + j11_build: + - success - start_j11_cqlshlib_cython_tests: type: approval - j11_cqlshlib_cython_tests: requires: - start_j11_cqlshlib_cython_tests - j11_build + upstream: + start_j11_cqlshlib_cython_tests: + - success + j11_build: + - success - start_j17_cqlshlib_tests: type: approval - j17_cqlshlib_tests: requires: - start_j17_cqlshlib_tests - j11_build + upstream: + start_j17_cqlshlib_tests: + - success + j11_build: + - success - start_j17_cqlshlib_cython_tests: type: approval - j17_cqlshlib_cython_tests: requires: - start_j17_cqlshlib_cython_tests - j11_build + upstream: + start_j17_cqlshlib_cython_tests: + - success + j11_build: + - success - start_j17_unit_tests: type: approval - j17_unit_tests: requires: - start_j17_unit_tests - j11_build + upstream: + start_j17_unit_tests: + - success + j11_build: + - success + - start_j17_unit_tests_repeat: + type: approval + - j17_unit_tests_repeat: + requires: + - start_j17_unit_tests_repeat + - j11_build + upstream: + start_j17_unit_tests_repeat: + - success + j11_build: + - success - start_j11_utests_oa: type: approval - j11_utests_oa: requires: - start_j11_utests_oa - j11_build + upstream: + start_j11_utests_oa: + - success + j11_build: + - success + - start_j11_utests_oa_repeat: + type: approval + - j11_utests_oa_repeat: + requires: + - start_j11_utests_oa_repeat + - j11_build + upstream: + start_j11_utests_oa_repeat: + - success + j11_build: + - success - start_j17_utests_oa: type: approval - j17_utests_oa: requires: - start_j17_utests_oa - j11_build + upstream: + start_j17_utests_oa: + - success + j11_build: + - success + - start_j17_utests_oa_repeat: + type: approval + - j17_utests_oa_repeat: + requires: + - start_j17_utests_oa_repeat + - j11_build + upstream: + start_j17_utests_oa_repeat: + - success + j11_build: + - success - start_j11_utests_long: type: approval - j11_utests_long: requires: - start_j11_utests_long - j11_build + upstream: + start_j11_utests_long: + - success + j11_build: + - success - start_j17_utests_long: type: approval - j17_utests_long: requires: - start_j17_utests_long - j11_build + upstream: + start_j17_utests_long: + - success + j11_build: + - success - start_j11_utests_cdc: type: approval - j11_utests_cdc: requires: - start_j11_utests_cdc - j11_build + upstream: + start_j11_utests_cdc: + - success + j11_build: + - success - start_j17_utests_cdc: type: approval - j17_utests_cdc: requires: - start_j17_utests_cdc - j11_build + upstream: + start_j17_utests_cdc: + - success + j11_build: + - success + - start_j11_utests_cdc_repeat: + type: approval + - j11_utests_cdc_repeat: + requires: + - start_j11_utests_cdc_repeat + - j11_build + upstream: + start_j11_utests_cdc_repeat: + - success + j11_build: + - success + - start_j17_utests_cdc_repeat: + type: approval + - j17_utests_cdc_repeat: + requires: + - start_j17_utests_cdc_repeat + - j11_build + upstream: + start_j17_utests_cdc_repeat: + - success + j11_build: + - success - start_j11_utests_compression: type: approval - j11_utests_compression: requires: - start_j11_utests_compression - j11_build + upstream: + start_j11_utests_compression: + - success + j11_build: + - success - start_j17_utests_compression: type: approval - j17_utests_compression: requires: - start_j17_utests_compression - j11_build + upstream: + start_j17_utests_compression: + - success + j11_build: + - success + - start_j11_utests_compression_repeat: + type: approval + - j11_utests_compression_repeat: + requires: + - start_j11_utests_compression_repeat + - j11_build + upstream: + start_j11_utests_compression_repeat: + - success + j11_build: + - success + - start_j17_utests_compression_repeat: + type: approval + - j17_utests_compression_repeat: + requires: + - start_j17_utests_compression_repeat + - j11_build + upstream: + start_j17_utests_compression_repeat: + - success + j11_build: + - success - start_j11_utests_latest: type: approval - j11_utests_latest: requires: - start_j11_utests_latest - j11_build + upstream: + start_j11_utests_latest: + - success + j11_build: + - success - start_j17_utests_latest: type: approval - j17_utests_latest: requires: - start_j17_utests_latest - j11_build + upstream: + start_j17_utests_latest: + - success + j11_build: + - success + - start_j11_utests_latest_repeat: + type: approval + - j11_utests_latest_repeat: + requires: + - start_j11_utests_latest_repeat + - j11_build + upstream: + start_j11_utests_latest_repeat: + - success + j11_build: + - success + - start_j17_utests_latest_repeat: + type: approval + - j17_utests_latest_repeat: + requires: + - start_j17_utests_latest_repeat + - j11_build + upstream: + start_j17_utests_latest_repeat: + - success + j11_build: + - success - start_j11_utests_stress: type: approval - j11_utests_stress: requires: - start_j11_utests_stress - j11_build + upstream: + start_j11_utests_stress: + - success + j11_build: + - success - start_j17_utests_stress: type: approval - j17_utests_stress: requires: - start_j17_utests_stress - j11_build + upstream: + start_j17_utests_stress: + - success + j11_build: + - success - start_j11_utests_fqltool: type: approval - j11_utests_fqltool: requires: - start_j11_utests_fqltool - j11_build + upstream: + start_j11_utests_fqltool: + - success + j11_build: + - success - start_j17_utests_fqltool: type: approval - j17_utests_fqltool: requires: - start_j17_utests_fqltool - j11_build + upstream: + start_j17_utests_fqltool: + - success + j11_build: + - success - start_j11_utests_system_keyspace_directory: type: approval - j11_utests_system_keyspace_directory: requires: - start_j11_utests_system_keyspace_directory - j11_build + upstream: + start_j11_utests_system_keyspace_directory: + - success + j11_build: + - success - start_j17_utests_system_keyspace_directory: type: approval - j17_utests_system_keyspace_directory: requires: - start_j17_utests_system_keyspace_directory - j11_build + upstream: + start_j17_utests_system_keyspace_directory: + - success + j11_build: + - success + - start_j11_utests_system_keyspace_directory_repeat: + type: approval + - j11_utests_system_keyspace_directory_repeat: + requires: + - start_j11_utests_system_keyspace_directory_repeat + - j11_build + upstream: + start_j11_utests_system_keyspace_directory_repeat: + - success + j11_build: + - success + - start_j17_utests_system_keyspace_directory_repeat: + type: approval + - j17_utests_system_keyspace_directory_repeat: + requires: + - start_j17_utests_system_keyspace_directory_repeat + - j11_build + upstream: + start_j17_utests_system_keyspace_directory_repeat: + - success + j11_build: + - success - start_j11_dtest_jars_build: type: approval - j11_dtest_jars_build: requires: - j11_build - start_j11_dtest_jars_build + upstream: + j11_build: + - success + start_j11_dtest_jars_build: + - success - start_jvm_upgrade_dtests: type: approval - j11_jvm_upgrade_dtests: requires: - start_jvm_upgrade_dtests - j11_dtest_jars_build + upstream: + start_jvm_upgrade_dtests: + - success + j11_dtest_jars_build: + - success - start_j11_dtests: type: approval - j11_dtests: requires: - start_j11_dtests - j11_build + upstream: + start_j11_dtests: + - success + j11_build: + - success - start_j11_dtests_vnode: type: approval - j11_dtests_vnode: requires: - start_j11_dtests_vnode - j11_build + upstream: + start_j11_dtests_vnode: + - success + j11_build: + - success - start_j11_dtests_latest: type: approval - j11_dtests_latest: requires: - start_j11_dtests_latest - j11_build + upstream: + start_j11_dtests_latest: + - success + j11_build: + - success - start_j17_dtests: type: approval - j17_dtests: requires: - start_j17_dtests - j11_build + upstream: + start_j17_dtests: + - success + j11_build: + - success - start_j17_dtests_vnode: type: approval - j17_dtests_vnode: requires: - start_j17_dtests_vnode - j11_build + upstream: + start_j17_dtests_vnode: + - success + j11_build: + - success - start_j17_dtests_latest: type: approval - j17_dtests_latest: requires: - start_j17_dtests_latest - j11_build + upstream: + start_j17_dtests_latest: + - success + j11_build: + - success - start_j11_dtests_large: type: approval - j11_dtests_large: requires: - start_j11_dtests_large - j11_build + upstream: + start_j11_dtests_large: + - success + j11_build: + - success - start_j11_dtests_large_vnode: type: approval - j11_dtests_large_vnode: requires: - start_j11_dtests_large_vnode - j11_build + upstream: + start_j11_dtests_large_vnode: + - success + j11_build: + - success - start_j17_dtests_large: type: approval - j17_dtests_large: requires: - start_j17_dtests_large - j11_build + upstream: + start_j17_dtests_large: + - success + j11_build: + - success - start_j17_dtests_large_vnode: type: approval - j17_dtests_large_vnode: requires: - start_j17_dtests_large_vnode - j11_build + upstream: + start_j17_dtests_large_vnode: + - success + j11_build: + - success - start_j11_cqlsh_tests: type: approval - j11_cqlsh_dtests_py38: requires: - start_j11_cqlsh_tests - j11_build + upstream: + start_j11_cqlsh_tests: + - success + j11_build: + - success - j11_cqlsh_dtests_py311: requires: - start_j11_cqlsh_tests - j11_build + upstream: + start_j11_cqlsh_tests: + - success + j11_build: + - success - j11_cqlsh_dtests_py38_vnode: requires: - start_j11_cqlsh_tests - j11_build + upstream: + start_j11_cqlsh_tests: + - success + j11_build: + - success - j11_cqlsh_dtests_py311_vnode: requires: - start_j11_cqlsh_tests - j11_build + upstream: + start_j11_cqlsh_tests: + - success + j11_build: + - success - start_j11_cqlsh_tests_latest: type: approval - j11_cqlsh_dtests_py38_latest: requires: - start_j11_cqlsh_tests_latest - j11_build + upstream: + start_j11_cqlsh_tests_latest: + - success + j11_build: + - success - j11_cqlsh_dtests_py311_latest: requires: - start_j11_cqlsh_tests_latest - j11_build + upstream: + start_j11_cqlsh_tests_latest: + - success + j11_build: + - success - start_j17_cqlsh_tests: type: approval - j17_cqlsh_dtests_py38: requires: - start_j17_cqlsh_tests - j11_build + upstream: + start_j17_cqlsh_tests: + - success + j11_build: + - success - j17_cqlsh_dtests_py311: requires: - start_j17_cqlsh_tests - j11_build + upstream: + start_j17_cqlsh_tests: + - success + j11_build: + - success - j17_cqlsh_dtests_py38_vnode: requires: - start_j17_cqlsh_tests - j11_build + upstream: + start_j17_cqlsh_tests: + - success + j11_build: + - success - j17_cqlsh_dtests_py311_vnode: requires: - start_j17_cqlsh_tests - j11_build + upstream: + start_j17_cqlsh_tests: + - success + j11_build: + - success - start_j17_cqlsh_tests_latest: type: approval - j17_cqlsh_dtests_py38_latest: requires: - start_j17_cqlsh_tests_latest - j11_build + upstream: + start_j17_cqlsh_tests_latest: + - success + j11_build: + - success - j17_cqlsh_dtests_py311_latest: requires: - start_j17_cqlsh_tests_latest - j11_build + upstream: + start_j17_cqlsh_tests_latest: + - success + j11_build: + - success - start_j11_upgrade_dtests: type: approval - j11_upgrade_dtests: requires: - start_j11_upgrade_dtests - j11_build + upstream: + start_j11_upgrade_dtests: + - success + j11_build: + - success java11_pre-commit_tests: jobs: - start_pre-commit_tests: @@ -9784,207 +10223,519 @@ workflows: - j11_build: requires: - start_pre-commit_tests + upstream: + start_pre-commit_tests: + - success - j11_unit_tests: requires: - j11_build + upstream: + j11_build: + - success - j11_utests_oa: requires: - j11_build + upstream: + j11_build: + - success + - j11_utests_oa_repeat: + requires: + - j11_build + upstream: + j11_build: + - success + - j17_utests_oa_repeat: + requires: + - j11_build + upstream: + j11_build: + - success + - j11_unit_tests_repeat: + requires: + - j11_build + upstream: + j11_build: + - success - j11_utests_latest: requires: - j11_build + upstream: + j11_build: + - success + - j11_utests_latest_repeat: + requires: + - j11_build + upstream: + j11_build: + - success - j11_simulator_dtests: requires: - j11_build + upstream: + j11_build: + - success - j11_jvm_dtests: requires: - j11_build + upstream: + j11_build: + - success + - j11_jvm_dtests_repeat: + requires: + - j11_build + upstream: + j11_build: + - success - j11_jvm_dtests_latest_vnode: requires: - j11_build + upstream: + j11_build: + - success + - j11_jvm_dtests_latest_vnode_repeat: + requires: + - j11_build + upstream: + j11_build: + - success - j17_jvm_dtests: requires: - j11_build + upstream: + j11_build: + - success + - j17_jvm_dtests_repeat: + requires: + - j11_build + upstream: + j11_build: + - success - j17_jvm_dtests_latest_vnode: requires: - j11_build + upstream: + j11_build: + - success + - j17_jvm_dtests_latest_vnode_repeat: + requires: + - j11_build + upstream: + j11_build: + - success - j11_cqlshlib_tests: requires: - j11_build + upstream: + j11_build: + - success - j11_cqlshlib_cython_tests: requires: - j11_build + upstream: + j11_build: + - success - j17_cqlshlib_tests: requires: - j11_build + upstream: + j11_build: + - success - j17_cqlshlib_cython_tests: requires: - j11_build + upstream: + j11_build: + - success - j17_unit_tests: requires: - j11_build + upstream: + j11_build: + - success - j17_utests_oa: requires: - j11_build + upstream: + j11_build: + - success + - j17_unit_tests_repeat: + requires: + - j11_build + upstream: + j11_build: + - success - j17_utests_latest: requires: - j11_build + upstream: + j11_build: + - success + - j17_utests_latest_repeat: + requires: + - j11_build + upstream: + j11_build: + - success - start_utests_long: type: approval - j11_utests_long: requires: - start_utests_long - j11_build + upstream: + start_utests_long: + - success + j11_build: + - success - j17_utests_long: requires: - start_utests_long - j11_build + upstream: + start_utests_long: + - success + j11_build: + - success - start_utests_cdc: type: approval - j11_utests_cdc: requires: - start_utests_cdc - j11_build + upstream: + start_utests_cdc: + - success + j11_build: + - success - j17_utests_cdc: requires: - start_utests_cdc - j11_build + upstream: + start_utests_cdc: + - success + j11_build: + - success + - j11_utests_cdc_repeat: + requires: + - start_utests_cdc + - j11_build + upstream: + start_utests_cdc: + - success + j11_build: + - success + - j17_utests_cdc_repeat: + requires: + - start_utests_cdc + - j11_build + upstream: + start_utests_cdc: + - success + j11_build: + - success - start_utests_compression: type: approval - j11_utests_compression: requires: - start_utests_compression - j11_build + upstream: + start_utests_compression: + - success + j11_build: + - success - j17_utests_compression: requires: - start_utests_compression - j11_build + upstream: + start_utests_compression: + - success + j11_build: + - success + - j11_utests_compression_repeat: + requires: + - start_utests_compression + - j11_build + upstream: + start_utests_compression: + - success + j11_build: + - success + - j17_utests_compression_repeat: + requires: + - start_utests_compression + - j11_build + upstream: + start_utests_compression: + - success + j11_build: + - success - start_utests_stress: type: approval - j11_utests_stress: requires: - start_utests_stress - j11_build + upstream: + start_utests_stress: + - success + j11_build: + - success - j17_utests_stress: requires: - start_utests_stress - j11_build + upstream: + start_utests_stress: + - success + j11_build: + - success - start_utests_fqltool: type: approval - j11_utests_fqltool: requires: - start_utests_fqltool - j11_build + upstream: + start_utests_fqltool: + - success + j11_build: + - success - j17_utests_fqltool: requires: - start_utests_fqltool - j11_build + upstream: + start_utests_fqltool: + - success + j11_build: + - success - start_utests_system_keyspace_directory: type: approval - j11_utests_system_keyspace_directory: requires: - j11_build + upstream: + j11_build: + - success - j17_utests_system_keyspace_directory: requires: - start_utests_system_keyspace_directory - j11_build + upstream: + start_utests_system_keyspace_directory: + - success + j11_build: + - success + - j11_utests_system_keyspace_directory_repeat: + requires: + - j11_build + upstream: + j11_build: + - success + - j17_utests_system_keyspace_directory_repeat: + requires: + - start_utests_system_keyspace_directory + - j11_build + upstream: + start_utests_system_keyspace_directory: + - success + j11_build: + - success - start_jvm_upgrade_dtests: type: approval - j11_dtest_jars_build: requires: - j11_build - start_jvm_upgrade_dtests + upstream: + j11_build: + - success + start_jvm_upgrade_dtests: + - success - j11_jvm_upgrade_dtests: requires: - j11_dtest_jars_build + upstream: + j11_dtest_jars_build: + - success - j11_dtests: requires: - j11_build + upstream: + j11_build: + - success - j11_dtests_vnode: requires: - j11_build + upstream: + j11_build: + - success - j11_dtests_latest: requires: - j11_build + upstream: + j11_build: + - success - j17_dtests: requires: - j11_build + upstream: + j11_build: + - success - j17_dtests_vnode: requires: - j11_build + upstream: + j11_build: + - success - j17_dtests_latest: requires: - j11_build + upstream: + j11_build: + - success - start_j11_dtests_large: type: approval - j11_dtests_large: requires: - start_j11_dtests_large - j11_build + upstream: + start_j11_dtests_large: + - success + j11_build: + - success - j11_dtests_large_vnode: requires: - start_j11_dtests_large - j11_build + upstream: + start_j11_dtests_large: + - success + j11_build: + - success - start_j17_dtests_large: type: approval - j17_dtests_large: requires: - start_j17_dtests_large - j11_build + upstream: + start_j17_dtests_large: + - success + j11_build: + - success - j17_dtests_large_vnode: requires: - start_j17_dtests_large - j11_build + upstream: + start_j17_dtests_large: + - success + j11_build: + - success - j11_cqlsh_dtests_py38: requires: - j11_build + upstream: + j11_build: + - success - j11_cqlsh_dtests_py311: requires: - j11_build + upstream: + j11_build: + - success - j11_cqlsh_dtests_py38_vnode: requires: - j11_build + upstream: + j11_build: + - success - j11_cqlsh_dtests_py311_vnode: requires: - j11_build + upstream: + j11_build: + - success - start_j11_cqlsh_dtests_latest: type: approval - j11_cqlsh_dtests_py38_latest: requires: - start_j11_cqlsh_dtests_latest - j11_build + upstream: + start_j11_cqlsh_dtests_latest: + - success + j11_build: + - success - j11_cqlsh_dtests_py311_latest: requires: - start_j11_cqlsh_dtests_latest - j11_build + upstream: + start_j11_cqlsh_dtests_latest: + - success + j11_build: + - success - j17_cqlsh_dtests_py38: requires: - j11_build + upstream: + j11_build: + - success - j17_cqlsh_dtests_py311: requires: - j11_build + upstream: + j11_build: + - success - j17_cqlsh_dtests_py38_vnode: requires: - j11_build + upstream: + j11_build: + - success - j17_cqlsh_dtests_py311_vnode: requires: - j11_build + upstream: + j11_build: + - success - start_j17_cqlsh-dtests-latest: type: approval - j17_cqlsh_dtests_py38_latest: requires: - start_j17_cqlsh-dtests-latest - j11_build + upstream: + start_j17_cqlsh-dtests-latest: + - success + j11_build: + - success - j17_cqlsh_dtests_py311_latest: requires: - start_j17_cqlsh-dtests-latest - j11_build + upstream: + start_j17_cqlsh-dtests-latest: + - success + j11_build: + - success - start_j11_upgrade_dtests: type: approval - j11_upgrade_dtests: requires: - j11_build - start_j11_upgrade_dtests + upstream: + j11_build: + - success + start_j11_upgrade_dtests: + - success java17_separate_tests: jobs: - start_j17_build: @@ -9992,142 +10743,353 @@ workflows: - j17_build: requires: - start_j17_build + upstream: + start_j17_build: + - success - start_j17_unit_tests: type: approval - j17_unit_tests: requires: - start_j17_unit_tests - j17_build + upstream: + start_j17_unit_tests: + - success + j17_build: + - success + - start_j17_unit_tests_repeat: + type: approval + - j17_unit_tests_repeat: + requires: + - start_j17_unit_tests_repeat + - j17_build + upstream: + start_j17_unit_tests_repeat: + - success + j17_build: + - success - start_j17_jvm_dtests: type: approval - j17_jvm_dtests: requires: - start_j17_jvm_dtests - j17_build + upstream: + start_j17_jvm_dtests: + - success + j17_build: + - success - start_j17_jvm_dtests_latest_vnode: type: approval - j17_jvm_dtests_latest_vnode: requires: - start_j17_jvm_dtests_latest_vnode - j17_build + upstream: + start_j17_jvm_dtests_latest_vnode: + - success + j17_build: + - success + - start_j17_jvm_dtests_repeat: + type: approval + - j17_jvm_dtests_repeat: + requires: + - start_j17_jvm_dtests_repeat + - j17_build + upstream: + start_j17_jvm_dtests_repeat: + - success + j17_build: + - success + - start_j17_jvm_dtests_latest_vnode_repeat: + type: approval + - j17_jvm_dtests_latest_vnode_repeat: + requires: + - start_j17_jvm_dtests_latest_vnode_repeat + - j17_build + upstream: + start_j17_jvm_dtests_latest_vnode_repeat: + - success + j17_build: + - success - start_j17_cqlshlib_tests: type: approval - j17_cqlshlib_tests: requires: - start_j17_cqlshlib_tests - j17_build + upstream: + start_j17_cqlshlib_tests: + - success + j17_build: + - success - start_j17_cqlshlib_cython_tests: type: approval - j17_cqlshlib_cython_tests: requires: - start_j17_cqlshlib_cython_tests - j17_build + upstream: + start_j17_cqlshlib_cython_tests: + - success + j17_build: + - success - start_j17_dtests: type: approval - j17_dtests: requires: - start_j17_dtests - j17_build + upstream: + start_j17_dtests: + - success + j17_build: + - success - start_j17_dtests_vnode: type: approval - j17_dtests_vnode: requires: - start_j17_dtests_vnode - j17_build + upstream: + start_j17_dtests_vnode: + - success + j17_build: + - success - start_j17_dtests_latest: type: approval - j17_dtests_latest: requires: - start_j17_dtests_latest - j17_build + upstream: + start_j17_dtests_latest: + - success + j17_build: + - success - start_j17_dtests_large: type: approval - j17_dtests_large: requires: - start_j17_dtests_large - j17_build + upstream: + start_j17_dtests_large: + - success + j17_build: + - success - start_j17_dtests_large_vnode: type: approval - j17_dtests_large_vnode: requires: - start_j17_dtests_large_vnode - j17_build + upstream: + start_j17_dtests_large_vnode: + - success + j17_build: + - success - start_j17_cqlsh_tests: type: approval - j17_cqlsh_dtests_py38: requires: - start_j17_cqlsh_tests - j17_build + upstream: + start_j17_cqlsh_tests: + - success + j17_build: + - success - j17_cqlsh_dtests_py311: requires: - start_j17_cqlsh_tests - j17_build + upstream: + start_j17_cqlsh_tests: + - success + j17_build: + - success - j17_cqlsh_dtests_py38_vnode: requires: - start_j17_cqlsh_tests - j17_build + upstream: + start_j17_cqlsh_tests: + - success + j17_build: + - success - j17_cqlsh_dtests_py311_vnode: requires: - start_j17_cqlsh_tests - j17_build + upstream: + start_j17_cqlsh_tests: + - success + j17_build: + - success - start_j17_cqlsh-dtests-latest: type: approval - j17_cqlsh_dtests_py38_latest: requires: - start_j17_cqlsh-dtests-latest - j17_build + upstream: + start_j17_cqlsh-dtests-latest: + - success + j17_build: + - success - j17_cqlsh_dtests_py311_latest: requires: - start_j17_cqlsh-dtests-latest - j17_build + upstream: + start_j17_cqlsh-dtests-latest: + - success + j17_build: + - success - start_j17_utests_oa: type: approval - j17_utests_oa: requires: - start_j17_utests_oa - j17_build + upstream: + start_j17_utests_oa: + - success + j17_build: + - success + - start_j17_utests_oa_repeat: + type: approval + - j17_utests_oa_repeat: + requires: + - start_j17_utests_oa_repeat + - j17_build + upstream: + start_j17_utests_oa_repeat: + - success + j17_build: + - success - start_j17_utests_long: type: approval - j17_utests_long: requires: - start_j17_utests_long - j17_build + upstream: + start_j17_utests_long: + - success + j17_build: + - success - start_j17_utests_cdc: type: approval - j17_utests_cdc: requires: - start_j17_utests_cdc - j17_build + upstream: + start_j17_utests_cdc: + - success + j17_build: + - success + - start_j17_utests_cdc_repeat: + type: approval + - j17_utests_cdc_repeat: + requires: + - start_j17_utests_cdc_repeat + - j17_build + upstream: + start_j17_utests_cdc_repeat: + - success + j17_build: + - success - start_j17_utests_compression: type: approval - j17_utests_compression: requires: - start_j17_utests_compression - j17_build + upstream: + start_j17_utests_compression: + - success + j17_build: + - success + - start_j17_utests_compression_repeat: + type: approval + - j17_utests_compression_repeat: + requires: + - start_j17_utests_compression_repeat + - j17_build + upstream: + start_j17_utests_compression_repeat: + - success + j17_build: + - success - start_j17_utests_latest: type: approval - j17_utests_latest: requires: - start_j17_utests_latest - j17_build + upstream: + start_j17_utests_latest: + - success + j17_build: + - success + - start_j17_utests_latest_repeat: + type: approval + - j17_utests_latest_repeat: + requires: + - start_j17_utests_latest_repeat + - j17_build + upstream: + start_j17_utests_latest_repeat: + - success + j17_build: + - success - start_j17_utests_stress: type: approval - j17_utests_stress: requires: - start_j17_utests_stress - j17_build + upstream: + start_j17_utests_stress: + - success + j17_build: + - success - start_j17_utests_fqltool: type: approval - j17_utests_fqltool: requires: - start_j17_utests_fqltool - j17_build + upstream: + start_j17_utests_fqltool: + - success + j17_build: + - success - start_j17_utests_system_keyspace_directory: type: approval - j17_utests_system_keyspace_directory: requires: - start_j17_utests_system_keyspace_directory - j17_build + upstream: + start_j17_utests_system_keyspace_directory: + - success + j17_build: + - success + - start_j17_utests_system_keyspace_directory_repeat: + type: approval + - j17_utests_system_keyspace_directory_repeat: + requires: + - start_j17_utests_system_keyspace_directory_repeat + - j17_build + upstream: + start_j17_utests_system_keyspace_directory_repeat: + - success + j17_build: + - success java17_pre-commit_tests: jobs: - start_pre-commit_tests: @@ -10135,101 +11097,253 @@ workflows: - j17_build: requires: - start_pre-commit_tests + upstream: + start_pre-commit_tests: + - success - j17_unit_tests: requires: - j17_build + upstream: + j17_build: + - success - j17_utests_oa: requires: - j17_build + upstream: + j17_build: + - success + - j17_utests_oa_repeat: + requires: + - j17_build + upstream: + j17_build: + - success + - j17_unit_tests_repeat: + requires: + - j17_build + upstream: + j17_build: + - success - j17_utests_latest: requires: - j17_build + upstream: + j17_build: + - success + - j17_utests_latest_repeat: + requires: + - j17_build + upstream: + j17_build: + - success - j17_jvm_dtests: requires: - j17_build + upstream: + j17_build: + - success + - j17_jvm_dtests_repeat: + requires: + - j17_build + upstream: + j17_build: + - success - j17_jvm_dtests_latest_vnode: requires: - j17_build + upstream: + j17_build: + - success + - j17_jvm_dtests_latest_vnode_repeat: + requires: + - j17_build + upstream: + j17_build: + - success - j17_cqlshlib_tests: requires: - j17_build + upstream: + j17_build: + - success - j17_cqlshlib_cython_tests: requires: - j17_build + upstream: + j17_build: + - success - j17_dtests: requires: - j17_build + upstream: + j17_build: + - success - j17_dtests_vnode: requires: - j17_build + upstream: + j17_build: + - success - j17_dtests_latest: requires: - j17_build + upstream: + j17_build: + - success - start_j17_dtests_large: type: approval - j17_dtests_large: requires: - start_j17_dtests_large - j17_build + upstream: + start_j17_dtests_large: + - success + j17_build: + - success - j17_dtests_large_vnode: requires: - start_j17_dtests_large - j17_build + upstream: + start_j17_dtests_large: + - success + j17_build: + - success - j17_cqlsh_dtests_py38: requires: - j17_build + upstream: + j17_build: + - success - j17_cqlsh_dtests_py311: requires: - j17_build + upstream: + j17_build: + - success - j17_cqlsh_dtests_py38_vnode: requires: - j17_build + upstream: + j17_build: + - success - j17_cqlsh_dtests_py311_vnode: requires: - j17_build + upstream: + j17_build: + - success - start_j17_cqlsh-dtests-latest: type: approval - j17_cqlsh_dtests_py38_latest: requires: - start_j17_cqlsh-dtests-latest - j17_build + upstream: + start_j17_cqlsh-dtests-latest: + - success + j17_build: + - success - j17_cqlsh_dtests_py311_latest: requires: - start_j17_cqlsh-dtests-latest - j17_build + upstream: + start_j17_cqlsh-dtests-latest: + - success + j17_build: + - success - start_utests_long: type: approval - j17_utests_long: requires: - start_utests_long - j17_build + upstream: + start_utests_long: + - success + j17_build: + - success - start_utests_cdc: type: approval - j17_utests_cdc: requires: - start_utests_cdc - j17_build + upstream: + start_utests_cdc: + - success + j17_build: + - success + - j17_utests_cdc_repeat: + requires: + - start_utests_cdc + - j17_build + upstream: + start_utests_cdc: + - success + j17_build: + - success - start_utests_compression: type: approval - j17_utests_compression: requires: - start_utests_compression - j17_build + upstream: + start_utests_compression: + - success + j17_build: + - success + - j17_utests_compression_repeat: + requires: + - start_utests_compression + - j17_build + upstream: + start_utests_compression: + - success + j17_build: + - success - start_utests_stress: type: approval - j17_utests_stress: requires: - start_utests_stress - j17_build + upstream: + start_utests_stress: + - success + j17_build: + - success - start_utests_fqltool: type: approval - j17_utests_fqltool: requires: - start_utests_fqltool - j17_build + upstream: + start_utests_fqltool: + - success + j17_build: + - success - start_utests_system_keyspace_directory: type: approval - j17_utests_system_keyspace_directory: requires: - start_utests_system_keyspace_directory - j17_build + upstream: + start_utests_system_keyspace_directory: + - success + j17_build: + - success + - j17_utests_system_keyspace_directory_repeat: + requires: + - start_utests_system_keyspace_directory + - j17_build + upstream: + start_utests_system_keyspace_directory: + - success + j17_build: + - success diff --git a/CHANGES.txt b/CHANGES.txt index d20a40bcf487..64903718c302 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 5.1 + * Implement appender of slow queries to system_views.slow_queries table (CASSANDRA-13001) * Add autocompletion in CQLSH for built-in functions (CASSANDRA-19631) * Grant permission on keyspaces system_views and system_virtual_schema not possible (CASSANDRA-20171) * General Purpose Transactions (Accord) [CEP-15] (CASSANDRA-17092) diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml index fe80fda1645d..0c68afe500bc 100644 --- a/conf/cassandra.yaml +++ b/conf/cassandra.yaml @@ -1396,6 +1396,10 @@ request_timeout: 10000ms # How long before a node logs slow queries. Select queries that take longer than # this timeout to execute, will generate an aggregated log message, so that slow queries # can be identified. Set this value to zero to disable slow query logging. +# +# It is possible to log slow queries into system_views.slow_queries virtual table. +# Consult logback.xml to uncomment specific appender and logger to enable this functionality. +# # Min unit: ms slow_query_log_timeout: 500ms diff --git a/conf/logback.xml b/conf/logback.xml index 102cf06352a4..a8dabf656448 100644 --- a/conf/logback.xml +++ b/conf/logback.xml @@ -119,6 +119,18 @@ appender reference in the root level section below. --> + + + + + + + + + + diff --git a/doc/modules/cassandra/pages/managing/configuration/cass_logback_xml_file.adoc b/doc/modules/cassandra/pages/managing/configuration/cass_logback_xml_file.adoc index a62dfe91a7be..b6e4d5f54583 100644 --- a/doc/modules/cassandra/pages/managing/configuration/cass_logback_xml_file.adoc +++ b/doc/modules/cassandra/pages/managing/configuration/cass_logback_xml_file.adoc @@ -80,7 +80,7 @@ Specify the format of the message. Part of the rolling policy. %-5level [%thread] %date\{ISO8601} %F:%L - %msg%n -=== Logging to Cassandra virtual table +=== Logging system logs to Cassandra virtual table It is possible to configure logback.xml in such a way that logs would appear in `system_views.system_log` table. This is achieved by appender implemented in class `VirtualTableAppender` which is called `CQLLOG` in the @@ -101,6 +101,72 @@ each message will occupy memory. The appender to virtual table is commented out by default so logging to virtual table is not active. +=== Logging slow queries to Cassandra virual table + +It is possible to log slow queries into `system_views.slow_queries` table. A query is evaluated to be slow +if it takes more than `slow_query_log_timeout` in `cassandra.yaml`. + +To log messages to `system_views.slow_queries` you need to: + +1. uncomment `SLOW_QUERIES_APPENDER` log appender +2. uncomment `appender-ref` pointing to `SLOW_QUERIES_APPENDER` in `slow_queries` logger: + +The respective configuration in `logback.xml` looks like this: + +[source,XML] +---- + + + + + + + + +---- + +By default, slow queries will be logged to `debug.log`. By uncommenting virtual table appender, it will be +logged to `debug.log` as well as to `system_views.slow_queries`. If you want to log it to `system_views.slow_queries` only, you need to comment out `DEBUGLOG` `appender-ref` in `slow_queries` logger declaration. + +If you want to log slow queries to a dedicated log file (which is e.g. rotated), that is also possible +by pointing `slow_queries` logger to a respective file appender of a given reference, similar to `DEBUGLOG` where all logs go by default. + +The structure of a table looks like this: + +[source,cql] +---- +cassandra@cqlsh> DESCRIBE system_views.slow_queries ; + +/* +Warning: Table system_views.slow_queries is a virtual table and cannot be recreated with CQL. +Structure, for reference: +VIRTUAL TABLE system_views.slow_queries ( + keyspace_name text, + table_name text, + timestamp timestamp, + query text, + avg_ms bigint, + cross_node boolean, + max_ms bigint, + min_ms bigint, + times_reported int, + PRIMARY KEY (keyspace_name, table_name, timestamp, query) +) WITH CLUSTERING ORDER BY (table_name ASC, timestamp ASC, query ASC) + AND comment = 'Slow queries'; +---- + +By having slow queries in a virtual table, an operator can check if there are slow queries for some table, see if +some queries violate some time threshold etc. The rows in this table are same data as one would get in `debug.log`, they +are just way more convenient to parse and query. + +`system_views.slow_queries` table is limited on number of rows it can hold, by default 10 000, configurable by `cassandra.virtual.slow_queries.max.rows` system property. If this table is full, the oldest entry is removed and the newest is inserted. This virtual table can be truncated by CQL and deletion on partition key (`keyspace_name` column) is allowed. + +A reader noticed that by placing custom appender implementation of `SLOW_QUERIES_APPENDER` appender on a class path and referencing it in `logback.xml`, it is possible to log slow queries wherever we have an appender for it. + === Contents of default `logback.xml` [source,XML] diff --git a/src/java/org/apache/cassandra/auth/MutualTlsAuthenticator.java b/src/java/org/apache/cassandra/auth/MutualTlsAuthenticator.java index 0337291a9dc2..7c5a6654f72f 100644 --- a/src/java/org/apache/cassandra/auth/MutualTlsAuthenticator.java +++ b/src/java/org/apache/cassandra/auth/MutualTlsAuthenticator.java @@ -44,7 +44,7 @@ import org.apache.cassandra.utils.NoSpamLogger; import static org.apache.cassandra.auth.IAuthenticator.AuthenticationMode.MTLS; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; /** * Performs mTLS authentication for client connections by extracting identities from client certificate diff --git a/src/java/org/apache/cassandra/auth/MutualTlsInternodeAuthenticator.java b/src/java/org/apache/cassandra/auth/MutualTlsInternodeAuthenticator.java index c1fcbd6eabf0..91500cbeb2f2 100644 --- a/src/java/org/apache/cassandra/auth/MutualTlsInternodeAuthenticator.java +++ b/src/java/org/apache/cassandra/auth/MutualTlsInternodeAuthenticator.java @@ -49,7 +49,7 @@ import org.apache.cassandra.metrics.MutualTlsMetrics; import org.apache.cassandra.utils.NoSpamLogger; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; /** * Performs mTLS authentication for internode connections by extracting identities from the certificates of incoming diff --git a/src/java/org/apache/cassandra/auth/MutualTlsWithPasswordFallbackAuthenticator.java b/src/java/org/apache/cassandra/auth/MutualTlsWithPasswordFallbackAuthenticator.java index 219353d76a1f..f994399f2161 100644 --- a/src/java/org/apache/cassandra/auth/MutualTlsWithPasswordFallbackAuthenticator.java +++ b/src/java/org/apache/cassandra/auth/MutualTlsWithPasswordFallbackAuthenticator.java @@ -81,7 +81,7 @@ public SaslNegotiator newSaslNegotiator(InetAddress clientAddress, Certificate[] public void validateConfiguration() throws ConfigurationException { Config config = DatabaseDescriptor.getRawConfig(); - if (config.client_encryption_options.getClientAuth() == EncryptionOptions.ClientAuth.NOT_REQUIRED) + if (config.client_encryption_options.getClientAuth() == EncryptionOptions.ClientEncryptionOptions.ClientAuth.NOT_REQUIRED) { String msg = "MutualTlsWithPasswordFallbackAuthenticator requires client_encryption_options.require_client_auth to be optional/true"; throw new ConfigurationException(msg); diff --git a/src/java/org/apache/cassandra/config/CassandraRelevantProperties.java b/src/java/org/apache/cassandra/config/CassandraRelevantProperties.java index 7459fecb8c34..e2957ce95f4f 100644 --- a/src/java/org/apache/cassandra/config/CassandraRelevantProperties.java +++ b/src/java/org/apache/cassandra/config/CassandraRelevantProperties.java @@ -27,6 +27,7 @@ import accord.utils.Invariants; import org.apache.cassandra.db.virtual.LogMessagesTable; +import org.apache.cassandra.db.virtual.SlowQueriesTable; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.utils.FBUtilities; import org.apache.cassandra.utils.StorageCompatibilityMode; @@ -363,6 +364,8 @@ public enum CassandraRelevantProperties LOG4J2_DISABLE_JMX_LEGACY("log4j2.disable.jmx"), LOG4J_SHUTDOWN_HOOK_ENABLED("log4j.shutdownHookEnabled"), LOGBACK_CONFIGURATION_FILE("logback.configurationFile"), + /** Maximum number of rows in system_views.slow_queries */ + LOGS_SLOW_QUERIES_VIRTUAL_TABLE_MAX_ROWS("cassandra.virtual.slow_queries.max.rows", convertToString(SlowQueriesTable.LOGS_VIRTUAL_TABLE_DEFAULT_ROWS)), /** Maximum number of rows in system_views.logs table */ LOGS_VIRTUAL_TABLE_MAX_ROWS("cassandra.virtual.logs.max.rows", convertToString(LogMessagesTable.LOGS_VIRTUAL_TABLE_DEFAULT_ROWS)), /** diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java index 65179fcd7e91..1a3da1033fbc 100644 --- a/src/java/org/apache/cassandra/config/Config.java +++ b/src/java/org/apache/cassandra/config/Config.java @@ -454,7 +454,7 @@ public static class SSTableConfig public String failure_detector = "FailureDetector"; public EncryptionOptions.ServerEncryptionOptions server_encryption_options = new EncryptionOptions.ServerEncryptionOptions(); - public EncryptionOptions client_encryption_options = new EncryptionOptions(); + public EncryptionOptions.ClientEncryptionOptions client_encryption_options = new EncryptionOptions.ClientEncryptionOptions(); public JMXServerOptions jmx_server_options; diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java index 0439dbb00c5f..616735289741 100644 --- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java +++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java @@ -156,7 +156,7 @@ import static org.apache.cassandra.config.DataRateSpec.DataRateUnit.BYTES_PER_SECOND; import static org.apache.cassandra.config.DataRateSpec.DataRateUnit.MEBIBYTES_PER_SECOND; import static org.apache.cassandra.config.DataStorageSpec.DataStorageUnit.MEBIBYTES; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; import static org.apache.cassandra.db.ConsistencyLevel.ALL; import static org.apache.cassandra.db.ConsistencyLevel.EACH_QUORUM; import static org.apache.cassandra.db.ConsistencyLevel.LOCAL_QUORUM; @@ -1088,10 +1088,10 @@ else if (conf.commitlog_segment_size.toKibibytes() < 2 * conf.max_mutation_size. } else if (JMXServerOptions.isEnabledBySystemProperties()) { - throw new ConfigurationException("Configure either jmx_server_options in cassandra.yaml and comment out " + - "configure_jmx function call in cassandra-env.sh or keep cassandra-env.sh " + - "to call configure_jmx function but you have to keep jmx_server_options " + - "in cassandra.yaml commented out."); + throw new ConfigurationException("Configure either jmx_server_options in cassandra.yaml and comment out " + + "configure_jmx function call in cassandra-env.sh or keep cassandra-env.sh " + + "to call configure_jmx function but you have to keep jmx_server_options " + + "in cassandra.yaml commented out."); } conf.jmx_server_options.jmx_encryption_options.applyConfig(); @@ -3973,7 +3973,7 @@ public static void setInternodeMessagingEncyptionOptions(EncryptionOptions.Serve conf.server_encryption_options = encryptionOptions; } - public static EncryptionOptions getNativeProtocolEncryptionOptions() + public static EncryptionOptions.ClientEncryptionOptions getNativeProtocolEncryptionOptions() { return conf.client_encryption_options; } @@ -3984,7 +3984,7 @@ public static JMXServerOptions getJmxServerOptions() } @VisibleForTesting - public static void updateNativeProtocolEncryptionOptions(Function update) + public static void updateNativeProtocolEncryptionOptions(Function update) { conf.client_encryption_options = update.apply(conf.client_encryption_options); } diff --git a/src/java/org/apache/cassandra/config/EncryptionOptions.java b/src/java/org/apache/cassandra/config/EncryptionOptions.java index 07f78b9a5eea..5f94c14bcbb7 100644 --- a/src/java/org/apache/cassandra/config/EncryptionOptions.java +++ b/src/java/org/apache/cassandra/config/EncryptionOptions.java @@ -17,7 +17,6 @@ */ package org.apache.cassandra.config; -import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -46,10 +45,8 @@ * Examples of such options are: supported cipher-suites, ssl protocol with version, accepted protocols, end-point * verification, require client-auth/cert etc. */ -public class EncryptionOptions +public abstract class EncryptionOptions> { - Logger logger = LoggerFactory.getLogger(EncryptionOptions.class); - public enum TlsEncryptionPolicy { UNENCRYPTED("unencrypted"), @@ -69,39 +66,50 @@ public String description() } } - public enum ClientAuth + public enum ConfigKey { - REQUIRED("true"), - NOT_REQUIRED("false"), - OPTIONAL("optional"); - private final String value; - private static final Map VALUES = new HashMap<>(); - static + KEYSTORE("keystore"), + KEYSTORE_PASSWORD("keystore_password"), + KEYSTORE_PASSWORD_FILE("keystore_password_file"), + OUTBOUND_KEYSTORE("outbound_keystore"), + OUTBOUND_KEYSTORE_PASSWORD("outbound_keystore_password"), + OUTBOUND_KEYSTORE_PASSWORD_FILE("outbound_keystore_password_file"), + TRUSTSTORE("truststore"), + TRUSTSTORE_PASSWORD("truststore_password"), + TRUSTSTORE_PASSWORD_FILE("truststore_password_file"), + CIPHER_SUITES("cipher_suites"), + PROTOCOL("protocol"), + ACCEPTED_PROTOCOLS("accepted_protocols"), + ALGORITHM("algorithm"), + STORE_TYPE("store_type"), + REQUIRE_CLIENT_AUTH("require_client_auth"), + REQUIRE_ENDPOINT_VERIFICATION("require_endpoint_verification"), + ENABLED("enabled"), + OPTIONAL("optional"), + MAX_CERTIFICATE_VALIDITY_PERIOD("max_certificate_validity_period"), + CERTIFICATE_VALIDITY_WARN_THRESHOLD("certificate_validity_warn_threshold"); + + final String keyName; + + ConfigKey(String keyName) { - for (ClientAuth clientAuth : ClientAuth.values()) - { - VALUES.put(clientAuth.value, clientAuth); - VALUES.put(toLowerCaseLocalized(clientAuth.name()), clientAuth); - } + this.keyName = keyName; } - ClientAuth(String value) + public String toString() { - this.value = value; + return keyName; } - public static ClientAuth from(String value) + static Set asSet() { - if (VALUES.containsKey(toLowerCaseLocalized(value))) + Set valueSet = new HashSet<>(); + ConfigKey[] values = values(); + for (ConfigKey key : values) { - return VALUES.get(toLowerCaseLocalized(value)); + valueSet.add(toLowerCaseLocalized(key.toString())); } - throw new ConfigurationException(value + " is not a valid ClientAuth option"); - } - - public String value() - { - return value; + return valueSet; } } @@ -153,53 +161,6 @@ public String value() */ public transient ISslContextFactory sslContextFactoryInstance; - public enum ConfigKey - { - KEYSTORE("keystore"), - KEYSTORE_PASSWORD("keystore_password"), - KEYSTORE_PASSWORD_FILE("keystore_password_file"), - OUTBOUND_KEYSTORE("outbound_keystore"), - OUTBOUND_KEYSTORE_PASSWORD("outbound_keystore_password"), - OUTBOUND_KEYSTORE_PASSWORD_FILE("outbound_keystore_password_file"), - TRUSTSTORE("truststore"), - TRUSTSTORE_PASSWORD("truststore_password"), - TRUSTSTORE_PASSWORD_FILE("truststore_password_file"), - CIPHER_SUITES("cipher_suites"), - PROTOCOL("protocol"), - ACCEPTED_PROTOCOLS("accepted_protocols"), - ALGORITHM("algorithm"), - STORE_TYPE("store_type"), - REQUIRE_CLIENT_AUTH("require_client_auth"), - REQUIRE_ENDPOINT_VERIFICATION("require_endpoint_verification"), - ENABLED("enabled"), - OPTIONAL("optional"), - MAX_CERTIFICATE_VALIDITY_PERIOD("max_certificate_validity_period"), - CERTIFICATE_VALIDITY_WARN_THRESHOLD("certificate_validity_warn_threshold"); - - final String keyName; - - ConfigKey(String keyName) - { - this.keyName = keyName; - } - - public String toString() - { - return keyName; - } - - static Set asSet() - { - Set valueSet = new HashSet<>(); - ConfigKey[] values = values(); - for (ConfigKey key : values) - { - valueSet.add(toLowerCaseLocalized(key.toString())); - } - return valueSet; - } - } - public EncryptionOptions() { ssl_context_factory = new ParameterizedClass("org.apache.cassandra.security.DefaultSslContextFactory", @@ -252,7 +213,7 @@ public EncryptionOptions(ParameterizedClass ssl_context_factory, this.certificate_validity_warn_threshold = certificate_validity_warn_threshold; } - public EncryptionOptions(EncryptionOptions options) + public EncryptionOptions(EncryptionOptions options) { ssl_context_factory = options.ssl_context_factory; keystore = options.keystore; @@ -280,7 +241,7 @@ public EncryptionOptions(EncryptionOptions options) * * It also initializes the ISslContextFactory's instance */ - public EncryptionOptions applyConfig() + public T applyConfig() { ensureConfigNotApplied(); @@ -304,7 +265,7 @@ else if (sslContextFactoryInstance.hasKeystore()) // Otherwise if there's no keystore, not possible to establish an optional secure connection isOptional = false; } - return this; + return (T) this; } /** @@ -312,22 +273,22 @@ else if (sslContextFactoryInstance.hasKeystore()) * as the constructor for its implementation. * * @throws IllegalArgumentException in case any pre-defined key, as per {@link ConfigKey}, for the encryption - * options is duplicated in the parameterized keys. + * options is duplicated in the parameterized keys. */ - private void prepareSslContextFactoryParameterizedKeys(Map sslContextFactoryParameters) + private void prepareSslContextFactoryParameterizedKeys(Map sslContextFactoryParameters) { if (ssl_context_factory.parameters != null) { Set configKeys = ConfigKey.asSet(); for (Map.Entry entry : ssl_context_factory.parameters.entrySet()) { - if(configKeys.contains(toLowerCaseLocalized(entry.getKey()))) + if (configKeys.contains(toLowerCaseLocalized(entry.getKey()))) { - throw new IllegalArgumentException("SslContextFactory "+ssl_context_factory.class_name+" should " + - "configure '"+entry.getKey()+"' as encryption_options instead of" + + throw new IllegalArgumentException("SslContextFactory " + ssl_context_factory.class_name + " should " + + "configure '" + entry.getKey() + "' as encryption_options instead of" + " parameterized keys"); } - sslContextFactoryParameters.put(entry.getKey(),entry.getValue()); + sslContextFactoryParameters.put(entry.getKey(), entry.getValue()); } } } @@ -375,7 +336,8 @@ private void initializeSslContextFactory() protected static void putSslContextFactoryParameter(Map existingParameters, ConfigKey configKey, Object value) { - if (value != null) { + if (value != null) + { existingParameters.put(configKey.toString(), value); } } @@ -480,9 +442,9 @@ public List getAcceptedProtocols() return sslContextFactoryInstance == null ? null : sslContextFactoryInstance.getAcceptedProtocols(); } - public ClientAuth getClientAuth() + public ClientEncryptionOptions.ClientAuth getClientAuth() { - return this.require_client_auth == null ? ClientAuth.NOT_REQUIRED : ClientAuth.from(this.require_client_auth); + return this.require_client_auth == null ? ClientEncryptionOptions.ClientAuth.NOT_REQUIRED : ClientEncryptionOptions.ClientAuth.from(this.require_client_auth); } public String[] acceptedProtocolsArray() @@ -517,162 +479,6 @@ else if (getEnabled()) } } - public EncryptionOptions withSslContextFactory(ParameterizedClass sslContextFactoryClass) - { - return new EncryptionOptions(sslContextFactoryClass, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, - store_type, require_client_auth, require_endpoint_verification, enabled, - optional, max_certificate_validity_period, max_certificate_validity_period).applyConfig(); - } - - public EncryptionOptions withKeyStore(String keystore) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, - store_type, require_client_auth, require_endpoint_verification, enabled, - optional, max_certificate_validity_period, max_certificate_validity_period).applyConfig(); - } - - public EncryptionOptions withKeyStorePassword(String keystore_password) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, - store_type, require_client_auth, require_endpoint_verification, enabled, - optional, max_certificate_validity_period, max_certificate_validity_period).applyConfig(); - } - - public EncryptionOptions withKeyStorePasswordFile(String keystore_password_file) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, - store_type, require_client_auth, require_endpoint_verification, enabled, - optional, max_certificate_validity_period, max_certificate_validity_period).applyConfig(); - } - - public EncryptionOptions withTrustStore(String truststore) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, - store_type, require_client_auth, require_endpoint_verification, enabled, - optional, max_certificate_validity_period, max_certificate_validity_period).applyConfig(); - } - - public EncryptionOptions withTrustStorePassword(String truststore_password) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, - store_type, require_client_auth, require_endpoint_verification, enabled, - optional, max_certificate_validity_period, max_certificate_validity_period).applyConfig(); - } - - public EncryptionOptions withTrustStorePasswordFile(String truststore_password_file) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, - store_type, require_client_auth, require_endpoint_verification, enabled, - optional, max_certificate_validity_period, max_certificate_validity_period).applyConfig(); - } - - public EncryptionOptions withCipherSuites(List cipher_suites) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, - store_type, require_client_auth, require_endpoint_verification, enabled, - optional, max_certificate_validity_period, max_certificate_validity_period).applyConfig(); - } - - public EncryptionOptions withCipherSuites(String... cipher_suites) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, ImmutableList.copyOf(cipher_suites), protocol, - accepted_protocols, algorithm, store_type, require_client_auth, - require_endpoint_verification, enabled, optional, max_certificate_validity_period, - max_certificate_validity_period).applyConfig(); - } - - public EncryptionOptions withProtocol(String protocol) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, - store_type, require_client_auth, require_endpoint_verification, enabled, - optional, max_certificate_validity_period, max_certificate_validity_period).applyConfig(); - } - - - public EncryptionOptions withAcceptedProtocols(List accepted_protocols) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols == null ? null : - ImmutableList.copyOf(accepted_protocols), - algorithm, store_type, require_client_auth, require_endpoint_verification, - enabled, optional, max_certificate_validity_period, max_certificate_validity_period).applyConfig(); - } - - - public EncryptionOptions withAlgorithm(String algorithm) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, - store_type, require_client_auth, require_endpoint_verification, enabled, - optional, max_certificate_validity_period, max_certificate_validity_period).applyConfig(); - } - - public EncryptionOptions withStoreType(String store_type) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, - store_type, require_client_auth, require_endpoint_verification, enabled, - optional, max_certificate_validity_period, max_certificate_validity_period).applyConfig(); - } - - public EncryptionOptions withRequireClientAuth(ClientAuth require_client_auth) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, - store_type, require_client_auth.value, require_endpoint_verification, enabled, - optional, max_certificate_validity_period, max_certificate_validity_period).applyConfig(); - } - - public EncryptionOptions withRequireEndpointVerification(boolean require_endpoint_verification) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, - store_type, require_client_auth, require_endpoint_verification, enabled, - optional, max_certificate_validity_period, max_certificate_validity_period).applyConfig(); - } - - public EncryptionOptions withEnabled(boolean enabled) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, - store_type, require_client_auth, require_endpoint_verification, enabled, - optional, max_certificate_validity_period, max_certificate_validity_period).applyConfig(); - } - - public EncryptionOptions withOptional(Boolean optional) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, - store_type, require_client_auth, require_endpoint_verification, enabled, - optional, max_certificate_validity_period, max_certificate_validity_period).applyConfig(); - } - - public EncryptionOptions withMaxCertificateValidityPeriod(DurationSpec.IntMinutesBound maxCertificateValidityPeriod) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, - store_type, require_client_auth, require_endpoint_verification, enabled, - optional, maxCertificateValidityPeriod, certificate_validity_warn_threshold).applyConfig(); - } - - public EncryptionOptions withCertificateValidityWarnThreshold(DurationSpec.IntMinutesBound certificateValidityWarnThreshold) - { - return new EncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, - truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, - store_type, require_client_auth, require_endpoint_verification, enabled, - optional, max_certificate_validity_period, certificateValidityWarnThreshold).applyConfig(); - } - /** * The method is being mainly used to cache SslContexts therefore, we only consider * fields that would make a difference when the TrustStore or KeyStore files are updated @@ -685,7 +491,7 @@ public boolean equals(Object o) if (o == null || getClass() != o.getClass()) return false; - EncryptionOptions opt = (EncryptionOptions)o; + EncryptionOptions opt = (EncryptionOptions) o; return enabled == opt.enabled && optional == opt.optional && require_client_auth.equals(opt.require_client_auth) && @@ -731,8 +537,258 @@ public int hashCode() return result; } - public static class ServerEncryptionOptions extends EncryptionOptions + public static abstract class Builder> { + ParameterizedClass ssl_context_factory; + String keystore; + String keystore_password; + String keystore_password_file; + String truststore; + String truststore_password; + String truststore_password_file; + List cipher_suites; + String protocol; + List accepted_protocols; + String algorithm; + String store_type; + String require_client_auth; + boolean require_endpoint_verification; + DurationSpec.IntMinutesBound max_certificate_validity_period; + DurationSpec.IntMinutesBound certificate_validity_warn_threshold; + Boolean enabled; + Boolean optional; + Boolean isEnabled; + Boolean isOptional; + + public Builder(EncryptionOptions options) + { + ssl_context_factory = options.ssl_context_factory; + keystore = options.keystore; + keystore_password = options.keystore_password; + keystore_password_file = options.keystore_password_file; + truststore = options.truststore; + truststore_password = options.truststore_password; + truststore_password_file = options.truststore_password_file; + cipher_suites = options.cipher_suites; + protocol = options.protocol; + accepted_protocols = options.accepted_protocols; + algorithm = options.algorithm; + store_type = options.store_type; + require_client_auth = options.require_client_auth; + require_endpoint_verification = options.require_endpoint_verification; + enabled = options.enabled; + optional = options.optional; + max_certificate_validity_period = options.max_certificate_validity_period; + certificate_validity_warn_threshold = options.certificate_validity_warn_threshold; + } + + public Builder withSslContextFactory(ParameterizedClass sslContextFactoryClass) + { + this.ssl_context_factory = sslContextFactoryClass; + return this; + } + + public Builder withKeyStore(String keystore) + { + this.keystore = keystore; + return this; + } + + public Builder withKeyStorePassword(String keystore_password) + { + this.keystore_password = keystore_password; + return this; + } + + public Builder withKeyStorePasswordFile(String keystore_password_file) + { + this.keystore_password_file = keystore_password_file; + return this; + } + + public Builder withTrustStore(String truststore) + { + this.truststore = truststore; + return this; + } + + public Builder withTrustStorePassword(String truststore_password) + { + this.truststore_password = truststore_password; + return this; + } + + public Builder withTrustStorePasswordFile(String truststore_password_file) + { + this.truststore_password_file = truststore_password_file; + return this; + } + + public Builder withCipherSuites(List cipher_suites) + { + this.cipher_suites = cipher_suites; + return this; + } + + public Builder withCipherSuites(String... cipher_suites) + { + this.cipher_suites = ImmutableList.copyOf(cipher_suites); + return this; + } + + public Builder withProtocol(String protocol) + { + this.protocol = protocol; + return this; + } + + public Builder withAcceptedProtocols(List accepted_protocols) + { + this.accepted_protocols = accepted_protocols == null ? null : + ImmutableList.copyOf(accepted_protocols); + return this; + } + + public Builder withAlgorithm(String algorithm) + { + this.algorithm = algorithm; + return this; + } + + public Builder withStoreType(String store_type) + { + this.store_type = store_type; + return this; + } + + public Builder withRequireClientAuth(ClientEncryptionOptions.ClientAuth require_client_auth) + { + this.require_client_auth = require_client_auth.value; + return this; + } + + public Builder withRequireEndpointVerification(boolean require_endpoint_verification) + { + this.require_endpoint_verification = require_endpoint_verification; + return this; + } + + public Builder withEnabled(boolean enabled) + { + this.enabled = enabled; + return this; + } + + public Builder withOptional(Boolean optional) + { + this.optional = optional; + return this; + } + + public Builder withMaxCertificateValidityPeriod(DurationSpec.IntMinutesBound maxCertificateValidityPeriod) + { + this.max_certificate_validity_period = maxCertificateValidityPeriod; + return this; + } + + public Builder withCertificateValidityWarnThreshold(DurationSpec.IntMinutesBound certificateValidityWarnThreshold) + { + this.certificate_validity_warn_threshold = certificateValidityWarnThreshold; + return this; + } + + public abstract T build(); + } + + public static class ClientEncryptionOptions extends EncryptionOptions + { + public ClientEncryptionOptions() + { + } + + public ClientEncryptionOptions(ParameterizedClass ssl_context_factory, + String keystore, String keystore_password, String keystore_password_file, + String truststore, String truststore_password, String truststore_password_file, + List cipher_suites, String protocol, List accepted_protocols, + String algorithm, String store_type, String require_client_auth, + boolean require_endpoint_verification, Boolean enabled, Boolean optional, + DurationSpec.IntMinutesBound max_certificate_validity_period, + DurationSpec.IntMinutesBound certificate_validity_warn_threshold) + { + super(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, truststore_password, + truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, store_type, require_client_auth, + require_endpoint_verification, enabled, optional, max_certificate_validity_period, certificate_validity_warn_threshold); + } + + public ClientEncryptionOptions(ClientEncryptionOptions options) + { + super(options); + } + + public enum ClientAuth + { + REQUIRED("true"), + NOT_REQUIRED("false"), + OPTIONAL("optional"); + private final String value; + private static final Map VALUES = new HashMap<>(); + + static + { + for (ClientAuth clientAuth : ClientAuth.values()) + { + VALUES.put(clientAuth.value, clientAuth); + VALUES.put(toLowerCaseLocalized(clientAuth.name()), clientAuth); + } + } + + ClientAuth(String value) + { + this.value = value; + } + + public static ClientAuth from(String value) + { + if (VALUES.containsKey(toLowerCaseLocalized(value))) + { + return VALUES.get(toLowerCaseLocalized(value)); + } + throw new ConfigurationException(value + " is not a valid ClientAuth option"); + } + + public String value() + { + return value; + } + } + + public static class Builder extends EncryptionOptions.Builder + { + public Builder() + { + this(new ClientEncryptionOptions()); + } + + public Builder(ClientEncryptionOptions options) + { + super(options); + } + + @Override + public ClientEncryptionOptions build() + { + return new ClientEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, truststore, + truststore_password, truststore_password_file, cipher_suites, protocol, accepted_protocols, algorithm, + store_type, require_client_auth, require_endpoint_verification, enabled, + optional, max_certificate_validity_period, certificate_validity_warn_threshold).applyConfig(); + } + } + } + + public static class ServerEncryptionOptions extends EncryptionOptions + { + private static final Logger logger = LoggerFactory.getLogger(ServerEncryptionOptions.class); + public enum InternodeEncryption { all, none, dc, rack @@ -788,6 +844,73 @@ public ServerEncryptionOptions(ServerEncryptionOptions options) this.outbound_keystore_password_file = options.outbound_keystore_password_file; } + public static class Builder extends EncryptionOptions.Builder + { + private InternodeEncryption internode_encryption; + private boolean legacy_ssl_storage_port_enabled; + private String outbound_keystore; + private String outbound_keystore_password; + private String outbound_keystore_password_file; + + public Builder() + { + this(new ServerEncryptionOptions()); + } + + public Builder(ServerEncryptionOptions options) + { + super(options); + this.internode_encryption = options.internode_encryption; + this.legacy_ssl_storage_port_enabled = options.legacy_ssl_storage_port_enabled; + this.outbound_keystore = options.outbound_keystore; + this.outbound_keystore_password = options.outbound_keystore_password; + this.outbound_keystore_password_file = options.outbound_keystore_password_file; + } + + public Builder withInternodeEncryption(InternodeEncryption internode_encryption) + { + this.internode_encryption = internode_encryption; + return this; + } + + public Builder withLegacySslStoragePort(boolean enable_legacy_ssl_storage_port) + { + this.legacy_ssl_storage_port_enabled = enable_legacy_ssl_storage_port; + return this; + } + + public Builder withOutboundKeystore(String outboundKeystore) + { + this.outbound_keystore = outboundKeystore; + return this; + } + + public Builder withOutboundKeystorePassword(String outboundKeystorePassword) + { + this.outbound_keystore_password = outboundKeystorePassword; + return this; + } + + public Builder withOutboundKeystorePasswordFile(String outboundKeystorePasswordFile) + { + this.outbound_keystore_password_file = outboundKeystorePasswordFile; + return this; + } + + @Override + public ServerEncryptionOptions build() + { + return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, + outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, + truststore, truststore_password, truststore_password_file, + cipher_suites, protocol, accepted_protocols, + algorithm, store_type, require_client_auth, + require_endpoint_verification, optional, internode_encryption, + legacy_ssl_storage_port_enabled, max_certificate_validity_period, + certificate_validity_warn_threshold).applyConfig(); + } + } + @Override protected void fillSslContextParams(Map sslContextFactoryParameters) { @@ -798,7 +921,7 @@ protected void fillSslContextParams(Map sslContextFactoryParamet } @Override - public EncryptionOptions applyConfig() + public ServerEncryptionOptions applyConfig() { return applyConfigInternal(); } @@ -814,13 +937,13 @@ private ServerEncryptionOptions applyConfigInternal() logger.warn("Setting server_encryption_options.enabled has no effect, use internode_encryption"); } - if (getClientAuth() != ClientAuth.NOT_REQUIRED && (internode_encryption == InternodeEncryption.rack || internode_encryption == InternodeEncryption.dc)) + if (getClientAuth() != ClientEncryptionOptions.ClientAuth.NOT_REQUIRED && (internode_encryption == InternodeEncryption.rack || internode_encryption == InternodeEncryption.dc)) { logger.warn("Setting require_client_auth is incompatible with 'rack' and 'dc' internode_encryption values." - + " It is possible for an internode connection to pretend to be in the same rack/dc by spoofing" - + " its broadcast address in the handshake and bypass authentication. To ensure that mutual TLS" - + " authentication is not bypassed, please set internode_encryption to 'all'. Continuing with" - + " insecure configuration."); + + " It is possible for an internode connection to pretend to be in the same rack/dc by spoofing" + + " its broadcast address in the handshake and bypass authentication. To ensure that mutual TLS" + + " authentication is not bypassed, please set internode_encryption to 'all'. Continuing with" + + " insecure configuration."); } // regardless of the optional flag, if the internode encryption is set to rack or dc @@ -910,284 +1033,5 @@ public int hashCode() result += 31 * (outbound_keystore_password_file == null ? 0 : outbound_keystore_password_file.hashCode()); return result; } - - @Override - public ServerEncryptionOptions withSslContextFactory(ParameterizedClass sslContextFactoryClass) - { - return new ServerEncryptionOptions(sslContextFactoryClass, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - @Override - public ServerEncryptionOptions withKeyStore(String keystore) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - @Override - public ServerEncryptionOptions withKeyStorePassword(String keystore_password) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - @Override - public ServerEncryptionOptions withKeyStorePasswordFile(String keystore_password_file) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - @Override - public ServerEncryptionOptions withTrustStore(String truststore) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - @Override - public ServerEncryptionOptions withTrustStorePassword(String truststore_password) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - @Override - public ServerEncryptionOptions withTrustStorePasswordFile(String truststore_password_file) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - @Override - public ServerEncryptionOptions withCipherSuites(List cipher_suites) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - @Override - public ServerEncryptionOptions withCipherSuites(String... cipher_suites) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - Arrays.asList(cipher_suites), protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - @Override - public ServerEncryptionOptions withProtocol(String protocol) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - @Override - public ServerEncryptionOptions withAcceptedProtocols(List accepted_protocols) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - @Override - public ServerEncryptionOptions withAlgorithm(String algorithm) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - @Override - public ServerEncryptionOptions withStoreType(String store_type) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - @Override - public ServerEncryptionOptions withRequireClientAuth(ClientAuth require_client_auth) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth.value, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - @Override - public ServerEncryptionOptions withRequireEndpointVerification(boolean require_endpoint_verification) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - public ServerEncryptionOptions withOptional(boolean optional) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - public ServerEncryptionOptions withInternodeEncryption(InternodeEncryption internode_encryption) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - public ServerEncryptionOptions withLegacySslStoragePort(boolean enable_legacy_ssl_storage_port) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - enable_legacy_ssl_storage_port, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - public ServerEncryptionOptions withOutboundKeystore(String outboundKeystore) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outboundKeystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - public ServerEncryptionOptions withOutboundKeystorePassword(String outboundKeystorePassword) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outboundKeystorePassword, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - - public ServerEncryptionOptions withOutboundKeystorePasswordFile(String outboundKeystorePasswordFile) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outboundKeystorePasswordFile, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, max_certificate_validity_period, - max_certificate_validity_period).applyConfigInternal(); - } - @Override - public ServerEncryptionOptions withMaxCertificateValidityPeriod(DurationSpec.IntMinutesBound maxCertificateValidityPeriod) - { - return new ServerEncryptionOptions(ssl_context_factory, keystore, keystore_password, keystore_password_file, - outbound_keystore, outbound_keystore_password, outbound_keystore_password_file, - truststore, truststore_password, truststore_password_file, - cipher_suites, protocol, accepted_protocols, - algorithm, store_type, require_client_auth, - require_endpoint_verification, optional, internode_encryption, - legacy_ssl_storage_port_enabled, maxCertificateValidityPeriod, - certificate_validity_warn_threshold).applyConfigInternal(); - } } } diff --git a/src/java/org/apache/cassandra/config/JMXServerOptions.java b/src/java/org/apache/cassandra/config/JMXServerOptions.java index 705ab02bb898..ab80307e5460 100644 --- a/src/java/org/apache/cassandra/config/JMXServerOptions.java +++ b/src/java/org/apache/cassandra/config/JMXServerOptions.java @@ -52,7 +52,7 @@ public class JMXServerOptions public final Boolean authenticate; // ssl options - public final EncryptionOptions jmx_encryption_options; + public final EncryptionOptions.ClientEncryptionOptions jmx_encryption_options; // options for using Cassandra's own authentication mechanisms public final String login_config_name; @@ -71,11 +71,11 @@ public class JMXServerOptions public JMXServerOptions() { this(true, false, 7199, 0, false, - new EncryptionOptions(), null, null, null, + new EncryptionOptions.ClientEncryptionOptions(), null, null, null, null, null); } - public static JMXServerOptions create(boolean enabled, boolean local, int jmxPort, EncryptionOptions options) + public static JMXServerOptions create(boolean enabled, boolean local, int jmxPort, EncryptionOptions.ClientEncryptionOptions options) { return new JMXServerOptions(enabled, !local, jmxPort, 0, false, options, null, null, null, @@ -95,7 +95,7 @@ public JMXServerOptions(Boolean enabled, int jmxPort, int rmiPort, Boolean authenticate, - EncryptionOptions jmx_encryption_options, + EncryptionOptions.ClientEncryptionOptions jmx_encryption_options, String loginConfigName, String loginConfigFile, String passwordFile, @@ -198,7 +198,8 @@ public static JMXServerOptions createParsingSystemProperties() // in the `cassandra.yaml`. Since the JMX SSL Config can also leverage it as per CASSANDRA-18508, password file // support is not added to the JMX SSL configuration via the system properties. Hence, `null` is used as // the password file arguments for the keystore and the truststore while constructing the encryption options here. - EncryptionOptions encryptionOptions = new EncryptionOptions(new ParameterizedClass("org.apache.cassandra.security.DefaultSslContextFactory", new HashMap<>()), + + EncryptionOptions.ClientEncryptionOptions encryptionOptions = new EncryptionOptions.ClientEncryptionOptions(new ParameterizedClass("org.apache.cassandra.security.DefaultSslContextFactory", new HashMap<>()), keystore, keystorePassword, null, diff --git a/src/java/org/apache/cassandra/db/AbstractReadQuery.java b/src/java/org/apache/cassandra/db/AbstractReadQuery.java index 448069cfca10..2e72c7ec4fc5 100644 --- a/src/java/org/apache/cassandra/db/AbstractReadQuery.java +++ b/src/java/org/apache/cassandra/db/AbstractReadQuery.java @@ -118,4 +118,16 @@ public String toCQLString() } protected abstract void appendCQLWhereClause(StringBuilder sb); + + @Override + public String monitoredOnKeyspace() + { + return metadata().keyspace; + } + + @Override + public String monitoredOnTable() + { + return metadata().name; + } } \ No newline at end of file diff --git a/src/java/org/apache/cassandra/db/monitoring/Monitorable.java b/src/java/org/apache/cassandra/db/monitoring/Monitorable.java index 10bd10438aa5..4288a667de3f 100644 --- a/src/java/org/apache/cassandra/db/monitoring/Monitorable.java +++ b/src/java/org/apache/cassandra/db/monitoring/Monitorable.java @@ -20,6 +20,8 @@ public interface Monitorable { + Monitorable NO_OP = new NoOp(); + String name(); long creationTimeNanos(); long timeoutNanos(); @@ -33,4 +35,76 @@ public interface Monitorable boolean abort(); boolean complete(); + + default String monitoredOnKeyspace() { return null; }; + default String monitoredOnTable() { return null; }; + + class NoOp implements Monitorable + { + @Override + public String name() + { + return null; + } + + @Override + public long creationTimeNanos() + { + return 0; + } + + @Override + public long timeoutNanos() + { + return 0; + } + + @Override + public long slowTimeoutNanos() + { + return 0; + } + + @Override + public boolean isInProgress() + { + return false; + } + + @Override + public boolean isAborted() + { + return false; + } + + @Override + public boolean isCompleted() + { + return false; + } + + @Override + public boolean isSlow() + { + return false; + } + + @Override + public boolean isCrossNode() + { + return false; + } + + @Override + public boolean abort() + { + return false; + } + + @Override + public boolean complete() + { + return false; + } + } } diff --git a/src/java/org/apache/cassandra/db/monitoring/MonitoringTask.java b/src/java/org/apache/cassandra/db/monitoring/MonitoringTask.java index 243569910b8a..4d6d995c77bf 100644 --- a/src/java/org/apache/cassandra/db/monitoring/MonitoringTask.java +++ b/src/java/org/apache/cassandra/db/monitoring/MonitoringTask.java @@ -19,6 +19,7 @@ package org.apache.cassandra.db.monitoring; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -32,9 +33,19 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.type.TypeReference; import org.apache.cassandra.concurrent.ScheduledExecutors; import org.apache.cassandra.config.CassandraRelevantProperties; +import org.apache.cassandra.utils.Clock; +import org.apache.cassandra.utils.JsonUtils; import org.apache.cassandra.utils.NoSpamLogger; +import org.apache.cassandra.utils.logging.LoggingSupport; +import org.apache.cassandra.utils.logging.LoggingSupportFactory; +import org.apache.cassandra.utils.logging.SlowQueriesAppender; import static java.util.concurrent.TimeUnit.NANOSECONDS; import static org.apache.cassandra.config.CassandraRelevantProperties.MONITORING_MAX_OPERATIONS; @@ -47,8 +58,9 @@ * We also log timed out operations, see CASSANDRA-7392. * Since CASSANDRA-12403 we also log queries that were slow. */ -class MonitoringTask +public class MonitoringTask { + private static final String SLOW_OPERATIONS_LOGGER_NAME = "slow_queries"; private static final String LINE_SEPARATOR = CassandraRelevantProperties.LINE_SEPARATOR.getString(); private static final Logger logger = LoggerFactory.getLogger(MonitoringTask.class); private static final NoSpamLogger noSpamLogger = NoSpamLogger.getLogger(logger, 5L, TimeUnit.MINUTES); @@ -70,6 +82,8 @@ class MonitoringTask private final ScheduledFuture reportingTask; private final OperationsQueue failedOperationsQueue; private final OperationsQueue slowOperationsQueue; + private Logger slowOperationsLogger = logger; + private boolean slowOperationsLoggedToVirtualTable; private long approxLastLogTimeNanos; @@ -97,6 +111,15 @@ private MonitoringTask(int reportIntervalMillis, int maxOperations) reportIntervalMillis, reportIntervalMillis, TimeUnit.MILLISECONDS); + + LoggingSupport support = LoggingSupportFactory.getLoggingSupport(); + if (support.getLogger(SLOW_OPERATIONS_LOGGER_NAME).isPresent()) + { + if (support.getAppender(SlowQueriesAppender.class, SlowQueriesAppender.APPENDER_NAME).isPresent()) + slowOperationsLoggedToVirtualTable = true; + + slowOperationsLogger = LoggerFactory.getLogger(SLOW_OPERATIONS_LOGGER_NAME); + } } public void cancel() @@ -169,14 +192,30 @@ boolean logSlowOperations(long approxCurrentTimeNanos) if (!slowOperations.isEmpty()) { long approxElapsedNanos = approxCurrentTimeNanos - approxLastLogTimeNanos; - noSpamLogger.info("Some operations were slow, details available at debug level (debug.log)"); + noSpamLogger.info("Some operations were slow, details available at debug level (debug.log) or " + + "system_views.slow_queries virtual table (when enabled)."); + + if (slowOperationsLogger.isDebugEnabled()) + { + if (slowOperationsLoggedToVirtualTable) + { + // This is the crux of the patch for appending to vtable. + // Because we can send only Strings to debug method (or objects, on which toString() + // would be eventually called), we need to log a string in such a way that we can + // get Operation object(s) back "on the other side" when dealing with vtables and custom appenders + // as appenders work with LoggingEvent where message is just a string. + // It would be very hard / tricky / error-prone to parse customly crafted log message + // which appears in logs when no vtable appender is used. + slowOperationsLogger.debug(Operation.serialize(slowOperations.getOperations())); + } + else + slowOperationsLogger.debug("{} operations were slow in the last {} msecs:{}{}", + slowOperations.num(), + NANOSECONDS.toMillis(approxElapsedNanos), + LINE_SEPARATOR, + slowOperations.getLogMessage()); + } - if (logger.isDebugEnabled()) - logger.debug("{} operations were slow in the last {} msecs:{}{}", - slowOperations.num(), - NANOSECONDS.toMillis(approxElapsedNanos), - LINE_SEPARATOR, - slowOperations.getLogMessage()); return true; } return false; @@ -274,6 +313,12 @@ public long num() return operations.size() + numDropped; } + private Collection getOperations() + { + return operations.values(); + } + + @JsonIgnore String getLogMessage() { if (isEmpty()) @@ -307,9 +352,16 @@ private static void addOperation(StringBuilder ret, Operation operation) * same name (CQL query text) is reported and store the average, min and max * times. */ - protected abstract static class Operation + @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, property = "id") + @JsonSubTypes({ @JsonSubTypes.Type(value = SlowOperation.class) }) + @VisibleForTesting + public abstract static class Operation { + @JsonProperty + String id = getClass().getName(); + /** The operation that was reported as slow or timed out */ + @JsonIgnore final Monitorable operation; /** The number of times the operation was reported */ @@ -319,24 +371,50 @@ protected abstract static class Operation long totalTimeNanos; /** The maximum time spent by this operation */ - long maxTime; + long maxTimeNanos; /** The minimum time spent by this operation */ - long minTime; + long minTimeNanos; /** The name of the operation, i.e. the SELECT query CQL, * this is set lazily as it takes time to build the query CQL */ private String name; + /** + * creation time of this Operation object, in ms, + * this is different from operation's creationTimeNanos + * which does not follow wall clock and is useless for + * reporting purposes e.g. in virtual tables + */ + private final long timestampMs; + + // optional keyspace and table this operation acts on + // used upon deserialization + private String keyspace; + private String table; + private boolean crossNode; + Operation(Monitorable operation, long failedAtNanos) { this.operation = operation; numTimesReported = 1; totalTimeNanos = failedAtNanos - operation.creationTimeNanos(); - minTime = totalTimeNanos; - maxTime = totalTimeNanos; + minTimeNanos = totalTimeNanos; + maxTimeNanos = totalTimeNanos; + timestampMs = Clock.Global.currentTimeMillis() - (Clock.Global.nanoTime() - operation.creationTimeNanos()) / 1_000_000; + } + + void add(Operation operation) + { + numTimesReported++; + totalTimeNanos += operation.totalTimeNanos; + maxTimeNanos = Math.max(maxTimeNanos, operation.maxTimeNanos); + minTimeNanos = Math.min(minTimeNanos, operation.minTimeNanos); } + public abstract String getLogMessage(); + + @JsonProperty public String name() { if (name == null) @@ -344,15 +422,96 @@ public String name() return name; } - void add(Operation operation) + @JsonProperty + public String keyspace() { - numTimesReported++; - totalTimeNanos += operation.totalTimeNanos; - maxTime = Math.max(maxTime, operation.maxTime); - minTime = Math.min(minTime, operation.minTime); + if (operation != null) + { + String monitored = operation.monitoredOnKeyspace(); + if (monitored != null) + return monitored; + } + return keyspace; } - public abstract String getLogMessage(); + public void setKeyspace(String keyspace) + { + this.keyspace = keyspace; + } + + public void setTable(String table) + { + this.table = table; + } + + @JsonProperty + public String table() + { + if (operation != null) + { + String monitored = operation.monitoredOnTable(); + if (monitored != null) + return monitored; + } + return table; + } + + @JsonProperty + public boolean isCrossNode() + { + if (operation != null) + return operation.isCrossNode(); + + return crossNode; + } + + @JsonProperty + public int numTimesReported() + { + return numTimesReported; + } + + @JsonProperty + public long totalTimeNanos() + { + return totalTimeNanos; + } + + @JsonProperty + public long maxTimeNanos() + { + return maxTimeNanos; + } + + @JsonProperty + public long minTimeNanos() + { + return minTimeNanos; + } + + @JsonIgnore + public long averageTime() + { + return totalTimeNanos / numTimesReported; + } + + @JsonProperty + public long timestampMs() + { + return timestampMs; + } + + public static String serialize(Collection operations) + { + return JsonUtils.writeAsJsonString(operations); + } + + private static final TypeReference> TYPE_REFERENCE = new TypeReference<>() {}; + + public static List deserialize(String message) throws Throwable + { + return JsonUtils.JSON_OBJECT_MAPPER.readValue(message, TYPE_REFERENCE); + } } /** @@ -378,8 +537,8 @@ public String getLogMessage() name(), numTimesReported, NANOSECONDS.toMillis(totalTimeNanos / numTimesReported), - NANOSECONDS.toMillis(minTime), - NANOSECONDS.toMillis(maxTime), + NANOSECONDS.toMillis(minTimeNanos), + NANOSECONDS.toMillis(maxTimeNanos), NANOSECONDS.toMillis(operation.timeoutNanos()), operation.isCrossNode() ? "msec/cross-node" : "msec"); } @@ -388,13 +547,21 @@ public String getLogMessage() /** * An operation (query) that was reported as slow. */ - private final static class SlowOperation extends Operation + @VisibleForTesting + public final static class SlowOperation extends Operation { - SlowOperation(Monitorable operation, long failedAt) + // purely for deserialization purposes + public SlowOperation() + { + this(Monitorable.NO_OP, 0); + } + + public SlowOperation(Monitorable operation, long failedAt) { super(operation, failedAt); } + @JsonIgnore public String getLogMessage() { if (numTimesReported == 1) @@ -408,8 +575,8 @@ public String getLogMessage() name(), numTimesReported, NANOSECONDS.toMillis(totalTimeNanos/ numTimesReported), - NANOSECONDS.toMillis(minTime), - NANOSECONDS.toMillis(maxTime), + NANOSECONDS.toMillis(minTimeNanos), + NANOSECONDS.toMillis(maxTimeNanos), NANOSECONDS.toMillis(operation.slowTimeoutNanos()), operation.isCrossNode() ? "msec/cross-node" : "msec"); } diff --git a/src/java/org/apache/cassandra/db/virtual/AbstractLoggerVirtualTable.java b/src/java/org/apache/cassandra/db/virtual/AbstractLoggerVirtualTable.java new file mode 100644 index 000000000000..008d5d432a2b --- /dev/null +++ b/src/java/org/apache/cassandra/db/virtual/AbstractLoggerVirtualTable.java @@ -0,0 +1,111 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.cassandra.db.virtual; + +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + +import com.google.common.annotations.VisibleForTesting; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ch.qos.logback.classic.spi.LoggingEvent; +import org.apache.cassandra.schema.TableMetadata; + +/** + * This table is inherently limited on number of rows it can hold. + * + * @param type parameter saying what object is stored in internal bounded list for query purposes + */ +public abstract class AbstractLoggerVirtualTable extends AbstractMutableVirtualTable +{ + private static final Logger logger = LoggerFactory.getLogger(AbstractLoggerVirtualTable.class); + + // please be sure operations on this structure are thread-safe + protected final List buffer; + + @VisibleForTesting + protected static int resolveBufferSize(int wantedSize, int max, int defaultSize) + { + return (wantedSize < 1 || wantedSize > max) ? defaultSize : wantedSize; + } + + protected AbstractLoggerVirtualTable(TableMetadata metadata, int maxSize) + { + super(metadata); + this.buffer = BoundedLinkedList.create(maxSize); + logger.debug("capacity of virtual table {} is set to be at most {} rows", metadata().toString(), maxSize); + } + + public void add(LoggingEvent event) + { + List messages = getMessages(event); + if (messages != null) + { + // specifically calling buffer.add to reach BoundedLinkedList's add + // instead of linked list's addAll + for (U message : messages) + buffer.add(message); + } + } + + public abstract List getMessages(LoggingEvent event); + + @Override + public void truncate() + { + synchronized (buffer) + { + buffer.clear(); + } + } + + @Override + public boolean allowFilteringImplicitly() + { + return false; + } + + private static final class BoundedLinkedList extends LinkedList + { + private final int maxSize; + + public static List create(int size) + { + return Collections.synchronizedList(new BoundedLinkedList<>(size)); + } + + private BoundedLinkedList(int maxSize) + { + this.maxSize = maxSize; + } + + @Override + public synchronized boolean add(T t) + { + if (size() == maxSize) + removeLast(); + + addFirst(t); + + return true; + } + } +} diff --git a/src/java/org/apache/cassandra/db/virtual/LogMessagesTable.java b/src/java/org/apache/cassandra/db/virtual/LogMessagesTable.java index 5903ac2ab5f3..87978e3fd966 100644 --- a/src/java/org/apache/cassandra/db/virtual/LogMessagesTable.java +++ b/src/java/org/apache/cassandra/db/virtual/LogMessagesTable.java @@ -18,15 +18,11 @@ package org.apache.cassandra.db.virtual; -import java.util.Collections; import java.util.Date; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import com.google.common.annotations.VisibleForTesting; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import ch.qos.logback.classic.spi.LoggingEvent; import org.apache.cassandra.config.CassandraRelevantProperties; @@ -50,11 +46,8 @@ * @see CASSANDRA-18238 * @see org.apache.cassandra.utils.logging.VirtualTableAppender */ -public final class LogMessagesTable extends AbstractMutableVirtualTable +public final class LogMessagesTable extends AbstractLoggerVirtualTable { - private static final Logger logger = LoggerFactory.getLogger(LogMessagesTable.class); - - public static final int LOGS_VIRTUAL_TABLE_MIN_ROWS = 1000; public static final int LOGS_VIRTUAL_TABLE_DEFAULT_ROWS = 50_000; public static final int LOGS_VIRTUAL_TABLE_MAX_ROWS = 100_000; @@ -67,11 +60,11 @@ public final class LogMessagesTable extends AbstractMutableVirtualTable public static final String LEVEL_COLUMN_NAME = "level"; public static final String MESSAGE_COLUMN_NAME = "message"; - private final List buffer; - LogMessagesTable(String keyspace) { - this(keyspace, resolveBufferSize()); + this(keyspace, resolveBufferSize(CassandraRelevantProperties.LOGS_VIRTUAL_TABLE_MAX_ROWS.getInt(), + LOGS_VIRTUAL_TABLE_MAX_ROWS, + LOGS_VIRTUAL_TABLE_DEFAULT_ROWS)); } @VisibleForTesting @@ -85,10 +78,14 @@ public final class LogMessagesTable extends AbstractMutableVirtualTable .addClusteringColumn(ORDER_IN_MILLISECOND_COLUMN_NAME, Int32Type.instance) .addRegularColumn(LOGGER_COLUMN_NAME, UTF8Type.instance) .addRegularColumn(LEVEL_COLUMN_NAME, UTF8Type.instance) - .addRegularColumn(MESSAGE_COLUMN_NAME, UTF8Type.instance).build()); + .addRegularColumn(MESSAGE_COLUMN_NAME, UTF8Type.instance).build(), + size); + } - logger.debug("capacity of virtual table {} is set to be at most {} rows", metadata().toString(), size); - buffer = BoundedLinkedList.create(size); + @Override + public List getMessages(LoggingEvent event) + { + return List.of(event); } @Override @@ -103,12 +100,12 @@ public DataSet data() int index = 0; - Iterator iterator = buffer.listIterator(); + Iterator iterator = buffer.listIterator(); while (iterator.hasNext()) { - LogMessage log = iterator.next(); + LoggingEvent log = iterator.next(); - milliSecondsOfCurrentLog = log.timestamp; + milliSecondsOfCurrentLog = log.getTimeStamp(); if (milliSecondsOfPreviousLog == milliSecondsOfCurrentLog) ++index; else @@ -116,86 +113,13 @@ public DataSet data() milliSecondsOfPreviousLog = milliSecondsOfCurrentLog; - result.row(new Date(log.timestamp), index) - .column(LOGGER_COLUMN_NAME, log.logger) - .column(LEVEL_COLUMN_NAME, log.level) - .column(MESSAGE_COLUMN_NAME, log.message); + result.row(new Date(milliSecondsOfCurrentLog), index) + .column(LOGGER_COLUMN_NAME, log.getLoggerName()) + .column(LEVEL_COLUMN_NAME, log.getLevel().toString()) + .column(MESSAGE_COLUMN_NAME, log.getFormattedMessage()); } } return result; } - - public void add(LoggingEvent event) - { - buffer.add(new LogMessage(event)); - } - - @Override - public void truncate() - { - buffer.clear(); - } - - @Override - public boolean allowFilteringImplicitly() - { - return false; - } - - @VisibleForTesting - static int resolveBufferSize() - { - int size = CassandraRelevantProperties.LOGS_VIRTUAL_TABLE_MAX_ROWS.getInt(); - return (size < LOGS_VIRTUAL_TABLE_MIN_ROWS || size > LOGS_VIRTUAL_TABLE_MAX_ROWS) - ? LOGS_VIRTUAL_TABLE_DEFAULT_ROWS : size; - } - - @VisibleForTesting - public static class LogMessage - { - public final long timestamp; - public final String logger; - public final String level; - public final String message; - - public LogMessage(LoggingEvent event) - { - this(event.getTimeStamp(), event.getLoggerName(), event.getLevel().toString(), event.getFormattedMessage()); - } - - public LogMessage(long timestamp, String logger, String level, String message) - { - this.timestamp = timestamp; - this.logger = logger; - this.level = level; - this.message = message; - } - } - - private static final class BoundedLinkedList extends LinkedList - { - private final int maxSize; - - public static List create(int size) - { - return Collections.synchronizedList(new BoundedLinkedList<>(size)); - } - - private BoundedLinkedList(int maxSize) - { - this.maxSize = maxSize; - } - - @Override - public boolean add(T t) - { - if (size() == maxSize) - removeLast(); - - addFirst(t); - - return true; - } - } } diff --git a/src/java/org/apache/cassandra/db/virtual/SlowQueriesTable.java b/src/java/org/apache/cassandra/db/virtual/SlowQueriesTable.java new file mode 100644 index 000000000000..0d392d0ce27e --- /dev/null +++ b/src/java/org/apache/cassandra/db/virtual/SlowQueriesTable.java @@ -0,0 +1,195 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.cassandra.db.virtual; + +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +import com.google.common.annotations.VisibleForTesting; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ch.qos.logback.classic.spi.LoggingEvent; +import org.apache.cassandra.config.CassandraRelevantProperties; +import org.apache.cassandra.db.ColumnFamilyStore; +import org.apache.cassandra.db.DecoratedKey; +import org.apache.cassandra.db.Keyspace; +import org.apache.cassandra.db.marshal.BooleanType; +import org.apache.cassandra.db.marshal.Int32Type; +import org.apache.cassandra.db.marshal.LongType; +import org.apache.cassandra.db.marshal.TimestampType; +import org.apache.cassandra.db.marshal.UTF8Type; +import org.apache.cassandra.db.monitoring.MonitoringTask.Operation; +import org.apache.cassandra.dht.LocalPartitioner; +import org.apache.cassandra.schema.TableMetadata; + +import static java.util.concurrent.TimeUnit.NANOSECONDS; + +public class SlowQueriesTable extends AbstractLoggerVirtualTable +{ + private static final Logger logger = LoggerFactory.getLogger(SlowQueriesTable.class); + + public static final int LOGS_VIRTUAL_TABLE_DEFAULT_ROWS = 10_000; + public static final int LOGS_VIRTUAL_TABLE_MAX_ROWS = 100_000; + + public static final String TABLE_NAME = "slow_queries"; + private static final String TABLE_COMMENT = "Slow queries"; + + public static final String KEYSPACE_COLUMN_NAME = "keyspace_name"; + public static final String TABLE_COLUMN_NAME = "table_name"; + public static final String TIMESTAMP_COLUMN_NAME = "timestamp"; + public static final String QUERY_COLUMN_NAME = "query"; + public static final String MINIMUM_TIME_COLUMN_NAME = "min_ms"; + public static final String MAXIMUM_TIME_COLUMN_NAME = "max_ms"; + public static final String AVERAGE_TIME_COLUMN_NAME = "avg_ms"; + public static final String TIMES_REPORTED_COLUMN_NAME = "times_reported"; + public static final String CROSS_NODE_COLUMN_NAME = "cross_node"; + + SlowQueriesTable(String keyspace) + { + this(keyspace, resolveBufferSize(CassandraRelevantProperties.LOGS_SLOW_QUERIES_VIRTUAL_TABLE_MAX_ROWS.getInt(), + LOGS_VIRTUAL_TABLE_MAX_ROWS, + LOGS_VIRTUAL_TABLE_DEFAULT_ROWS)); + } + + @VisibleForTesting + SlowQueriesTable(String keyspace, int size) + { + super(TableMetadata.builder(keyspace, TABLE_NAME) + .comment(TABLE_COMMENT) + .kind(TableMetadata.Kind.VIRTUAL) + .partitioner(new LocalPartitioner(UTF8Type.instance)) + .addPartitionKeyColumn(KEYSPACE_COLUMN_NAME, UTF8Type.instance) + .addClusteringColumn(TABLE_COLUMN_NAME, UTF8Type.instance) + .addClusteringColumn(TIMESTAMP_COLUMN_NAME, TimestampType.instance) + // We are adding query as a clustering column for uniqueness, + // In theory, it might happen that two monitoring operations + // would be emitted for same keyspace, same table at the exact same time + // (in milliseconds). That means that one operation would "shadow" + // another one because primary key would be same for both. + // To make it truly unique, we include query among clustering keys + // as well. If queries were same, then they would be also reported so + // (it would be reflected in "times_reported" column) + .addClusteringColumn(QUERY_COLUMN_NAME, UTF8Type.instance) + .addRegularColumn(MINIMUM_TIME_COLUMN_NAME, LongType.instance) + .addRegularColumn(MAXIMUM_TIME_COLUMN_NAME, LongType.instance) + .addRegularColumn(AVERAGE_TIME_COLUMN_NAME, LongType.instance) + .addRegularColumn(TIMES_REPORTED_COLUMN_NAME, Int32Type.instance) + .addRegularColumn(CROSS_NODE_COLUMN_NAME, BooleanType.instance) + .build(), + size); + } + + @Override + protected void applyPartitionDeletion(ColumnValues partitionKey) + { + String keyspace = partitionKey.value(0); + + synchronized (buffer) + { + buffer.removeIf(o -> o.keyspace().equals(keyspace)); + } + } + + @Override + public DataSet data() + { + SimpleDataSet result = new SimpleDataSet(metadata(), DecoratedKey.comparator.reversed()); + + synchronized (buffer) + { + Iterator iterator = buffer.listIterator(); + while (iterator.hasNext()) + { + Operation operation = iterator.next(); + + result.row(operation.keyspace(), operation.table(), new Date(operation.timestampMs()), operation.name()) + .column(MINIMUM_TIME_COLUMN_NAME, NANOSECONDS.toMillis(operation.minTimeNanos())) + .column(MAXIMUM_TIME_COLUMN_NAME, NANOSECONDS.toMillis(operation.maxTimeNanos())) + .column(AVERAGE_TIME_COLUMN_NAME, NANOSECONDS.toMillis(operation.averageTime())) + .column(TIMES_REPORTED_COLUMN_NAME, operation.numTimesReported()) + .column(CROSS_NODE_COLUMN_NAME, operation.isCrossNode()); + } + } + + return result; + } + + @Override + public List getMessages(LoggingEvent event) + { + try + { + List qualified = new ArrayList<>(); + for (Operation operation : Operation.deserialize(event.getMessage())) + { + + // in (improbable) case there is an operation which does not have + // keyspace / table on it, we just skip this from processing + // as we would have nothing to show for partition key and clustering column + if (operation.keyspace() == null || operation.table() == null) + continue; + + // if cf of an operation is present, take keyspace and table name from it + // instead of having new string instances per operation which might + // take relatively a lot of additional space unnecessarily + Keyspace keyspace = Keyspace.openIfExists(operation.keyspace()); + String keyspaceName; + String tableName; + if (keyspace != null) + { + keyspaceName = keyspace.getName(); + try + { + ColumnFamilyStore table = keyspace.getColumnFamilyStore(operation.table()); + tableName = table.getTableName(); + } + catch (IllegalArgumentException ex) + { + tableName = operation.table(); + } + } + else + { + keyspaceName = operation.keyspace(); + tableName = operation.table(); + } + + operation.setKeyspace(keyspaceName); + operation.setTable(tableName); + qualified.add(operation); + } + + return qualified; + } + catch (Throwable t) + { + logger.trace("Unable to generate list of slow queries", t); + return null; + } + } + + @Override + public boolean allowFilteringImplicitly() + { + return true; + } +} diff --git a/src/java/org/apache/cassandra/db/virtual/SystemViewsKeyspace.java b/src/java/org/apache/cassandra/db/virtual/SystemViewsKeyspace.java index 3ca8f728a8b3..28c6dc8fef40 100644 --- a/src/java/org/apache/cassandra/db/virtual/SystemViewsKeyspace.java +++ b/src/java/org/apache/cassandra/db/virtual/SystemViewsKeyspace.java @@ -61,6 +61,7 @@ private SystemViewsKeyspace() .add(new GossipInfoTable(VIRTUAL_VIEWS)) .add(new QueriesTable(VIRTUAL_VIEWS)) .add(new LogMessagesTable(VIRTUAL_VIEWS)) + .add(new SlowQueriesTable(VIRTUAL_VIEWS)) .add(new SnapshotsTable(VIRTUAL_VIEWS)) .add(new PeersTable(VIRTUAL_VIEWS)) .add(new LocalTable(VIRTUAL_VIEWS)) diff --git a/src/java/org/apache/cassandra/net/InboundConnectionInitiator.java b/src/java/org/apache/cassandra/net/InboundConnectionInitiator.java index fd5710e29773..c4cbc50a2b2b 100644 --- a/src/java/org/apache/cassandra/net/InboundConnectionInitiator.java +++ b/src/java/org/apache/cassandra/net/InboundConnectionInitiator.java @@ -67,7 +67,7 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS; import static org.apache.cassandra.auth.IInternodeAuthenticator.InternodeConnectionDirection.INBOUND; import static org.apache.cassandra.concurrent.ExecutorFactory.Global.executorFactory; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; import static org.apache.cassandra.net.InternodeConnectionUtils.DISCARD_HANDLER_NAME; import static org.apache.cassandra.net.InternodeConnectionUtils.SSL_FACTORY_CONTEXT_DESCRIPTION; import static org.apache.cassandra.net.InternodeConnectionUtils.SSL_HANDLER_NAME; @@ -530,7 +530,7 @@ void setupMessagingPipeline(InetAddressAndPort from, int useMessagingVersion, in private static SslHandler getSslHandler(String description, Channel channel, EncryptionOptions.ServerEncryptionOptions encryptionOptions) throws IOException { - final EncryptionOptions.ClientAuth verifyPeerCertificate = REQUIRED; + final EncryptionOptions.ClientEncryptionOptions.ClientAuth verifyPeerCertificate = REQUIRED; SslContext sslContext = SSLFactory.getOrCreateSslContext(encryptionOptions, verifyPeerCertificate, ISslContextFactory.SocketType.SERVER, SSL_FACTORY_CONTEXT_DESCRIPTION); diff --git a/src/java/org/apache/cassandra/net/InboundConnectionSettings.java b/src/java/org/apache/cassandra/net/InboundConnectionSettings.java index 448da62cbb8c..4a9db7ca8112 100644 --- a/src/java/org/apache/cassandra/net/InboundConnectionSettings.java +++ b/src/java/org/apache/cassandra/net/InboundConnectionSettings.java @@ -146,7 +146,7 @@ public InboundConnectionSettings withLegacySslStoragePortDefaults() ServerEncryptionOptions encryption = this.encryption; if (encryption == null) encryption = DatabaseDescriptor.getInternodeMessagingEncyptionOptions(); - encryption = encryption.withOptional(false).withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all); + encryption = new ServerEncryptionOptions.Builder(encryption).withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all).withOptional(false).build(); return this.withBindAddress(bindAddress.withPort(DatabaseDescriptor.getSSLStoragePort())) .withEncryption(encryption) diff --git a/src/java/org/apache/cassandra/net/OutboundConnectionInitiator.java b/src/java/org/apache/cassandra/net/OutboundConnectionInitiator.java index 27e55f6105bf..2bddc174f2e8 100644 --- a/src/java/org/apache/cassandra/net/OutboundConnectionInitiator.java +++ b/src/java/org/apache/cassandra/net/OutboundConnectionInitiator.java @@ -66,9 +66,9 @@ import static java.util.concurrent.TimeUnit.*; import static org.apache.cassandra.auth.IInternodeAuthenticator.InternodeConnectionDirection.OUTBOUND; import static org.apache.cassandra.auth.IInternodeAuthenticator.InternodeConnectionDirection.OUTBOUND_PRECONNECT; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.NOT_REQUIRED; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.OPTIONAL; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.NOT_REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.OPTIONAL; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; import static org.apache.cassandra.net.InternodeConnectionUtils.DISCARD_HANDLER_NAME; import static org.apache.cassandra.net.InternodeConnectionUtils.SSL_FACTORY_CONTEXT_DESCRIPTION; import static org.apache.cassandra.net.InternodeConnectionUtils.SSL_HANDLER_NAME; @@ -245,7 +245,7 @@ public void initChannel(SocketChannel channel) throws Exception private SslContext getSslContext(SslFallbackConnectionType connectionType) throws IOException { - EncryptionOptions.ClientAuth requireClientAuth = NOT_REQUIRED; + EncryptionOptions.ClientEncryptionOptions.ClientAuth requireClientAuth = NOT_REQUIRED; if (connectionType == SslFallbackConnectionType.MTLS ) { requireClientAuth = REQUIRED; diff --git a/src/java/org/apache/cassandra/security/AbstractSslContextFactory.java b/src/java/org/apache/cassandra/security/AbstractSslContextFactory.java index c2a7fdb97510..0fc8f94352d8 100644 --- a/src/java/org/apache/cassandra/security/AbstractSslContextFactory.java +++ b/src/java/org/apache/cassandra/security/AbstractSslContextFactory.java @@ -37,8 +37,8 @@ import io.netty.handler.ssl.SslProvider; import org.apache.cassandra.config.EncryptionOptions; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.NOT_REQUIRED; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.NOT_REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; import static org.apache.cassandra.config.CassandraRelevantProperties.DISABLE_TCACTIVE_OPENSSL; @@ -68,7 +68,7 @@ abstract public class AbstractSslContextFactory implements ISslContextFactory protected final List accepted_protocols; protected final String algorithm; protected final String store_type; - protected final EncryptionOptions.ClientAuth clientAuth; + protected final EncryptionOptions.ClientEncryptionOptions.ClientAuth clientAuth; protected final boolean require_endpoint_verification; /* ServerEncryptionOptions does not use the enabled flag at all instead using the existing @@ -105,7 +105,7 @@ protected AbstractSslContextFactory(Map parameters) accepted_protocols = getStringList("accepted_protocols"); algorithm = getString("algorithm"); store_type = getString("store_type", "JKS"); - clientAuth = parameters.get("require_client_auth") == null ? NOT_REQUIRED : EncryptionOptions.ClientAuth.from(getString("require_client_auth")); + clientAuth = parameters.get("require_client_auth") == null ? NOT_REQUIRED : EncryptionOptions.ClientEncryptionOptions.ClientAuth.from(getString("require_client_auth")); require_endpoint_verification = getBoolean("require_endpoint_verification", false); enabled = getBoolean("enabled"); optional = getBoolean("optional"); @@ -158,7 +158,7 @@ public SSLContext createJSSESslContext(boolean verifyPeerCertificate) throws SSL } @Override - public SSLContext createJSSESslContext(EncryptionOptions.ClientAuth clientAuth) throws SSLException + public SSLContext createJSSESslContext(EncryptionOptions.ClientEncryptionOptions.ClientAuth clientAuth) throws SSLException { TrustManager[] trustManagers = null; if (clientAuth != NOT_REQUIRED) @@ -186,7 +186,7 @@ public SslContext createNettySslContext(boolean verifyPeerCertificate, SocketTyp } @Override - public SslContext createNettySslContext(EncryptionOptions.ClientAuth clientAuth, SocketType socketType, + public SslContext createNettySslContext(EncryptionOptions.ClientEncryptionOptions.ClientAuth clientAuth, SocketType socketType, CipherSuiteFilter cipherFilter) throws SSLException { /* @@ -291,7 +291,7 @@ protected SslProvider getSslProvider() */ abstract protected KeyManagerFactory buildOutboundKeyManagerFactory() throws SSLException; - private ClientAuth toNettyClientAuth(EncryptionOptions.ClientAuth clientAuth) + private ClientAuth toNettyClientAuth(EncryptionOptions.ClientEncryptionOptions.ClientAuth clientAuth) { switch (clientAuth) { diff --git a/src/java/org/apache/cassandra/security/ISslContextFactory.java b/src/java/org/apache/cassandra/security/ISslContextFactory.java index 1db5f579b16d..2f8b53d16694 100644 --- a/src/java/org/apache/cassandra/security/ISslContextFactory.java +++ b/src/java/org/apache/cassandra/security/ISslContextFactory.java @@ -72,7 +72,7 @@ public interface ISslContextFactory * @return JSSE's {@link SSLContext} * @throws SSLException in case the Ssl Context creation fails for some reason */ - default SSLContext createJSSESslContext(EncryptionOptions.ClientAuth clientAuth) throws SSLException + default SSLContext createJSSESslContext(EncryptionOptions.ClientEncryptionOptions.ClientAuth clientAuth) throws SSLException { switch (clientAuth) { @@ -112,7 +112,7 @@ SslContext createNettySslContext(boolean verifyPeerCertificate, SocketType socke * @return Netty's {@link SslContext} * @throws SSLException in case the Ssl Context creation fails for some reason */ - default SslContext createNettySslContext(EncryptionOptions.ClientAuth clientAuth, SocketType socketType, + default SslContext createNettySslContext(EncryptionOptions.ClientEncryptionOptions.ClientAuth clientAuth, SocketType socketType, CipherSuiteFilter cipherFilter) throws SSLException { switch (clientAuth) diff --git a/src/java/org/apache/cassandra/security/SSLFactory.java b/src/java/org/apache/cassandra/security/SSLFactory.java index a9b4be9d5c39..65a6dfa24f1a 100644 --- a/src/java/org/apache/cassandra/security/SSLFactory.java +++ b/src/java/org/apache/cassandra/security/SSLFactory.java @@ -47,7 +47,7 @@ import static org.apache.cassandra.config.CassandraRelevantProperties.DISABLE_TCACTIVE_OPENSSL; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; import static org.apache.cassandra.utils.LocalizeString.toLowerCaseLocalized; /** @@ -125,7 +125,7 @@ public static List tlsInstanceProtocolSubstitution() /** * Create a JSSE {@link SSLContext}. */ - public static SSLContext createSSLContext(EncryptionOptions options, EncryptionOptions.ClientAuth clientAuth) throws IOException + public static SSLContext createSSLContext(EncryptionOptions options, EncryptionOptions.ClientEncryptionOptions.ClientAuth clientAuth) throws IOException { return options.sslContextFactoryInstance.createJSSESslContext(clientAuth); } @@ -133,7 +133,7 @@ public static SSLContext createSSLContext(EncryptionOptions options, EncryptionO /** * get a netty {@link SslContext} instance */ - public static SslContext getOrCreateSslContext(EncryptionOptions options, EncryptionOptions.ClientAuth clientAuth, + public static SslContext getOrCreateSslContext(EncryptionOptions options, EncryptionOptions.ClientEncryptionOptions.ClientAuth clientAuth, SocketType socketType, String contextDescription) throws IOException { @@ -157,7 +157,7 @@ public static SslContext getOrCreateSslContext(EncryptionOptions options, Encryp /** * Create a Netty {@link SslContext} */ - static SslContext createNettySslContext(EncryptionOptions options, EncryptionOptions.ClientAuth clientAuth, + static SslContext createNettySslContext(EncryptionOptions options, EncryptionOptions.ClientEncryptionOptions.ClientAuth clientAuth, SocketType socketType) throws IOException { return createNettySslContext(options, clientAuth, socketType, @@ -167,7 +167,7 @@ static SslContext createNettySslContext(EncryptionOptions options, EncryptionOpt /** * Create a Netty {@link SslContext} with a supplied cipherFilter */ - static SslContext createNettySslContext(EncryptionOptions options, EncryptionOptions.ClientAuth clientAuth, + static SslContext createNettySslContext(EncryptionOptions options, EncryptionOptions.ClientEncryptionOptions.ClientAuth clientAuth, SocketType socketType, CipherSuiteFilter cipherFilter) throws IOException { return options.sslContextFactoryInstance.createNettySslContext(clientAuth, socketType, @@ -356,7 +356,7 @@ private static boolean filterOutSSLv2Hello(String string) return !string.equals("SSLv2Hello"); } - public static void validateSslContext(String contextDescription, EncryptionOptions options, EncryptionOptions.ClientAuth clientAuth, boolean logProtocolAndCiphers) throws IOException + public static void validateSslContext(String contextDescription, EncryptionOptions options, EncryptionOptions.ClientEncryptionOptions.ClientAuth clientAuth, boolean logProtocolAndCiphers) throws IOException { if (options != null && options.tlsEncryptionPolicy() != EncryptionOptions.TlsEncryptionPolicy.UNENCRYPTED) { diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java b/src/java/org/apache/cassandra/service/CassandraDaemon.java index d3c787d2e2db..171ec47e1e68 100644 --- a/src/java/org/apache/cassandra/service/CassandraDaemon.java +++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java @@ -59,6 +59,8 @@ import org.apache.cassandra.db.SystemKeyspaceMigrator41; import org.apache.cassandra.db.commitlog.CommitLog; import org.apache.cassandra.db.virtual.AccordDebugKeyspace; +import org.apache.cassandra.db.virtual.LogMessagesTable; +import org.apache.cassandra.db.virtual.SlowQueriesTable; import org.apache.cassandra.db.virtual.SystemViewsKeyspace; import org.apache.cassandra.db.virtual.VirtualKeyspace; import org.apache.cassandra.db.virtual.VirtualKeyspaceRegistry; @@ -94,6 +96,7 @@ import org.apache.cassandra.utils.concurrent.Future; import org.apache.cassandra.utils.concurrent.FutureCombiner; import org.apache.cassandra.utils.logging.LoggingSupportFactory; +import org.apache.cassandra.utils.logging.SlowQueriesAppender; import org.apache.cassandra.utils.logging.VirtualTableAppender; import static java.util.concurrent.TimeUnit.NANOSECONDS; @@ -436,7 +439,6 @@ public void runStartupChecks() { exitOrFail(e.returnCode, e.getMessage(), e.getCause()); } - } /** @@ -555,11 +557,17 @@ public void setupVirtualKeyspaces() if (DatabaseDescriptor.getAccord().enable_virtual_debug_only_keyspace) VirtualKeyspaceRegistry.instance.register(AccordDebugKeyspace.instance); - // flush log messages to system_views.system_logs virtual table as there were messages already logged - // before that virtual table was instantiated + // Flush log messages to system_views.system_logs virtual table as there were messages already logged + // before that virtual table was instantiated. + // In general, there is no need to do same treatment for slow queries as by the time queries are processed + // the logging framework if fully setup already but for the sake of it and to be sure, just do it as well. LoggingSupportFactory.getLoggingSupport() .getAppender(VirtualTableAppender.class, VirtualTableAppender.APPENDER_NAME) - .ifPresent(appender -> ((VirtualTableAppender) appender).flushBuffer()); + .ifPresent(appender -> appender.flushBuffer(LogMessagesTable.class, LogMessagesTable.TABLE_NAME)); + + LoggingSupportFactory.getLoggingSupport() + .getAppender(SlowQueriesAppender.class, SlowQueriesAppender.APPENDER_NAME) + .ifPresent(appender -> appender.flushBuffer(SlowQueriesTable.class, SlowQueriesTable.TABLE_NAME)); } public synchronized void initializeClientTransports() diff --git a/src/java/org/apache/cassandra/tools/BulkLoader.java b/src/java/org/apache/cassandra/tools/BulkLoader.java index ecd6a5d31b70..92ccbb96be7c 100644 --- a/src/java/org/apache/cassandra/tools/BulkLoader.java +++ b/src/java/org/apache/cassandra/tools/BulkLoader.java @@ -48,7 +48,7 @@ import org.apache.cassandra.utils.NativeSSTableLoaderClient; import org.apache.cassandra.utils.OutputHandler; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; import static org.apache.cassandra.utils.Clock.Global.nanoTime; public class BulkLoader diff --git a/src/java/org/apache/cassandra/tools/LoaderOptions.java b/src/java/org/apache/cassandra/tools/LoaderOptions.java index c3d2072ff437..a68fb012eb0b 100644 --- a/src/java/org/apache/cassandra/tools/LoaderOptions.java +++ b/src/java/org/apache/cassandra/tools/LoaderOptions.java @@ -52,7 +52,7 @@ import org.apache.cassandra.tools.BulkLoader.CmdLineOptions; import static org.apache.cassandra.config.DataRateSpec.DataRateUnit.MEBIBYTES_PER_SECOND; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; public class LoaderOptions { @@ -121,7 +121,7 @@ public class LoaderOptions public final int entireSSTableInterDcThrottleMebibytes; public final int storagePort; public final int sslStoragePort; - public final EncryptionOptions clientEncOptions; + public final EncryptionOptions.ClientEncryptionOptions clientEncOptions; public final int connectionsPerHost; public final EncryptionOptions.ServerEncryptionOptions serverEncOptions; public final Set hosts; @@ -172,9 +172,11 @@ static class Builder int storagePort; int sslStoragePort; - EncryptionOptions clientEncOptions = new EncryptionOptions(); + EncryptionOptions.ClientEncryptionOptions clientEncOptions = new EncryptionOptions.ClientEncryptionOptions(); + EncryptionOptions.ClientEncryptionOptions.Builder clientEncOptionsBuilder = new EncryptionOptions.ClientEncryptionOptions.Builder(clientEncOptions); int connectionsPerHost = 1; EncryptionOptions.ServerEncryptionOptions serverEncOptions = new EncryptionOptions.ServerEncryptionOptions(); + EncryptionOptions.ServerEncryptionOptions.Builder serverEncOptionsBuilder = new EncryptionOptions.ServerEncryptionOptions.Builder(serverEncOptions); Set hostsArg = new HashSet<>(); Set ignoresArg = new HashSet<>(); Set hosts = new HashSet<>(); @@ -333,9 +335,10 @@ public Builder sslStoragePort(int sslStoragePort) return this; } - public Builder encOptions(EncryptionOptions encOptions) + public Builder encOptions(EncryptionOptions.ClientEncryptionOptions encOptions) { this.clientEncOptions = encOptions; + this.clientEncOptionsBuilder = new EncryptionOptions.ClientEncryptionOptions.Builder(encOptions); return this; } @@ -348,6 +351,7 @@ public Builder connectionsPerHost(int connectionsPerHost) public Builder serverEncOptions(EncryptionOptions.ServerEncryptionOptions serverEncOptions) { this.serverEncOptions = serverEncOptions; + this.serverEncOptionsBuilder = new EncryptionOptions.ServerEncryptionOptions.Builder(serverEncOptions); return this; } @@ -551,9 +555,10 @@ public Builder parseArgs(String cmdArgs[]) "which is able to handle encrypted communication too."); // Copy the encryption options and apply the config so that argument parsing can accesss isEnabled. - clientEncOptions = config.client_encryption_options.applyConfig(); - serverEncOptions = config.server_encryption_options; - serverEncOptions.applyConfig(); + clientEncOptionsBuilder = new EncryptionOptions.ClientEncryptionOptions.Builder(config.client_encryption_options); + clientEncOptions = clientEncOptionsBuilder.build(); + serverEncOptionsBuilder = new EncryptionOptions.ServerEncryptionOptions.Builder(config.server_encryption_options); + serverEncOptions = serverEncOptionsBuilder.build(); if (cmd.hasOption(NATIVE_PORT_OPTION)) nativePort = Integer.parseInt(cmd.getOptionValue(NATIVE_PORT_OPTION)); @@ -625,51 +630,53 @@ public Builder parseArgs(String cmdArgs[]) if (cmd.hasOption(SSL_TRUSTSTORE) || cmd.hasOption(SSL_TRUSTSTORE_PW) || cmd.hasOption(SSL_KEYSTORE) || cmd.hasOption(SSL_KEYSTORE_PW)) { - clientEncOptions = clientEncOptions.withEnabled(true); + clientEncOptionsBuilder.withEnabled(true); } if (cmd.hasOption(SSL_TRUSTSTORE)) { - clientEncOptions = clientEncOptions.withTrustStore(cmd.getOptionValue(SSL_TRUSTSTORE)); + clientEncOptionsBuilder.withTrustStore(cmd.getOptionValue(SSL_TRUSTSTORE)); } if (cmd.hasOption(SSL_TRUSTSTORE_PW)) { - clientEncOptions = clientEncOptions.withTrustStorePassword(cmd.getOptionValue(SSL_TRUSTSTORE_PW)); + clientEncOptionsBuilder.withTrustStorePassword(cmd.getOptionValue(SSL_TRUSTSTORE_PW)); } if (cmd.hasOption(SSL_KEYSTORE)) { // if a keystore was provided, lets assume we'll need to use - clientEncOptions = clientEncOptions.withKeyStore(cmd.getOptionValue(SSL_KEYSTORE)) + clientEncOptionsBuilder.withKeyStore(cmd.getOptionValue(SSL_KEYSTORE)) .withRequireClientAuth(REQUIRED); } if (cmd.hasOption(SSL_KEYSTORE_PW)) { - clientEncOptions = clientEncOptions.withKeyStorePassword(cmd.getOptionValue(SSL_KEYSTORE_PW)); + clientEncOptionsBuilder.withKeyStorePassword(cmd.getOptionValue(SSL_KEYSTORE_PW)); } if (cmd.hasOption(SSL_PROTOCOL)) { - clientEncOptions = clientEncOptions.withProtocol(cmd.getOptionValue(SSL_PROTOCOL)); + clientEncOptionsBuilder.withProtocol(cmd.getOptionValue(SSL_PROTOCOL)); } if (cmd.hasOption(SSL_ALGORITHM)) { - clientEncOptions = clientEncOptions.withAlgorithm(cmd.getOptionValue(SSL_ALGORITHM)); + clientEncOptionsBuilder.withAlgorithm(cmd.getOptionValue(SSL_ALGORITHM)); } if (cmd.hasOption(SSL_STORE_TYPE)) { - clientEncOptions = clientEncOptions.withStoreType(cmd.getOptionValue(SSL_STORE_TYPE)); + clientEncOptionsBuilder.withStoreType(cmd.getOptionValue(SSL_STORE_TYPE)); } if (cmd.hasOption(SSL_CIPHER_SUITES)) { - clientEncOptions = clientEncOptions.withCipherSuites(cmd.getOptionValue(SSL_CIPHER_SUITES).split(",")); + clientEncOptionsBuilder.withCipherSuites(cmd.getOptionValue(SSL_CIPHER_SUITES).split(",")); } + clientEncOptions = clientEncOptionsBuilder.build(); + if (cmd.hasOption(TARGET_KEYSPACE)) { targetKeyspace = cmd.getOptionValue(TARGET_KEYSPACE); diff --git a/src/java/org/apache/cassandra/transport/Client.java b/src/java/org/apache/cassandra/transport/Client.java index 96fea832a857..6c60f6508c16 100644 --- a/src/java/org/apache/cassandra/transport/Client.java +++ b/src/java/org/apache/cassandra/transport/Client.java @@ -45,9 +45,9 @@ public class Client extends SimpleClient { private final SimpleEventHandler eventHandler = new SimpleEventHandler(); - public Client(String host, int port, ProtocolVersion version, EncryptionOptions encryptionOptions) + public Client(String host, int port, ProtocolVersion version, EncryptionOptions.ClientEncryptionOptions encryptionOptions) { - super(host, port, version, version.isBeta(), new EncryptionOptions(encryptionOptions).applyConfig()); + super(host, port, version, version.isBeta(), encryptionOptions.applyConfig()); setEventHandler(eventHandler); } @@ -260,7 +260,7 @@ public static void main(String[] args) throws Exception int port = Integer.parseInt(args[1]); ProtocolVersion version = args.length == 3 ? ProtocolVersion.decode(Integer.parseInt(args[2]), DatabaseDescriptor.getNativeTransportAllowOlderProtocols()) : ProtocolVersion.CURRENT; - EncryptionOptions encryptionOptions = new EncryptionOptions().applyConfig(); + EncryptionOptions.ClientEncryptionOptions encryptionOptions = new EncryptionOptions.ClientEncryptionOptions().applyConfig(); System.out.println("CQL binary protocol console " + host + "@" + port + " using native protocol version " + version); try (Client client = new Client(host, port, version, encryptionOptions)) diff --git a/src/java/org/apache/cassandra/transport/SimpleClient.java b/src/java/org/apache/cassandra/transport/SimpleClient.java index f86b128be0ff..dea3535757f6 100644 --- a/src/java/org/apache/cassandra/transport/SimpleClient.java +++ b/src/java/org/apache/cassandra/transport/SimpleClient.java @@ -74,7 +74,7 @@ public class SimpleClient implements Closeable public final String host; public final int port; - private final EncryptionOptions encryptionOptions; + private final EncryptionOptions.ClientEncryptionOptions encryptionOptions; private final int largeMessageThreshold; protected final ResponseHandler responseHandler = new ResponseHandler(); @@ -92,7 +92,7 @@ public static class Builder { private final String host; private final int port; - private EncryptionOptions encryptionOptions = new EncryptionOptions(); + private EncryptionOptions.ClientEncryptionOptions encryptionOptions = new EncryptionOptions.ClientEncryptionOptions(); private ProtocolVersion version = ProtocolVersion.CURRENT; private boolean useBeta = false; private int largeMessageThreshold = FrameEncoder.Payload.MAX_SIZE; @@ -103,7 +103,7 @@ private Builder(String host, int port) this.port = port; } - public Builder encryption(EncryptionOptions options) + public Builder encryption(EncryptionOptions.ClientEncryptionOptions options) { this.encryptionOptions = options; return this; @@ -149,22 +149,22 @@ private SimpleClient(Builder builder) this.largeMessageThreshold = builder.largeMessageThreshold; } - public SimpleClient(String host, int port, ProtocolVersion version, EncryptionOptions encryptionOptions) + public SimpleClient(String host, int port, ProtocolVersion version, EncryptionOptions.ClientEncryptionOptions encryptionOptions) { this(host, port, version, false, encryptionOptions); } - public SimpleClient(String host, int port, EncryptionOptions encryptionOptions) + public SimpleClient(String host, int port, EncryptionOptions.ClientEncryptionOptions encryptionOptions) { this(host, port, ProtocolVersion.CURRENT, encryptionOptions); } public SimpleClient(String host, int port, ProtocolVersion version) { - this(host, port, version, new EncryptionOptions()); + this(host, port, version, new EncryptionOptions.ClientEncryptionOptions()); } - public SimpleClient(String host, int port, ProtocolVersion version, boolean useBeta, EncryptionOptions encryptionOptions) + public SimpleClient(String host, int port, ProtocolVersion version, boolean useBeta, EncryptionOptions.ClientEncryptionOptions encryptionOptions) { this.host = host; this.port = port; @@ -172,7 +172,7 @@ public SimpleClient(String host, int port, ProtocolVersion version, boolean useB throw new IllegalArgumentException(String.format("Beta version of server used (%s), but USE_BETA flag is not set", version)); this.version = version; - this.encryptionOptions = new EncryptionOptions(encryptionOptions).applyConfig(); + this.encryptionOptions = encryptionOptions.applyConfig(); this.largeMessageThreshold = FrameEncoder.Payload.MAX_SIZE - Math.max(FrameEncoderCrc.HEADER_AND_TRAILER_LENGTH, FrameEncoderLZ4.HEADER_AND_TRAILER_LENGTH); @@ -180,7 +180,7 @@ public SimpleClient(String host, int port, ProtocolVersion version, boolean useB public SimpleClient(String host, int port) { - this(host, port, new EncryptionOptions()); + this(host, port, new EncryptionOptions.ClientEncryptionOptions()); } public SimpleClient connect(boolean useCompression) throws IOException diff --git a/src/java/org/apache/cassandra/utils/jmx/AbstractJmxSocketFactory.java b/src/java/org/apache/cassandra/utils/jmx/AbstractJmxSocketFactory.java index 3990c64ee7d4..ef68f524861e 100644 --- a/src/java/org/apache/cassandra/utils/jmx/AbstractJmxSocketFactory.java +++ b/src/java/org/apache/cassandra/utils/jmx/AbstractJmxSocketFactory.java @@ -82,7 +82,7 @@ public Map configure(InetAddress serverAddress, JMXServerOptions.setJmxSystemProperties(jmxEncryptionOptions.getAcceptedProtocols(), jmxEncryptionOptions.getCipherSuites()); logger.info("Enabling JMX SSL using jmx_encryption_options"); - boolean requireClientAuth = jmxEncryptionOptions.getClientAuth() == EncryptionOptions.ClientAuth.REQUIRED; + boolean requireClientAuth = jmxEncryptionOptions.getClientAuth() == EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; String[] ciphers = jmxEncryptionOptions.cipherSuitesArray(); String[] protocols = jmxEncryptionOptions.acceptedProtocolsArray(); SSLContext sslContext = jmxEncryptionOptions.sslContextFactoryInstance.createJSSESslContext(jmxEncryptionOptions.getClientAuth()); diff --git a/src/java/org/apache/cassandra/utils/logging/AbstractVirtualTableAppender.java b/src/java/org/apache/cassandra/utils/logging/AbstractVirtualTableAppender.java new file mode 100644 index 000000000000..7becbc13fcd5 --- /dev/null +++ b/src/java/org/apache/cassandra/utils/logging/AbstractVirtualTableAppender.java @@ -0,0 +1,144 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.cassandra.utils.logging; + +import java.util.LinkedList; +import java.util.List; +import java.util.Optional; + +import ch.qos.logback.classic.spi.LoggingEvent; +import ch.qos.logback.core.AppenderBase; +import org.apache.cassandra.db.virtual.AbstractLoggerVirtualTable; +import org.apache.cassandra.db.virtual.SlowQueriesTable; +import org.apache.cassandra.db.virtual.VirtualKeyspace; +import org.apache.cassandra.db.virtual.VirtualKeyspaceRegistry; +import org.apache.cassandra.db.virtual.VirtualTable; + +import static org.apache.cassandra.schema.SchemaConstants.VIRTUAL_VIEWS; + +public abstract class AbstractVirtualTableAppender extends AppenderBase +{ + private final int defaultRows; + + protected AbstractVirtualTableAppender(int defaultRows) + { + this.defaultRows = defaultRows; + } + + // for holding messages until virtual registry contains logs virtual table + // as it takes some time during startup of a node to initialise virtual tables but messages are + // logged already + protected final List messageBuffer = new LinkedList<>(); + + protected T getVirtualTable(Class vtableClass, String tableName) + { + VirtualKeyspace keyspace = VirtualKeyspaceRegistry.instance.getKeyspaceNullable(VIRTUAL_VIEWS); + + if (keyspace == null) + return null; + + Optional virtualTable = keyspace.tables() + .stream() + .filter(vt -> vt.name().equals(tableName)) + .findFirst(); + + if (virtualTable.isEmpty()) + return null; + + VirtualTable vt = virtualTable.get(); + + if (!vt.getClass().equals(vtableClass)) + throw new IllegalStateException(String.format("Virtual table %s.%s is not backed by an instance of %s but by %s", + VIRTUAL_VIEWS, + tableName, + vtableClass.getName(), + vt.getClass().getName())); + + return (T) vt; + } + + /** + * This method adds an event to virtual table, when present. + * When vtable is null, we will attempt to find it among registered ones. Then not found, we add it to internal + * buffer for later processing. This might happen e.g. for logging tables when log events + * were appended via logging framework sooner than registration of virtual tables was done so after they are registered, + * they would miss logging events happened before being so. + * + * @param vtable vtable to append to + * @param event event to append to + * @param tableName table name of virtual table to append to + * @return vtable or when null, found vtable + */ + protected AbstractLoggerVirtualTable appendToVirtualTable(AbstractLoggerVirtualTable vtable, LoggingEvent event, String tableName) + { + AbstractLoggerVirtualTable foundVtable; + if (vtable == null) + { + foundVtable = getVirtualTable(SlowQueriesTable.class, tableName); + if (foundVtable == null) + addToBuffer(event); + else + foundVtable.add(event); + } + else + { + foundVtable = vtable; + vtable.add(event); + } + + return foundVtable; + } + + @Override + public void stop() + { + synchronized (messageBuffer) + { + messageBuffer.clear(); + super.stop(); + } + } + + /** + * Flushes all log entries which were appended before virtual table was registered. + * + * @see org.apache.cassandra.service.CassandraDaemon#setupVirtualKeyspaces + */ + public void flushBuffer(Class> vtableClass, String tableName) + { + synchronized (messageBuffer) + { + Optional.ofNullable(getVirtualTable(vtableClass, tableName)).ifPresent(vtable -> { + messageBuffer.forEach(vtable::add); + messageBuffer.clear(); + }); + } + } + + protected void addToBuffer(LoggingEvent eventObject) + { + synchronized (messageBuffer) + { + // we restrict how many logging events we can put into buffer, + // so we are not growing without any bound when things go south + if (messageBuffer.size() < defaultRows) + messageBuffer.add(eventObject); + } + } +} diff --git a/src/java/org/apache/cassandra/utils/logging/LogbackLoggingSupport.java b/src/java/org/apache/cassandra/utils/logging/LogbackLoggingSupport.java index e710d44dd1dc..f32963b73a59 100644 --- a/src/java/org/apache/cassandra/utils/logging/LogbackLoggingSupport.java +++ b/src/java/org/apache/cassandra/utils/logging/LogbackLoggingSupport.java @@ -60,7 +60,8 @@ public class LogbackLoggingSupport implements LoggingSupport @Override public void onStartup() { - checkOnlyOneVirtualTableAppender(); + checkOnlyOneVirtualTableAppender(VirtualTableAppender.class); + checkOnlyOneVirtualTableAppender(SlowQueriesAppender.class); // The default logback configuration in conf/logback.xml allows reloading the // configuration when the configuration file has changed (every 60 seconds by default). @@ -138,7 +139,20 @@ public Map getLoggingLevels() } @Override - public Optional> getAppender(Class appenderClass, String name) + public Optional getLogger(String loggerName) + { + LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); + for (Logger logBackLogger : lc.getLoggerList()) + { + if (logBackLogger.getName().equals(loggerName)) + return Optional.of(logBackLogger); + } + + return Optional.empty(); + } + + @Override + public > Optional getAppender(Class appenderClass, String appenderName) { LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); for (Logger logBackLogger : lc.getLoggerList()) @@ -146,15 +160,15 @@ public Optional> getAppender(Class appenderClass, String name) for (Iterator> iterator = logBackLogger.iteratorForAppenders(); iterator.hasNext();) { Appender appender = iterator.next(); - if (appender.getClass() == appenderClass && appender.getName().equals(name)) - return Optional.of(appender); + if (appender.getClass() == appenderClass && appender.getName().equals(appenderName)) + return Optional.of(appenderClass.cast(appender)); } } return Optional.empty(); } - private void checkOnlyOneVirtualTableAppender() + private void checkOnlyOneVirtualTableAppender(Class appenderClass) { int count = 0; LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); @@ -164,7 +178,7 @@ private void checkOnlyOneVirtualTableAppender() for (Iterator> iterator = logBackLogger.iteratorForAppenders(); iterator.hasNext();) { Appender appender = iterator.next(); - if (appender instanceof VirtualTableAppender) + if (appenderClass.isAssignableFrom(appender.getClass())) { virtualAppenderNames.add(appender.getName()); count += 1; @@ -174,7 +188,7 @@ private void checkOnlyOneVirtualTableAppender() if (count > 1) throw new IllegalStateException(String.format("There are multiple appenders of class %s of names %s. There is only one appender of such class allowed.", - VirtualTableAppender.class.getName(), String.join(",", virtualAppenderNames))); + appenderClass.getName(), String.join(",", virtualAppenderNames))); } private boolean hasAppenders(Logger logBackLogger) diff --git a/src/java/org/apache/cassandra/utils/logging/LoggingSupport.java b/src/java/org/apache/cassandra/utils/logging/LoggingSupport.java index 35e11975f922..00b40cb966de 100644 --- a/src/java/org/apache/cassandra/utils/logging/LoggingSupport.java +++ b/src/java/org/apache/cassandra/utils/logging/LoggingSupport.java @@ -21,6 +21,7 @@ import java.util.Map; import java.util.Optional; +import ch.qos.logback.classic.Logger; import ch.qos.logback.core.Appender; /** @@ -53,7 +54,12 @@ default void onShutdown() {} */ Map getLoggingLevels(); - default Optional> getAppender(Class appenderClass, String appenderName) + default > Optional getAppender(Class appenderClass, String appenderName) + { + return Optional.empty(); + } + + default Optional getLogger(String loggerName) { return Optional.empty(); } diff --git a/src/java/org/apache/cassandra/utils/logging/SlowQueriesAppender.java b/src/java/org/apache/cassandra/utils/logging/SlowQueriesAppender.java new file mode 100644 index 000000000000..4af2e383077b --- /dev/null +++ b/src/java/org/apache/cassandra/utils/logging/SlowQueriesAppender.java @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.cassandra.utils.logging; + +import ch.qos.logback.classic.spi.LoggingEvent; +import org.apache.cassandra.db.virtual.AbstractLoggerVirtualTable; +import org.apache.cassandra.db.virtual.SlowQueriesTable; + +public final class SlowQueriesAppender extends AbstractVirtualTableAppender +{ + public static final String APPENDER_NAME = "SLOW_QUERIES_APPENDER"; + + private AbstractLoggerVirtualTable slowQueries; + + public SlowQueriesAppender() + { + super(SlowQueriesTable.LOGS_VIRTUAL_TABLE_DEFAULT_ROWS); + } + + @Override + protected void append(LoggingEvent eventObject) + { + // slowQueries will be null as long as virtual tables + // are not registered, and we already try to put queries there. + // As soon as vtable is registered (as part of node's startup / initialisation), + // slow queries will never be null again + slowQueries = appendToVirtualTable(slowQueries, eventObject, SlowQueriesTable.TABLE_NAME); + } +} diff --git a/src/java/org/apache/cassandra/utils/logging/VirtualTableAppender.java b/src/java/org/apache/cassandra/utils/logging/VirtualTableAppender.java index 2820b2936f4a..03a142004afd 100644 --- a/src/java/org/apache/cassandra/utils/logging/VirtualTableAppender.java +++ b/src/java/org/apache/cassandra/utils/logging/VirtualTableAppender.java @@ -18,111 +18,35 @@ package org.apache.cassandra.utils.logging; -import java.util.LinkedList; -import java.util.List; -import java.util.Optional; import java.util.Set; import com.google.common.collect.ImmutableSet; import ch.qos.logback.classic.spi.LoggingEvent; -import ch.qos.logback.core.AppenderBase; import org.apache.cassandra.audit.FileAuditLogger; +import org.apache.cassandra.db.virtual.AbstractLoggerVirtualTable; import org.apache.cassandra.db.virtual.LogMessagesTable; -import org.apache.cassandra.db.virtual.VirtualKeyspace; -import org.apache.cassandra.db.virtual.VirtualKeyspaceRegistry; -import org.apache.cassandra.db.virtual.VirtualTable; - -import static org.apache.cassandra.db.virtual.LogMessagesTable.LOGS_VIRTUAL_TABLE_DEFAULT_ROWS; -import static org.apache.cassandra.db.virtual.LogMessagesTable.TABLE_NAME; -import static org.apache.cassandra.schema.SchemaConstants.VIRTUAL_VIEWS; /** * Appends Cassandra logs to virtual table system_views.system_logs */ -public final class VirtualTableAppender extends AppenderBase +public final class VirtualTableAppender extends AbstractVirtualTableAppender { public static final String APPENDER_NAME = "CQLLOG"; private static final Set forbiddenLoggers = ImmutableSet.of(FileAuditLogger.class.getName()); - private LogMessagesTable logs; - - // for holding messages until virtual registry contains logs virtual table - // as it takes some time during startup of a node to initialise virtual tables but messages are - // logged already - private final List messageBuffer = new LinkedList<>(); + private AbstractLoggerVirtualTable logs; - @Override - protected void append(LoggingEvent eventObject) + public VirtualTableAppender() { - if (!forbiddenLoggers.contains(eventObject.getLoggerName())) - { - if (logs == null) - { - logs = getVirtualTable(); - if (logs == null) - addToBuffer(eventObject); - else - logs.add(eventObject); - } - else - logs.add(eventObject); - } + super(LogMessagesTable.LOGS_VIRTUAL_TABLE_DEFAULT_ROWS); } @Override - public void stop() - { - messageBuffer.clear(); - super.stop(); - } - - /** - * Flushes all logs which were appended before virtual table was registered. - * - * @see org.apache.cassandra.service.CassandraDaemon#setupVirtualKeyspaces - */ - public void flushBuffer() - { - Optional.ofNullable(getVirtualTable()).ifPresent(vtable -> { - messageBuffer.forEach(vtable::add); - messageBuffer.clear(); - }); - } - - private LogMessagesTable getVirtualTable() - { - VirtualKeyspace keyspace = VirtualKeyspaceRegistry.instance.getKeyspaceNullable(VIRTUAL_VIEWS); - - if (keyspace == null) - return null; - - Optional logsTable = keyspace.tables() - .stream() - .filter(vt -> vt.name().equals(TABLE_NAME)) - .findFirst(); - - if (!logsTable.isPresent()) - return null; - - VirtualTable vt = logsTable.get(); - - if (!(vt instanceof LogMessagesTable)) - throw new IllegalStateException(String.format("Virtual table %s.%s is not backed by an instance of %s but by %s", - VIRTUAL_VIEWS, - TABLE_NAME, - LogMessagesTable.class.getName(), - vt.getClass().getName())); - - return (LogMessagesTable) vt; - } - - private void addToBuffer(LoggingEvent eventObject) + protected void append(LoggingEvent eventObject) { - // we restrict how many logging events we can put into buffer, - // so we are not growing without any bound when things go south - if (messageBuffer.size() < LOGS_VIRTUAL_TABLE_DEFAULT_ROWS) - messageBuffer.add(eventObject); + if (!forbiddenLoggers.contains(eventObject.getLoggerName())) + logs = appendToVirtualTable(logs, eventObject, LogMessagesTable.TABLE_NAME); } } diff --git a/test/burn/org/apache/cassandra/transport/SimpleClientBurnTest.java b/test/burn/org/apache/cassandra/transport/SimpleClientBurnTest.java index ed3406d8bc04..3247051197ae 100644 --- a/test/burn/org/apache/cassandra/transport/SimpleClientBurnTest.java +++ b/test/burn/org/apache/cassandra/transport/SimpleClientBurnTest.java @@ -138,11 +138,11 @@ public int encodedSize(QueryMessage queryMessage, ProtocolVersion version) Arrays.asList( () -> new SimpleClient(address.getHostAddress(), port, ProtocolVersion.V5, true, - new EncryptionOptions()) + new EncryptionOptions.ClientEncryptionOptions()) .connect(false), () -> new SimpleClient(address.getHostAddress(), port, ProtocolVersion.V4, false, - new EncryptionOptions()) + new EncryptionOptions.ClientEncryptionOptions()) .connect(false) ); diff --git a/test/burn/org/apache/cassandra/transport/SimpleClientPerfTest.java b/test/burn/org/apache/cassandra/transport/SimpleClientPerfTest.java index 4417b7cb8957..ca5adfff02da 100644 --- a/test/burn/org/apache/cassandra/transport/SimpleClientPerfTest.java +++ b/test/burn/org/apache/cassandra/transport/SimpleClientPerfTest.java @@ -102,7 +102,7 @@ public void measureSmall() throws Throwable new SizeCaps(10, 20, 5, 10), () -> new SimpleClient(address.getHostAddress(), port, version, true, - new EncryptionOptions()) + new EncryptionOptions.ClientEncryptionOptions()) .connect(false), version); } @@ -114,7 +114,7 @@ public void measureSmallWithCompression() throws Throwable new SizeCaps(10, 20, 5, 10), () -> new SimpleClient(address.getHostAddress(), port, version, true, - new EncryptionOptions()) + new EncryptionOptions.ClientEncryptionOptions()) .connect(true), version); } @@ -126,7 +126,7 @@ public void measureLarge() throws Throwable new SizeCaps(1000, 2000, 5, 150), () -> new SimpleClient(address.getHostAddress(), port, version, true, - new EncryptionOptions()) + new EncryptionOptions.ClientEncryptionOptions()) .connect(false), version); } @@ -138,7 +138,7 @@ public void measureLargeWithCompression() throws Throwable new SizeCaps(1000, 2000, 5, 150), () -> new SimpleClient(address.getHostAddress(), port, version, true, - new EncryptionOptions()) + new EncryptionOptions.ClientEncryptionOptions()) .connect(true), version); } diff --git a/test/conf/logback-dtest_with_slow_query_appender.xml b/test/conf/logback-dtest_with_slow_query_appender.xml new file mode 100644 index 000000000000..1b6ed7511f32 --- /dev/null +++ b/test/conf/logback-dtest_with_slow_query_appender.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + ./build/test/logs/${cassandra.testtag}/${suitename}/${cluster_id}/${instance_id}/system.log + + %-5level [%thread] ${instance_id} %date{ISO8601} %msg%n + + true + + + + + %-5level %date{HH:mm:ss,SSS} %msg%n + + + WARN + + + + + + %-5level [%thread] ${instance_id} %date{ISO8601} %F:%L - %msg%n + + + DEBUG + + + + + + + + + + + + + + + diff --git a/test/conf/logback-dtest_with_slow_query_appender_invalid.xml b/test/conf/logback-dtest_with_slow_query_appender_invalid.xml new file mode 100644 index 000000000000..a2252dd23a79 --- /dev/null +++ b/test/conf/logback-dtest_with_slow_query_appender_invalid.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + ./build/test/logs/${cassandra.testtag}/${suitename}/${cluster_id}/${instance_id}/system.log + + %-5level [%thread] ${instance_id} %date{ISO8601} %msg%n + + true + + + + + %-5level %date{HH:mm:ss,SSS} %msg%n + + + WARN + + + + + + %-5level [%thread] ${instance_id} %date{ISO8601} %F:%L - %msg%n + + + DEBUG + + + + + + + + + INFO + + + + + + + + + + + + + + + + diff --git a/test/distributed/org/apache/cassandra/distributed/impl/IsolatedJmx.java b/test/distributed/org/apache/cassandra/distributed/impl/IsolatedJmx.java index 59e9e8ca04de..7ad57a52b6b4 100644 --- a/test/distributed/org/apache/cassandra/distributed/impl/IsolatedJmx.java +++ b/test/distributed/org/apache/cassandra/distributed/impl/IsolatedJmx.java @@ -94,7 +94,7 @@ public void startJmx() // CASSANDRA-18508: Sensitive JMX SSL configuration options can be easily exposed Map jmxServerOptionsMap = (Map) config.getParams().get("jmx_server_options"); - EncryptionOptions jmxEncryptionOptions; + EncryptionOptions.ClientEncryptionOptions jmxEncryptionOptions; if (jmxServerOptionsMap == null) { JMXServerOptions parsingSystemProperties = JMXServerOptions.createParsingSystemProperties(); @@ -175,7 +175,7 @@ public void setupMBeanWrapper() * @return EncryptionOptions built object */ @SuppressWarnings("unchecked") - private EncryptionOptions getJmxEncryptionOptions(Map jmxServerOptionsMap) + private EncryptionOptions.ClientEncryptionOptions getJmxEncryptionOptions(Map jmxServerOptionsMap) { if (jmxServerOptionsMap == null) return null; @@ -186,34 +186,34 @@ private EncryptionOptions getJmxEncryptionOptions(Map jmxServerO { return null; } - EncryptionOptions jmxEncryptionOptions = new EncryptionOptions(); + EncryptionOptions.ClientEncryptionOptions.Builder jmxEncryptionOptionsBuilder = new EncryptionOptions.ClientEncryptionOptions.Builder(); String[] cipherSuitesArray = (String[]) encryptionOptionsMap.get(EncryptionOptions.ConfigKey.CIPHER_SUITES.toString()); if (cipherSuitesArray != null) { - jmxEncryptionOptions = jmxEncryptionOptions.withCipherSuites(cipherSuitesArray); + jmxEncryptionOptionsBuilder.withCipherSuites(cipherSuitesArray); } List acceptedProtocols = (List) encryptionOptionsMap.get(EncryptionOptions.ConfigKey.ACCEPTED_PROTOCOLS.toString()); if (acceptedProtocols != null) { - jmxEncryptionOptions = jmxEncryptionOptions.withAcceptedProtocols(acceptedProtocols); + jmxEncryptionOptionsBuilder.withAcceptedProtocols(acceptedProtocols); } Boolean requireClientAuthValue = (Boolean) encryptionOptionsMap.get(EncryptionOptions.ConfigKey.REQUIRE_CLIENT_AUTH.toString()); - EncryptionOptions.ClientAuth requireClientAuth = requireClientAuthValue == null ? - EncryptionOptions.ClientAuth.NOT_REQUIRED : - EncryptionOptions.ClientAuth.from(String.valueOf(requireClientAuthValue)); + EncryptionOptions.ClientEncryptionOptions.ClientAuth requireClientAuth = requireClientAuthValue == null ? + EncryptionOptions.ClientEncryptionOptions.ClientAuth.NOT_REQUIRED : + EncryptionOptions.ClientEncryptionOptions.ClientAuth.from(String.valueOf(requireClientAuthValue)); Object enabledOption = encryptionOptionsMap.get(EncryptionOptions.ConfigKey.ENABLED.toString()); boolean enabled = enabledOption != null ? (Boolean) encryptionOptionsMap.get(EncryptionOptions.ConfigKey.ENABLED.toString()) : false; //CASSANDRA-18508 NOTE - We do not populate sslContextFactory configuration here for tests, it could be enhanced - jmxEncryptionOptions = jmxEncryptionOptions - .withKeyStore((String) encryptionOptionsMap.get(EncryptionOptions.ConfigKey.KEYSTORE.toString())) - .withKeyStorePassword((String) encryptionOptionsMap.get(EncryptionOptions.ConfigKey.KEYSTORE_PASSWORD.toString())) - .withTrustStore((String) encryptionOptionsMap.get(EncryptionOptions.ConfigKey.TRUSTSTORE.toString())) - .withTrustStorePassword((String) encryptionOptionsMap.get(EncryptionOptions.ConfigKey.TRUSTSTORE_PASSWORD.toString())) - .withRequireClientAuth(requireClientAuth) - .withEnabled(enabled); - return jmxEncryptionOptions; + return jmxEncryptionOptionsBuilder + .withKeyStore((String) encryptionOptionsMap.get(EncryptionOptions.ConfigKey.KEYSTORE.toString())) + .withKeyStorePassword((String) encryptionOptionsMap.get(EncryptionOptions.ConfigKey.KEYSTORE_PASSWORD.toString())) + .withTrustStore((String) encryptionOptionsMap.get(EncryptionOptions.ConfigKey.TRUSTSTORE.toString())) + .withTrustStorePassword((String) encryptionOptionsMap.get(EncryptionOptions.ConfigKey.TRUSTSTORE_PASSWORD.toString())) + .withRequireClientAuth(requireClientAuth) + .withEnabled(enabled) + .build(); } private void waitForJmxAvailability(Map env) diff --git a/test/distributed/org/apache/cassandra/distributed/test/AbstractEncryptionOptionsImpl.java b/test/distributed/org/apache/cassandra/distributed/test/AbstractEncryptionOptionsImpl.java index 25e9e64b6326..7c3b91127ae0 100644 --- a/test/distributed/org/apache/cassandra/distributed/test/AbstractEncryptionOptionsImpl.java +++ b/test/distributed/org/apache/cassandra/distributed/test/AbstractEncryptionOptionsImpl.java @@ -56,7 +56,7 @@ import org.apache.cassandra.security.SSLFactory; import static java.util.concurrent.TimeUnit.SECONDS; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; import static org.apache.cassandra.distributed.test.AbstractEncryptionOptionsImpl.ConnectResult.CONNECTING; import static org.apache.cassandra.distributed.test.AbstractEncryptionOptionsImpl.ConnectResult.UNINITIALIZED; import static org.apache.cassandra.utils.concurrent.Condition.newOneTimeCondition; @@ -118,10 +118,13 @@ public class TlsConnection final int port; final List acceptedProtocols; final List cipherSuites; - final EncryptionOptions encryptionOptions = new EncryptionOptions() - .withEnabled(true) - .withKeyStore(validKeyStorePath).withKeyStorePassword(validKeyStorePassword) - .withTrustStore(validTrustStorePath).withTrustStorePassword(validTrustStorePassword); + final EncryptionOptions.ClientEncryptionOptions encryptionOptions = new EncryptionOptions.ClientEncryptionOptions.Builder() + .withEnabled(true) + .withKeyStore(validKeyStorePath) + .withKeyStorePassword(validKeyStorePassword) + .withTrustStore(validTrustStorePath) + .withTrustStorePassword(validTrustStorePassword) + .build(); private Throwable lastThrowable; private String lastProtocol; private String lastCipher; @@ -202,7 +205,7 @@ ConnectResult connect() throws Throwable setProtocolAndCipher(null, null); SslContext sslContext = SSLFactory.getOrCreateSslContext( - encryptionOptions.withAcceptedProtocols(acceptedProtocols).withCipherSuites(cipherSuites), + new EncryptionOptions.ClientEncryptionOptions.Builder(encryptionOptions).withAcceptedProtocols(acceptedProtocols).withCipherSuites(cipherSuites).build(), REQUIRED, ISslContextFactory.SocketType.CLIENT, "test"); EventLoopGroup workerGroup = new NioEventLoopGroup(); diff --git a/test/distributed/org/apache/cassandra/distributed/test/AbstractVirtualLogsTableTest.java b/test/distributed/org/apache/cassandra/distributed/test/AbstractVirtualLogsTableTest.java new file mode 100644 index 000000000000..c8bb32fe7280 --- /dev/null +++ b/test/distributed/org/apache/cassandra/distributed/test/AbstractVirtualLogsTableTest.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.cassandra.distributed.test; + +import org.junit.Ignore; + +import static java.lang.String.format; + +@Ignore +public abstract class AbstractVirtualLogsTableTest extends TestBaseImpl +{ + public String query(String template) + { + return format(template, getTableName()); + } + + public abstract String getTableName(); +} diff --git a/test/distributed/org/apache/cassandra/distributed/test/SlowQueriesAppenderTest.java b/test/distributed/org/apache/cassandra/distributed/test/SlowQueriesAppenderTest.java new file mode 100644 index 000000000000..d8b6b3f00f40 --- /dev/null +++ b/test/distributed/org/apache/cassandra/distributed/test/SlowQueriesAppenderTest.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.cassandra.distributed.test; + +import org.junit.Test; + +import org.apache.cassandra.db.virtual.SlowQueriesTable; +import org.apache.cassandra.distributed.Cluster; +import org.apache.cassandra.distributed.Constants; +import org.apache.cassandra.distributed.api.Feature; +import org.apache.cassandra.distributed.shared.WithProperties; +import org.apache.cassandra.schema.SchemaConstants; +import org.apache.cassandra.utils.logging.SlowQueriesAppender; + +import static java.lang.String.format; +import static org.apache.cassandra.config.CassandraRelevantProperties.LOGBACK_CONFIGURATION_FILE; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +/** + * It is inherently tricky / flaky to make some queries to be slow so we just test + * the invalid configuration otherwise the table as such is tested in {@link org.apache.cassandra.db.virtual.SlowQueriesTableTest}. + */ +public class SlowQueriesAppenderTest extends AbstractVirtualLogsTableTest +{ + @Test + public void testMultipleAppendersFailToStartNode() throws Throwable + { + LOGBACK_CONFIGURATION_FILE.setString("test/conf/logback-dtest_with_slow_query_appender_invalid.xml"); + + // NOTE: Because cluster startup is expected to fail in this case, and can leave things in a weird state + // for the next state, create without starting, and set failure as shutdown to false, + // so the try-with-resources can close instances properly. + try (WithProperties properties = new WithProperties().set(LOGBACK_CONFIGURATION_FILE, "test/conf/logback-dtest_with_slow_query_appender_invalid.xml"); + Cluster cluster = Cluster.build(1) + .withConfig(c -> c.with(Feature.values()) + .set(Constants.KEY_DTEST_API_STARTUP_FAILURE_AS_SHUTDOWN, false)) + .createWithoutStarting()) + { + cluster.startup(); + fail("Node should not start as there is supposed to be invalid logback configuration file."); + } + catch (IllegalStateException ex) + { + assertEquals(format("There are multiple appenders of class %s " + + "of names SLOW_QUERIES_APPENDER,SLOW_QUERIES_APPENDER_2. There is only one appender of such class allowed.", + SlowQueriesAppender.class.getName()), + ex.getMessage()); + } + } + + @Override + public String getTableName() + { + return format("%s.%s", SchemaConstants.VIRTUAL_VIEWS, SlowQueriesTable.TABLE_NAME); + } +} diff --git a/test/distributed/org/apache/cassandra/distributed/test/SlowQueryDeserTest.java b/test/distributed/org/apache/cassandra/distributed/test/SlowQueryDeserTest.java new file mode 100644 index 000000000000..ae5bcc966cf1 --- /dev/null +++ b/test/distributed/org/apache/cassandra/distributed/test/SlowQueryDeserTest.java @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.cassandra.distributed.test; + +import java.util.Collection; +import java.util.List; + +import org.junit.Test; + +import org.apache.cassandra.db.monitoring.MonitorableImpl; +import org.apache.cassandra.db.monitoring.MonitoringTask; +import org.apache.cassandra.db.monitoring.MonitoringTask.SlowOperation; +import org.apache.cassandra.utils.Clock; + +public class SlowQueryDeserTest +{ + @Test + public void testSlowQueryDeser() throws Throwable + { + SlowOperation slowOperation = new SlowOperation(new MonitorableImpl() + { + @Override + public String name() + { + return String.format("select * from %s.%s where id = 5", monitoredOnKeyspace(), monitoredOnTable()); + } + + @Override + public String monitoredOnKeyspace() + { + return "ks"; + } + + @Override + public String monitoredOnTable() + { + return "tb"; + } + + @Override + public boolean isCrossNode() + { + return true; + } + }, Clock.Global.currentTimeMillis()); + + String serialize = MonitoringTask.Operation.serialize(List.of(slowOperation)); + Collection deserialize = MonitoringTask.Operation.deserialize(serialize); + } +} diff --git a/test/distributed/org/apache/cassandra/distributed/test/VirtualTableLogsTest.java b/test/distributed/org/apache/cassandra/distributed/test/VirtualTableLogsTest.java index 71ef4dbe7899..bf9f58123e83 100644 --- a/test/distributed/org/apache/cassandra/distributed/test/VirtualTableLogsTest.java +++ b/test/distributed/org/apache/cassandra/distributed/test/VirtualTableLogsTest.java @@ -25,7 +25,6 @@ import ch.qos.logback.classic.Level; import org.apache.cassandra.db.virtual.LogMessagesTable; -import org.apache.cassandra.db.virtual.LogMessagesTable.LogMessage; import org.apache.cassandra.distributed.Cluster; import org.apache.cassandra.distributed.Constants; import org.apache.cassandra.distributed.api.Feature; @@ -47,8 +46,14 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -public class VirtualTableLogsTest extends TestBaseImpl +public class VirtualTableLogsTest extends AbstractVirtualLogsTableTest { + @Override + public String getTableName() + { + return format("%s.%s", SchemaConstants.VIRTUAL_VIEWS, LogMessagesTable.TABLE_NAME); + } + @Test public void testVTableOutput() throws Throwable { @@ -56,9 +61,9 @@ public void testVTableOutput() throws Throwable Cluster cluster = Cluster.build(1) .withConfig(c -> c.with(Feature.values())) .start(); - ) + ) { - List rows = getRows(cluster); + List rows = getRows(cluster); assertFalse(rows.isEmpty()); rows.forEach(message -> assertTrue(Level.toLevel(message.level).isGreaterOrEqual(Level.INFO))); @@ -91,39 +96,36 @@ public void testMultipleAppendersFailToStartNode() throws Throwable } } - private List getRows(Cluster cluster) + private List getRows(Cluster cluster) { SimpleQueryResult simpleQueryResult = cluster.coordinator(1).executeWithResult(query("select * from %s"), ONE); - List rows = new ArrayList<>(); + List rows = new ArrayList<>(); simpleQueryResult.forEachRemaining(row -> { long timestamp = row.getTimestamp(TIMESTAMP_COLUMN_NAME).getTime(); String logger = row.getString(LOGGER_COLUMN_NAME); String level = row.getString(LEVEL_COLUMN_NAME); String message = row.getString(MESSAGE_COLUMN_NAME); int order = row.getInteger(ORDER_IN_MILLISECOND_COLUMN_NAME); - TestingLogMessage logMessage = new TestingLogMessage(timestamp, logger, level, message, order); + LogMessage logMessage = new LogMessage(timestamp, logger, level, message, order); rows.add(logMessage); }); return rows; } - private String query(String template) - { - return format(template, getTableName()); - } - - private String getTableName() - { - return format("%s.%s", SchemaConstants.VIRTUAL_VIEWS, LogMessagesTable.TABLE_NAME); - } - - private static class TestingLogMessage extends LogMessage + private static class LogMessage { - private int order; + public final long timestamp; + public final String logger; + public final String level; + public final String message; + public final int order; - public TestingLogMessage(long timestamp, String logger, String level, String message, int order) + public LogMessage(long timestamp, String logger, String level, String message, int order) { - super(timestamp, logger, level, message); + this.timestamp = timestamp; + this.logger = logger; + this.level = level; + this.message = message; this.order = order; } } diff --git a/test/unit/org/apache/cassandra/auth/AuthConfigTest.java b/test/unit/org/apache/cassandra/auth/AuthConfigTest.java index b9bde913be05..580c48eb9f8f 100644 --- a/test/unit/org/apache/cassandra/auth/AuthConfigTest.java +++ b/test/unit/org/apache/cassandra/auth/AuthConfigTest.java @@ -30,6 +30,7 @@ import org.apache.cassandra.config.Config; import org.apache.cassandra.config.DatabaseDescriptor; +import org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions.Builder; import org.apache.cassandra.config.ParameterizedClass; import org.apache.cassandra.locator.InetAddressAndPort; import org.apache.cassandra.utils.MBeanWrapper; @@ -52,8 +53,10 @@ public void testNewInstanceForMutualTlsInternodeAuthenticator() throws IOExcepti Config config = load("cassandra-mtls.yaml"); config.internode_authenticator.class_name = "org.apache.cassandra.auth.MutualTlsInternodeAuthenticator"; config.internode_authenticator.parameters = Collections.singletonMap("validator_class_name", "org.apache.cassandra.auth.SpiffeCertificateValidator"); - config.server_encryption_options = config.server_encryption_options.withOutboundKeystore("test/conf/cassandra_ssl_test_outbound.keystore") - .withOutboundKeystorePassword("cassandra"); + config.server_encryption_options = new Builder(config.server_encryption_options) + .withOutboundKeystore("test/conf/cassandra_ssl_test_outbound.keystore") + .withOutboundKeystorePassword("cassandra") + .build(); DatabaseDescriptor.setConfig(config); MutualTlsInternodeAuthenticator authenticator = ParameterizedClass.newInstance(config.internode_authenticator, Arrays.asList("", "org.apache.cassandra.auth.")); diff --git a/test/unit/org/apache/cassandra/auth/MutualTlsAuthenticatorTest.java b/test/unit/org/apache/cassandra/auth/MutualTlsAuthenticatorTest.java index 14b31a3c87bc..88e44cf0ab5b 100644 --- a/test/unit/org/apache/cassandra/auth/MutualTlsAuthenticatorTest.java +++ b/test/unit/org/apache/cassandra/auth/MutualTlsAuthenticatorTest.java @@ -48,7 +48,7 @@ import static org.apache.cassandra.auth.AuthTestUtils.getMockInetAddress; import static org.apache.cassandra.auth.AuthTestUtils.initializeIdentityRolesTable; import static org.apache.cassandra.auth.AuthTestUtils.loadCertificateChain; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; @@ -79,8 +79,10 @@ public static void setup() StorageService.instance.initServer(); ((CassandraRoleManager)DatabaseDescriptor.getRoleManager()).loadIdentityStatement(); final Config config = DatabaseDescriptor.getRawConfig(); - config.client_encryption_options = config.client_encryption_options.withEnabled(true) - .withRequireClientAuth(REQUIRED); + config.client_encryption_options = new EncryptionOptions.ClientEncryptionOptions.Builder(config.client_encryption_options) + .withEnabled(true) + .withRequireClientAuth(REQUIRED) + .build(); } @After @@ -183,8 +185,10 @@ public void testValidateConfiguration() " & client_encryption_options.require_client_auth to be true"; MutualTlsAuthenticator mutualTlsAuthenticator = createAndInitializeMtlsAuthenticator(); - config.client_encryption_options = config.client_encryption_options.withEnabled(true) - .withRequireClientAuth(EncryptionOptions.ClientAuth.NOT_REQUIRED); + config.client_encryption_options = new EncryptionOptions.ClientEncryptionOptions.Builder(config.client_encryption_options) + .withEnabled(true) + .withRequireClientAuth(EncryptionOptions.ClientEncryptionOptions.ClientAuth.NOT_REQUIRED) + .build(); expectedException.expect(ConfigurationException.class); expectedException.expectMessage(msg); mutualTlsAuthenticator.validateConfiguration(); diff --git a/test/unit/org/apache/cassandra/auth/MutualTlsInternodeAuthenticatorTest.java b/test/unit/org/apache/cassandra/auth/MutualTlsInternodeAuthenticatorTest.java index 8fdd23a44411..94fe66133bef 100644 --- a/test/unit/org/apache/cassandra/auth/MutualTlsInternodeAuthenticatorTest.java +++ b/test/unit/org/apache/cassandra/auth/MutualTlsInternodeAuthenticatorTest.java @@ -39,6 +39,7 @@ import org.apache.cassandra.SchemaLoader; import org.apache.cassandra.config.Config; import org.apache.cassandra.config.DatabaseDescriptor; +import org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions.Builder; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.locator.InetAddressAndPort; import org.apache.cassandra.transport.TlsTestUtils; @@ -81,8 +82,10 @@ public static void initialize() public void before() { Config config = DatabaseDescriptor.getRawConfig(); - config.server_encryption_options = config.server_encryption_options.withOutboundKeystore("test/conf/cassandra_ssl_test_outbound.keystore") - .withOutboundKeystorePassword("cassandra"); + config.server_encryption_options = new Builder(config.server_encryption_options) + .withOutboundKeystore("test/conf/cassandra_ssl_test_outbound.keystore") + .withOutboundKeystorePassword("cassandra") + .build(); } String getValidatorClass() @@ -164,8 +167,10 @@ public void testNoValidatorClassNameInConfig() public void testNoIdentitiesInKeystore() { Config config = DatabaseDescriptor.getRawConfig(); - config.server_encryption_options = config.server_encryption_options.withOutboundKeystore(TlsTestUtils.SERVER_KEYSTORE_PATH) - .withOutboundKeystorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD); + config.server_encryption_options = new Builder(config.server_encryption_options) + .withOutboundKeystore(TlsTestUtils.SERVER_KEYSTORE_PATH) + .withOutboundKeystorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) + .build(); expectedException.expect(ConfigurationException.class); expectedException.expectMessage(String.format("No identity was extracted from the outbound keystore '%s'", TlsTestUtils.SERVER_KEYSTORE_PATH)); new MutualTlsInternodeAuthenticator(getParams()); diff --git a/test/unit/org/apache/cassandra/auth/MutualTlsWithPasswordFallbackAuthenticatorTest.java b/test/unit/org/apache/cassandra/auth/MutualTlsWithPasswordFallbackAuthenticatorTest.java index 95f7c133eab8..f0c642846b3b 100644 --- a/test/unit/org/apache/cassandra/auth/MutualTlsWithPasswordFallbackAuthenticatorTest.java +++ b/test/unit/org/apache/cassandra/auth/MutualTlsWithPasswordFallbackAuthenticatorTest.java @@ -50,8 +50,10 @@ public static void initialize() DatabaseDescriptor.daemonInitialization(); SchemaLoader.loadSchema(); Config config = DatabaseDescriptor.getRawConfig(); - config.client_encryption_options = config.client_encryption_options.withEnabled(true) - .withRequireClientAuth(EncryptionOptions.ClientAuth.OPTIONAL); + config.client_encryption_options = new EncryptionOptions.ClientEncryptionOptions.Builder(config.client_encryption_options) + .withEnabled(true) + .withRequireClientAuth(EncryptionOptions.ClientEncryptionOptions.ClientAuth.OPTIONAL) + .build(); Map parameters = Collections.singletonMap("validator_class_name", "org.apache.cassandra.auth.SpiffeCertificateValidator"); fallbackAuthenticator = new MutualTlsWithPasswordFallbackAuthenticator(parameters); fallbackAuthenticator.setup(); diff --git a/test/unit/org/apache/cassandra/auth/jmx/JMXAuthJMXServerOptionsTest.java b/test/unit/org/apache/cassandra/auth/jmx/JMXAuthJMXServerOptionsTest.java index cb83a61eda17..98749ca314ab 100644 --- a/test/unit/org/apache/cassandra/auth/jmx/JMXAuthJMXServerOptionsTest.java +++ b/test/unit/org/apache/cassandra/auth/jmx/JMXAuthJMXServerOptionsTest.java @@ -42,7 +42,7 @@ private static JMXServerOptions getJMXServerOptions() throws Exception String config = Paths.get(ClassLoader.getSystemResource("auth/cassandra-test-jaas.conf").toURI()).toString(); return new JMXServerOptions(true, false, 9999, 0, true, - new EncryptionOptions(), "TestLogin", config, null, null, + new EncryptionOptions.ClientEncryptionOptions(), "TestLogin", config, null, null, NoSuperUserAuthorizationProxy.class.getName()); } } diff --git a/test/unit/org/apache/cassandra/config/EncryptionOptionsEqualityTest.java b/test/unit/org/apache/cassandra/config/EncryptionOptionsEqualityTest.java index 5e6d26b8173e..b2770c23618c 100644 --- a/test/unit/org/apache/cassandra/config/EncryptionOptionsEqualityTest.java +++ b/test/unit/org/apache/cassandra/config/EncryptionOptionsEqualityTest.java @@ -27,8 +27,8 @@ import org.apache.cassandra.security.DummySslContextFactoryImpl; import org.apache.cassandra.transport.TlsTestUtils; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.NOT_REQUIRED; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.NOT_REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; @@ -40,23 +40,25 @@ public class EncryptionOptionsEqualityTest { private EncryptionOptions.ServerEncryptionOptions createServerEncryptionOptions() { - return new EncryptionOptions.ServerEncryptionOptions() + EncryptionOptions.ServerEncryptionOptions.Builder serverEncryptionOptionsBuilder = new EncryptionOptions.ServerEncryptionOptions.Builder(); + return serverEncryptionOptionsBuilder + .withOutboundKeystore(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PATH) + .withOutboundKeystorePassword(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PASSWORD) .withStoreType("JKS") .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH) .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) .withTrustStore(TlsTestUtils.SERVER_TRUSTSTORE_PATH) .withTrustStorePassword(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD) - .withOutboundKeystore(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PATH) - .withOutboundKeystorePassword(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PASSWORD) .withProtocol("TLSv1.1") .withRequireClientAuth(REQUIRED) - .withRequireEndpointVerification(false); + .withRequireEndpointVerification(false) + .build(); } @Test public void testKeystoreOptions() { - EncryptionOptions encryptionOptions1 = - new EncryptionOptions() + EncryptionOptions.ServerEncryptionOptions encryptionOptions1 = + new EncryptionOptions.ServerEncryptionOptions.Builder() .withStoreType("JKS") .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH) .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) @@ -64,10 +66,11 @@ public void testKeystoreOptions() { .withTrustStorePassword(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD) .withProtocol("TLSv1.1") .withRequireClientAuth(REQUIRED) - .withRequireEndpointVerification(false); + .withRequireEndpointVerification(false) + .build(); - EncryptionOptions encryptionOptions2 = - new EncryptionOptions() + EncryptionOptions.ServerEncryptionOptions encryptionOptions2 = + new EncryptionOptions.ServerEncryptionOptions.Builder() .withStoreType("JKS") .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH) .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) @@ -75,7 +78,8 @@ public void testKeystoreOptions() { .withTrustStorePassword(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD) .withProtocol("TLSv1.1") .withRequireClientAuth(REQUIRED) - .withRequireEndpointVerification(false); + .withRequireEndpointVerification(false) + .build(); assertEquals(encryptionOptions1, encryptionOptions2); assertEquals(encryptionOptions1.hashCode(), encryptionOptions2.hashCode()); @@ -83,8 +87,8 @@ public void testKeystoreOptions() { @Test public void testKeystoreOptionsWithPasswordFile() { - EncryptionOptions encryptionOptions1 = - new EncryptionOptions() + EncryptionOptions.ServerEncryptionOptions encryptionOptions1 = + new EncryptionOptions.ServerEncryptionOptions.Builder() .withStoreType("JKS") .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH) .withKeyStorePasswordFile(TlsTestUtils.SERVER_KEYSTORE_PASSWORD_FILE) @@ -92,10 +96,11 @@ public void testKeystoreOptionsWithPasswordFile() { .withTrustStorePasswordFile(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD_FILE) .withProtocol("TLSv1.1") .withRequireClientAuth(REQUIRED) - .withRequireEndpointVerification(false); + .withRequireEndpointVerification(false) + .build(); - EncryptionOptions encryptionOptions2 = - new EncryptionOptions() + EncryptionOptions.ServerEncryptionOptions encryptionOptions2 = + new EncryptionOptions.ServerEncryptionOptions.Builder() .withStoreType("JKS") .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH) .withKeyStorePasswordFile(TlsTestUtils.SERVER_KEYSTORE_PASSWORD_FILE) @@ -103,7 +108,8 @@ public void testKeystoreOptionsWithPasswordFile() { .withTrustStorePasswordFile(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD_FILE) .withProtocol("TLSv1.1") .withRequireClientAuth(REQUIRED) - .withRequireEndpointVerification(false); + .withRequireEndpointVerification(false) + .build(); assertEquals(encryptionOptions1, encryptionOptions2); assertEquals(encryptionOptions1.hashCode(), encryptionOptions2.hashCode()); @@ -115,15 +121,17 @@ public void testMismatchForKeystoreOptionsWithPasswordFile() EncryptionOptions.ServerEncryptionOptions encryptionOptions1 = createServerEncryptionOptions(); EncryptionOptions.ServerEncryptionOptions encryptionOptions2 = createServerEncryptionOptions(); - encryptionOptions1 = encryptionOptions1 + encryptionOptions1 = new EncryptionOptions.ServerEncryptionOptions.Builder(encryptionOptions1) .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH) .withKeyStorePassword(null) - .withKeyStorePasswordFile(TlsTestUtils.SERVER_KEYSTORE_PASSWORD_FILE); + .withKeyStorePasswordFile(TlsTestUtils.SERVER_KEYSTORE_PASSWORD_FILE) + .build(); - encryptionOptions2 = encryptionOptions2 + encryptionOptions2 = new EncryptionOptions.ServerEncryptionOptions.Builder(encryptionOptions2) .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH) .withKeyStorePassword(null) - .withKeyStorePasswordFile(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD_FILE); + .withKeyStorePasswordFile(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD_FILE) + .build(); assertNotEquals(encryptionOptions1, encryptionOptions2); assertNotEquals(encryptionOptions1.hashCode(), encryptionOptions2.hashCode()); @@ -135,22 +143,24 @@ public void testSameCustomSslContextFactoryImplementation() { Map parameters1 = new HashMap<>(); parameters1.put("key1", "value1"); parameters1.put("key2", "value2"); - EncryptionOptions encryptionOptions1 = - new EncryptionOptions() + EncryptionOptions.ClientEncryptionOptions encryptionOptions1 = + new EncryptionOptions.ClientEncryptionOptions.Builder() .withSslContextFactory(new ParameterizedClass(DummySslContextFactoryImpl.class.getName(), parameters1)) .withProtocol("TLSv1.1") .withRequireClientAuth(REQUIRED) - .withRequireEndpointVerification(false); + .withRequireEndpointVerification(false) + .build(); Map parameters2 = new HashMap<>(); parameters2.put("key1", "value1"); parameters2.put("key2", "value2"); - EncryptionOptions encryptionOptions2 = - new EncryptionOptions() + EncryptionOptions.ClientEncryptionOptions encryptionOptions2 = + new EncryptionOptions.ClientEncryptionOptions.Builder() .withSslContextFactory(new ParameterizedClass(DummySslContextFactoryImpl.class.getName(), parameters2)) .withProtocol("TLSv1.1") .withRequireClientAuth(REQUIRED) - .withRequireEndpointVerification(false); + .withRequireEndpointVerification(false) + .build(); assertEquals(encryptionOptions1, encryptionOptions2); assertEquals(encryptionOptions1.hashCode(), encryptionOptions2.hashCode()); @@ -162,22 +172,24 @@ public void testDifferentCustomSslContextFactoryImplementations() { Map parameters1 = new HashMap<>(); parameters1.put("key1", "value1"); parameters1.put("key2", "value2"); - EncryptionOptions encryptionOptions1 = - new EncryptionOptions() + EncryptionOptions.ClientEncryptionOptions encryptionOptions1 = + new EncryptionOptions.ClientEncryptionOptions.Builder() .withSslContextFactory(new ParameterizedClass(DummySslContextFactoryImpl.class.getName(), parameters1)) .withProtocol("TLSv1.1") .withRequireClientAuth(NOT_REQUIRED) - .withRequireEndpointVerification(true); + .withRequireEndpointVerification(true) + .build(); Map parameters2 = new HashMap<>(); parameters2.put("key1", "value1"); parameters2.put("key2", "value2"); - EncryptionOptions encryptionOptions2 = - new EncryptionOptions() + EncryptionOptions.ClientEncryptionOptions encryptionOptions2 = + new EncryptionOptions.ClientEncryptionOptions.Builder() .withSslContextFactory(new ParameterizedClass(DefaultSslContextFactory.class.getName(), parameters2)) .withProtocol("TLSv1.1") .withRequireClientAuth(NOT_REQUIRED) - .withRequireEndpointVerification(true); + .withRequireEndpointVerification(true) + .build(); assertNotEquals(encryptionOptions1, encryptionOptions2); assertNotEquals(encryptionOptions1.hashCode(), encryptionOptions2.hashCode()); @@ -189,18 +201,20 @@ public void testDifferentCustomSslContextFactoryParameters() { Map parameters1 = new HashMap<>(); parameters1.put("key1", "value11"); parameters1.put("key2", "value12"); - EncryptionOptions encryptionOptions1 = - new EncryptionOptions() + EncryptionOptions.ClientEncryptionOptions encryptionOptions1 = + new EncryptionOptions.ClientEncryptionOptions.Builder() .withSslContextFactory(new ParameterizedClass(DummySslContextFactoryImpl.class.getName(), parameters1)) - .withProtocol("TLSv1.1"); + .withProtocol("TLSv1.1") + .build(); Map parameters2 = new HashMap<>(); parameters2.put("key1", "value21"); parameters2.put("key2", "value22"); - EncryptionOptions encryptionOptions2 = - new EncryptionOptions() + EncryptionOptions.ClientEncryptionOptions encryptionOptions2 = + new EncryptionOptions.ClientEncryptionOptions.Builder() .withSslContextFactory(new ParameterizedClass(DummySslContextFactoryImpl.class.getName(), parameters2)) - .withProtocol("TLSv1.1"); + .withProtocol("TLSv1.1") + .build(); assertNotEquals(encryptionOptions1, encryptionOptions2); assertNotEquals(encryptionOptions1.hashCode(), encryptionOptions2.hashCode()); @@ -222,13 +236,15 @@ public void testServerEncryptionOptionsMismatchForOutboundKeystore() EncryptionOptions.ServerEncryptionOptions encryptionOptions1 = createServerEncryptionOptions(); EncryptionOptions.ServerEncryptionOptions encryptionOptions2 = createServerEncryptionOptions(); - encryptionOptions1 = encryptionOptions1 + encryptionOptions1 = new EncryptionOptions.ServerEncryptionOptions.Builder(encryptionOptions1) .withOutboundKeystore("test/conf/cassandra_outbound1.keystore") - .withOutboundKeystorePassword("cassandra1"); + .withOutboundKeystorePassword("cassandra1") + .build(); - encryptionOptions2 = encryptionOptions2 + encryptionOptions2 = new EncryptionOptions.ServerEncryptionOptions.Builder(encryptionOptions2) .withOutboundKeystore("test/conf/cassandra_outbound2.keystore") - .withOutboundKeystorePassword("cassandra2"); + .withOutboundKeystorePassword("cassandra2") + .build(); assertNotEquals(encryptionOptions1, encryptionOptions2); assertNotEquals(encryptionOptions1.hashCode(), encryptionOptions2.hashCode()); @@ -240,13 +256,15 @@ public void testServerEncryptionOptionsMismatchForInboundKeystore() EncryptionOptions.ServerEncryptionOptions encryptionOptions1 = createServerEncryptionOptions(); EncryptionOptions.ServerEncryptionOptions encryptionOptions2 = createServerEncryptionOptions(); - encryptionOptions1 = encryptionOptions1 + encryptionOptions1 = new EncryptionOptions.ServerEncryptionOptions.Builder(encryptionOptions1) .withKeyStore("test/conf/cassandra1.keystore") - .withKeyStorePassword("cassandra1"); + .withKeyStorePassword("cassandra1") + .build(); - encryptionOptions2 = encryptionOptions2 + encryptionOptions2 = new EncryptionOptions.ServerEncryptionOptions.Builder(encryptionOptions2) .withKeyStore("test/conf/cassandra2.keystore") - .withKeyStorePassword("cassandra2"); + .withKeyStorePassword("cassandra2") + .build(); assertNotEquals(encryptionOptions1, encryptionOptions2); assertNotEquals(encryptionOptions1.hashCode(), encryptionOptions2.hashCode()); diff --git a/test/unit/org/apache/cassandra/config/EncryptionOptionsTest.java b/test/unit/org/apache/cassandra/config/EncryptionOptionsTest.java index 5ef08eb060a0..cec982d0c52b 100644 --- a/test/unit/org/apache/cassandra/config/EncryptionOptionsTest.java +++ b/test/unit/org/apache/cassandra/config/EncryptionOptionsTest.java @@ -23,11 +23,11 @@ import java.util.Map; import com.google.common.collect.ImmutableMap; -import org.apache.cassandra.io.util.File; import org.junit.Assert; import org.junit.Test; import org.apache.cassandra.exceptions.ConfigurationException; +import org.apache.cassandra.io.util.File; import org.assertj.core.api.Assertions; import org.yaml.snakeyaml.constructor.ConstructorException; @@ -46,11 +46,11 @@ public class EncryptionOptionsTest { static class EncryptionOptionsTestCase { - final EncryptionOptions encryptionOptions; + final EncryptionOptions.ClientEncryptionOptions encryptionOptions; final EncryptionOptions.TlsEncryptionPolicy expected; final String description; - public EncryptionOptionsTestCase(EncryptionOptions encryptionOptions, EncryptionOptions.TlsEncryptionPolicy expected, String description) + public EncryptionOptionsTestCase(EncryptionOptions.ClientEncryptionOptions encryptionOptions, EncryptionOptions.TlsEncryptionPolicy expected, String description) { this.encryptionOptions = encryptionOptions; this.expected = expected; @@ -59,25 +59,25 @@ public EncryptionOptionsTestCase(EncryptionOptions encryptionOptions, Encryption public static EncryptionOptionsTestCase of(Boolean optional, String keystorePath, Boolean enabled, EncryptionOptions.TlsEncryptionPolicy expected) { - return new EncryptionOptionsTestCase(new EncryptionOptions(new ParameterizedClass("org.apache.cassandra.security.DefaultSslContextFactory", - new HashMap<>()), - keystorePath, "dummypass", null, - "dummytruststore", "dummypass", null, - Collections.emptyList(), null, null, null, "JKS", "false", false, enabled, optional, null, null) + return new EncryptionOptionsTestCase(new EncryptionOptions.ClientEncryptionOptions(new ParameterizedClass("org.apache.cassandra.security.DefaultSslContextFactory", + new HashMap<>()), + keystorePath, "dummypass", null, + "dummytruststore", "dummypass", null, + Collections.emptyList(), null, null, null, "JKS", "false", false, enabled, optional, null, null) .applyConfig(), expected, String.format("optional=%s keystore=%s enabled=%s", optional, keystorePath, enabled)); } public static EncryptionOptionsTestCase of(Boolean optional, String keystorePath, Boolean enabled, - Map customSslContextFactoryParams, + Map customSslContextFactoryParams, EncryptionOptions.TlsEncryptionPolicy expected) { - return new EncryptionOptionsTestCase(new EncryptionOptions(new ParameterizedClass("org.apache.cassandra.security.DefaultSslContextFactory", - customSslContextFactoryParams), - keystorePath, "dummypass", null, - "dummytruststore", "dummypass", null, - Collections.emptyList(), null, null, null, "JKS", "false", false, enabled, optional, null, null) + return new EncryptionOptionsTestCase(new EncryptionOptions.ClientEncryptionOptions(new ParameterizedClass("org.apache.cassandra.security.DefaultSslContextFactory", + customSslContextFactoryParams), + keystorePath, "dummypass", null, + "dummytruststore", "dummypass", null, + Collections.emptyList(), null, null, null, "JKS", "false", false, enabled, optional, null, null) .applyConfig(), expected, String.format("optional=%s keystore=%s enabled=%s", optional, keystorePath, enabled)); @@ -87,15 +87,15 @@ public static EncryptionOptionsTestCase of(Boolean optional, String keystorePath static final String absentKeystore = "test/conf/missing-keystore-is-not-here"; static final String presentKeystore = "test/conf/keystore.jks"; final EncryptionOptionsTestCase[] encryptionOptionTestCases = { - // Optional Keystore Enabled Expected - EncryptionOptionsTestCase.of(null, absentKeystore, false, UNENCRYPTED), - EncryptionOptionsTestCase.of(null, absentKeystore, true, ENCRYPTED), - EncryptionOptionsTestCase.of(null, presentKeystore, false, OPTIONAL), - EncryptionOptionsTestCase.of(null, presentKeystore, true, ENCRYPTED), - EncryptionOptionsTestCase.of(false, absentKeystore, false, UNENCRYPTED), - EncryptionOptionsTestCase.of(false, absentKeystore, true, ENCRYPTED), - EncryptionOptionsTestCase.of(true, presentKeystore, false, OPTIONAL), - EncryptionOptionsTestCase.of(true, presentKeystore, true, OPTIONAL) + // Optional Keystore Enabled Expected + EncryptionOptionsTestCase.of(null, absentKeystore, false, UNENCRYPTED), + EncryptionOptionsTestCase.of(null, absentKeystore, true, ENCRYPTED), + EncryptionOptionsTestCase.of(null, presentKeystore, false, OPTIONAL), + EncryptionOptionsTestCase.of(null, presentKeystore, true, ENCRYPTED), + EncryptionOptionsTestCase.of(false, absentKeystore, false, UNENCRYPTED), + EncryptionOptionsTestCase.of(false, absentKeystore, true, ENCRYPTED), + EncryptionOptionsTestCase.of(true, presentKeystore, false, OPTIONAL), + EncryptionOptionsTestCase.of(true, presentKeystore, true, OPTIONAL) }; @Test @@ -111,11 +111,11 @@ public void testEncryptionOptionPolicy() static class ServerEncryptionOptionsTestCase { - final EncryptionOptions encryptionOptions; + final EncryptionOptions.ServerEncryptionOptions encryptionOptions; final EncryptionOptions.TlsEncryptionPolicy expected; final String description; - public ServerEncryptionOptionsTestCase(EncryptionOptions encryptionOptions, EncryptionOptions.TlsEncryptionPolicy expected, String description) + public ServerEncryptionOptionsTestCase(EncryptionOptions.ServerEncryptionOptions encryptionOptions, EncryptionOptions.TlsEncryptionPolicy expected, String description) { this.encryptionOptions = encryptionOptions; this.expected = expected; @@ -131,10 +131,10 @@ public static ServerEncryptionOptionsTestCase of(Boolean optional, String keysto keystorePath, "dummypass", null, keystorePath, "dummypass", null, "dummytruststore", "dummypass", null, - Collections.emptyList(), null, null, null, "JKS", "false", false, optional, internodeEncryption, false, null, null) + Collections.emptyList(), null, null, null, "JKS", "false", false, optional, internodeEncryption, false, null, null) .applyConfig(), - expected, - String.format("optional=%s keystore=%s internode=%s", optional, keystorePath, internodeEncryption)); + expected, + String.format("optional=%s keystore=%s internode=%s", optional, keystorePath, internodeEncryption)); } } @@ -143,8 +143,8 @@ public void isEnabledServer() { Map yaml = ImmutableMap.of( "server_encryption_options", ImmutableMap.of( - "isEnabled", false - ) + "isEnabled", false + ) ); Assertions.assertThatThrownBy(() -> YamlConfigurationLoader.fromMap(yaml, Config.class)) @@ -157,8 +157,8 @@ public void isOptionalServer() { Map yaml = ImmutableMap.of( "server_encryption_options", ImmutableMap.of( - "isOptional", false - ) + "isOptional", false + ) ); Assertions.assertThatThrownBy(() -> YamlConfigurationLoader.fromMap(yaml, Config.class)) @@ -171,11 +171,11 @@ public void testMaxCertificateValidityPeriod() { Map yaml = ImmutableMap.of( "server_encryption_options", ImmutableMap.of( - "max_certificate_validity_period", "2d" - ), + "max_certificate_validity_period", "2d" + ), "client_encryption_options", ImmutableMap.of( - "max_certificate_validity_period", "10d" - ) + "max_certificate_validity_period", "10d" + ) ); Config config = YamlConfigurationLoader.fromMap(yaml, Config.class); @@ -188,8 +188,8 @@ public void testFailsToParseInvalidMaxCertificateValidityPeriodValue() { Map yaml = ImmutableMap.of( "server_encryption_options", ImmutableMap.of( - "max_certificate_validity_period", "not-a-valid-input" - ) + "max_certificate_validity_period", "not-a-valid-input" + ) ); Assertions.assertThatThrownBy(() -> YamlConfigurationLoader.fromMap(yaml, Config.class)) @@ -202,8 +202,8 @@ public void testFailsToParseNegativeMaxCertificateValidityPeriod() { Map yaml = ImmutableMap.of( "server_encryption_options", ImmutableMap.of( - "max_certificate_validity_period", "-2d" - ) + "max_certificate_validity_period", "-2d" + ) ); Assertions.assertThatThrownBy(() -> YamlConfigurationLoader.fromMap(yaml, Config.class)) @@ -213,26 +213,26 @@ public void testFailsToParseNegativeMaxCertificateValidityPeriod() final ServerEncryptionOptionsTestCase[] serverEncryptionOptionTestCases = { - // Optional Keystore Internode Expected - ServerEncryptionOptionsTestCase.of(null, absentKeystore, none, UNENCRYPTED), - ServerEncryptionOptionsTestCase.of(null, absentKeystore, rack, OPTIONAL), - ServerEncryptionOptionsTestCase.of(null, absentKeystore, dc, OPTIONAL), - ServerEncryptionOptionsTestCase.of(null, absentKeystore, all, ENCRYPTED), - - ServerEncryptionOptionsTestCase.of(null, presentKeystore, none, OPTIONAL), - ServerEncryptionOptionsTestCase.of(null, presentKeystore, rack, OPTIONAL), - ServerEncryptionOptionsTestCase.of(null, absentKeystore, dc, OPTIONAL), - ServerEncryptionOptionsTestCase.of(null, absentKeystore, all, ENCRYPTED), - - ServerEncryptionOptionsTestCase.of(false, absentKeystore, none, UNENCRYPTED), - ServerEncryptionOptionsTestCase.of(false, absentKeystore, rack, OPTIONAL), - ServerEncryptionOptionsTestCase.of(false, absentKeystore, dc, OPTIONAL), - ServerEncryptionOptionsTestCase.of(false, absentKeystore, all, ENCRYPTED), - - ServerEncryptionOptionsTestCase.of(true, presentKeystore, none, OPTIONAL), - ServerEncryptionOptionsTestCase.of(true, presentKeystore, rack, OPTIONAL), - ServerEncryptionOptionsTestCase.of(true, absentKeystore, dc, OPTIONAL), - ServerEncryptionOptionsTestCase.of(true, absentKeystore, all, OPTIONAL), + // Optional Keystore Internode Expected + ServerEncryptionOptionsTestCase.of(null, absentKeystore, none, UNENCRYPTED), + ServerEncryptionOptionsTestCase.of(null, absentKeystore, rack, OPTIONAL), + ServerEncryptionOptionsTestCase.of(null, absentKeystore, dc, OPTIONAL), + ServerEncryptionOptionsTestCase.of(null, absentKeystore, all, ENCRYPTED), + + ServerEncryptionOptionsTestCase.of(null, presentKeystore, none, OPTIONAL), + ServerEncryptionOptionsTestCase.of(null, presentKeystore, rack, OPTIONAL), + ServerEncryptionOptionsTestCase.of(null, absentKeystore, dc, OPTIONAL), + ServerEncryptionOptionsTestCase.of(null, absentKeystore, all, ENCRYPTED), + + ServerEncryptionOptionsTestCase.of(false, absentKeystore, none, UNENCRYPTED), + ServerEncryptionOptionsTestCase.of(false, absentKeystore, rack, OPTIONAL), + ServerEncryptionOptionsTestCase.of(false, absentKeystore, dc, OPTIONAL), + ServerEncryptionOptionsTestCase.of(false, absentKeystore, all, ENCRYPTED), + + ServerEncryptionOptionsTestCase.of(true, presentKeystore, none, OPTIONAL), + ServerEncryptionOptionsTestCase.of(true, presentKeystore, rack, OPTIONAL), + ServerEncryptionOptionsTestCase.of(true, absentKeystore, dc, OPTIONAL), + ServerEncryptionOptionsTestCase.of(true, absentKeystore, all, OPTIONAL), }; @Test @@ -246,12 +246,12 @@ public void testServerEncryptionOptionPolicy() } } - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) public void testMisplacedConfigKey() { Map customSslContextFactoryParams = new HashMap<>(); - for(EncryptionOptions.ConfigKey configKey: EncryptionOptions.ConfigKey.values()) + for (EncryptionOptions.ConfigKey configKey : EncryptionOptions.ConfigKey.values()) { customSslContextFactoryParams.put(configKey.toString(), "my-custom-value"); } diff --git a/test/unit/org/apache/cassandra/cql3/CQLTester.java b/test/unit/org/apache/cassandra/cql3/CQLTester.java index 91d86d2c811b..05c64f956e18 100644 --- a/test/unit/org/apache/cassandra/cql3/CQLTester.java +++ b/test/unit/org/apache/cassandra/cql3/CQLTester.java @@ -663,13 +663,15 @@ public void shouldUseClientCertificate(boolean useClientCert) public static void requireNativeProtocolClientEncryption() { DatabaseDescriptor.updateNativeProtocolEncryptionOptions((encryptionOptions) -> - encryptionOptions.withEnabled(true) - .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH) - .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) - .withTrustStore(TlsTestUtils.SERVER_TRUSTSTORE_PATH) - .withTrustStorePassword(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD) - .withRequireEndpointVerification(false) - .withRequireClientAuth(EncryptionOptions.ClientAuth.OPTIONAL)); + new EncryptionOptions.ClientEncryptionOptions.Builder(encryptionOptions) + .withEnabled(true) + .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH) + .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) + .withTrustStore(TlsTestUtils.SERVER_TRUSTSTORE_PATH) + .withTrustStorePassword(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD) + .withRequireEndpointVerification(false) + .withRequireClientAuth(EncryptionOptions.ClientEncryptionOptions.ClientAuth.OPTIONAL) + .build()); } /** @@ -1691,7 +1693,7 @@ protected Cluster getCluster(ProtocolVersion protocolVersion) protected SimpleClient newSimpleClient(ProtocolVersion version) throws IOException { - return new SimpleClient(nativeAddr.getHostAddress(), nativePort, version, version.isBeta(), new EncryptionOptions().applyConfig()) + return new SimpleClient(nativeAddr.getHostAddress(), nativePort, version, version.isBeta(), new EncryptionOptions.ClientEncryptionOptions()) .connect(false, false); } diff --git a/test/unit/org/apache/cassandra/db/virtual/AbstractLoggerVirtualTableTest.java b/test/unit/org/apache/cassandra/db/virtual/AbstractLoggerVirtualTableTest.java new file mode 100644 index 000000000000..1f27252f3fdc --- /dev/null +++ b/test/unit/org/apache/cassandra/db/virtual/AbstractLoggerVirtualTableTest.java @@ -0,0 +1,169 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.cassandra.db.virtual; + +import java.time.Instant; +import java.util.Date; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +import com.google.common.collect.ImmutableList; +import org.junit.Ignore; +import org.junit.Test; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.LoggingEvent; +import com.datastax.driver.core.Row; +import org.apache.cassandra.cql3.CQLTester; +import org.apache.cassandra.db.DataRange; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +@Ignore +public abstract class AbstractLoggerVirtualTableTest extends CQLTester +{ + protected final String keyspace = createKeyspaceName(); + + protected AbstractLoggerVirtualTable table; + + @Test + public void testTruncate() + { + registerTable(); + + int numberOfRows = 100; + List loggingEvents = getLoggingEvents(numberOfRows); + loggingEvents.forEach(table::add); + + execute(query("truncate %s")); + + assertTrue(executeNet(query("select timestamp from %s")).all().isEmpty()); + } + + @Test + public void testEmpty() throws Throwable + { + registerTable(); + assertEmpty(execute(query("select * from %s"))); + } + + @Test + public void testInsert() + { + registerTable(); + + int numberOfRows = 1000; + List loggingEvents = getLoggingEvents(numberOfRows); + loggingEvents.forEach(table::add); + + assertEquals(numberOfRows, execute(query("select * from %s")).size()); + } + + @Test + public void testLimitedCapacity() + { + registerTable(100); + + int numberOfRows = 1000; + List loggingEvents = getLoggingEvents(numberOfRows); + loggingEvents.forEach(table::add); + + // even we inserted 1000 rows, only 100 are present as its capacity is bounded + assertEquals(100, numberOfPartitions()); + + // the first record in the table will be the last one which we inserted + LoggingEvent firstEvent = loggingEvents.get(999); + assertRowsNet(executeNet(query("select timestamp from %s limit 1")), + new Object[]{ new Date(firstEvent.getTimeStamp()) }); + + // the last record in the table will be 900th we inserted + List all = executeNet(query("select timestamp from %s")).all(); + assertEquals(100, all.size()); + Row row = all.get(all.size() - 1); + Date timestamp = row.getTimestamp(0); + assertEquals(loggingEvents.get(900).getTimeStamp(), timestamp.getTime()); + } + + protected abstract void registerTable(int maxSize); + + protected abstract void registerTable(); + + protected void registerVirtualTable(AbstractLoggerVirtualTable table) + { + this.table = table; + VirtualKeyspaceRegistry.instance.register(new VirtualKeyspace(table.metadata.keyspace, ImmutableList.of(this.table))); + } + + protected String query(String query) + { + return String.format(query, table.toString()); + } + + protected List getLoggingEvents(int size) + { + return getLoggingEvents(size, Instant.now(), 1); + } + + protected List getLoggingEvents(int size, Instant firstTimestamp, int logsInMillisecond) + { + List logs = new LinkedList<>(); + int partitions = size / logsInMillisecond; + + for (int i = 0; i < partitions; i++) + { + firstTimestamp = firstTimestamp.plusSeconds(i); + + for (int j = 0; j < logsInMillisecond; j++) + logs.add(getLoggingEvent(firstTimestamp.toEpochMilli())); + } + + return logs; + } + + protected int numberOfPartitions() + { + AbstractVirtualTable.DataSet data = table.data(); + Iterator partitions = data.getPartitions(DataRange.allData(table.metadata.partitioner)); + int numberOfPartitions = 0; + + while (partitions.hasNext()) + { + partitions.next(); + numberOfPartitions += 1; + } + + return numberOfPartitions; + } + + protected LoggingEvent getLoggingEvent(long timestamp) + { + LoggingEvent event = new LoggingEvent(); + event.setLevel(Level.INFO); + event.setMessage(getMessage()); + event.setLoggerName(AbstractLoggerVirtualTableTest.class.getName()); + event.setThreadName(Thread.currentThread().getName()); + event.setTimeStamp(timestamp); + + return event; + } + + protected abstract String getMessage(); +} diff --git a/test/unit/org/apache/cassandra/db/virtual/LogMessagesTableTest.java b/test/unit/org/apache/cassandra/db/virtual/LogMessagesTableTest.java index dd32058533db..7e114df0caf7 100644 --- a/test/unit/org/apache/cassandra/db/virtual/LogMessagesTableTest.java +++ b/test/unit/org/apache/cassandra/db/virtual/LogMessagesTableTest.java @@ -20,69 +20,35 @@ import java.time.Instant; import java.util.Date; -import java.util.Iterator; -import java.util.LinkedList; import java.util.List; -import com.google.common.collect.ImmutableList; import org.junit.Test; -import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; import com.datastax.driver.core.Row; -import org.apache.cassandra.cql3.CQLTester; -import org.apache.cassandra.db.DataRange; -import org.apache.cassandra.db.marshal.TimestampType; -import org.apache.cassandra.db.virtual.AbstractVirtualTable.DataSet; -import org.apache.cassandra.db.virtual.AbstractVirtualTable.Partition; -import org.apache.cassandra.dht.LocalPartitioner; +import org.apache.cassandra.utils.Clock; import static org.apache.cassandra.config.CassandraRelevantProperties.LOGS_VIRTUAL_TABLE_MAX_ROWS; +import static org.apache.cassandra.db.virtual.LogMessagesTable.LOGS_VIRTUAL_TABLE_DEFAULT_ROWS; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -public class LogMessagesTableTest extends CQLTester +public class LogMessagesTableTest extends AbstractLoggerVirtualTableTest { - private String keyspace = createKeyspaceName(); - private LogMessagesTable table; - - @Test - public void testTruncate() throws Throwable - { - registerVirtualTable(); - - int numberOfRows = 100; - List loggingEvents = getLoggingEvents(numberOfRows); - loggingEvents.forEach(table::add); - - execute(query("truncate %s")); - - assertTrue(executeNet(query("select timestamp from %s")).all().isEmpty()); - } - - @Test - public void empty() throws Throwable - { - registerVirtualTable(); - assertEmpty(execute(query("select * from %s"))); - } - @Test - public void testInsert() + public void testMultipleLogsInSameMillisecond() { - registerVirtualTable(); - - int numberOfRows = 1000; - List loggingEvents = getLoggingEvents(numberOfRows); + registerTable(); + List loggingEvents = getLoggingEvents(10, Instant.now(), 5); loggingEvents.forEach(table::add); - assertEquals(numberOfRows, numberOfPartitions()); + // 2 partitions, 5 rows in each + assertEquals(2, numberOfPartitions()); } @Test - public void testLimitedCapacity() throws Throwable + public void testLimitedCapacity() { - registerVirtualTable(100); + registerTable(100); int numberOfRows = 1000; List loggingEvents = getLoggingEvents(numberOfRows); @@ -94,7 +60,7 @@ public void testLimitedCapacity() throws Throwable // the first record in the table will be the last one which we inserted LoggingEvent firstEvent = loggingEvents.get(999); assertRowsNet(executeNet(query("select timestamp from %s limit 1")), - new Object[] { new Date(firstEvent.getTimeStamp()) }); + new Object[]{ new Date(firstEvent.getTimeStamp()) }); // the last record in the table will be 900th we inserted List all = executeNet(query("select timestamp from %s")).all(); @@ -104,100 +70,47 @@ public void testLimitedCapacity() throws Throwable assertEquals(loggingEvents.get(900).getTimeStamp(), timestamp.getTime()); } - @Test - public void testMultipleLogsInSameMillisecond() - { - registerVirtualTable(10); - List loggingEvents = getLoggingEvents(10, Instant.now(), 5); - loggingEvents.forEach(table::add); - - // 2 partitions, 5 rows in each - assertEquals(2, numberOfPartitions()); - } - @Test public void testResolvingBufferSize() { LOGS_VIRTUAL_TABLE_MAX_ROWS.setInt(-1); - assertEquals(LogMessagesTable.LOGS_VIRTUAL_TABLE_DEFAULT_ROWS, LogMessagesTable.resolveBufferSize()); + assertEquals(LOGS_VIRTUAL_TABLE_DEFAULT_ROWS, resolveBufferSize()); LOGS_VIRTUAL_TABLE_MAX_ROWS.setInt(0); - assertEquals(LogMessagesTable.LOGS_VIRTUAL_TABLE_DEFAULT_ROWS, LogMessagesTable.resolveBufferSize()); + assertEquals(LOGS_VIRTUAL_TABLE_DEFAULT_ROWS, resolveBufferSize()); LOGS_VIRTUAL_TABLE_MAX_ROWS.setInt(1000001); - assertEquals(LogMessagesTable.LOGS_VIRTUAL_TABLE_DEFAULT_ROWS, LogMessagesTable.resolveBufferSize()); + assertEquals(LOGS_VIRTUAL_TABLE_DEFAULT_ROWS, resolveBufferSize()); LOGS_VIRTUAL_TABLE_MAX_ROWS.setInt(999); - assertEquals(LogMessagesTable.LOGS_VIRTUAL_TABLE_DEFAULT_ROWS, LogMessagesTable.resolveBufferSize()); + assertEquals(999, resolveBufferSize()); LOGS_VIRTUAL_TABLE_MAX_ROWS.setInt(50001); - assertEquals(50001, LogMessagesTable.resolveBufferSize()); + assertEquals(50001, resolveBufferSize()); } - private void registerVirtualTable() + private int resolveBufferSize() { - registerVirtualTable(LogMessagesTable.LOGS_VIRTUAL_TABLE_MIN_ROWS); + return AbstractLoggerVirtualTable.resolveBufferSize(LOGS_VIRTUAL_TABLE_MAX_ROWS.getInt(), + LogMessagesTable.LOGS_VIRTUAL_TABLE_MAX_ROWS, + LOGS_VIRTUAL_TABLE_DEFAULT_ROWS); } - private void registerVirtualTable(int size) + @Override + protected void registerTable(int maxSize) { - table = new LogMessagesTable(keyspace, size); - VirtualKeyspaceRegistry.instance.register(new VirtualKeyspace(keyspace, ImmutableList.of(table))); + registerVirtualTable(new LogMessagesTable(keyspace, maxSize)); } - private int numberOfPartitions() + @Override + protected void registerTable() { - DataSet data = table.data(); - - Iterator partitions = data.getPartitions(DataRange.allData(new LocalPartitioner(TimestampType.instance))); - - int numberOfPartitions = 0; - - while (partitions.hasNext()) - { - partitions.next(); - numberOfPartitions += 1; - } - - return numberOfPartitions; - } - - private String query(String query) - { - return String.format(query, table.toString()); - } - - private List getLoggingEvents(int size) - { - return getLoggingEvents(size, Instant.now(), 1); - } - - private List getLoggingEvents(int size, Instant firstTimestamp, int logsInMillisecond) - { - List logs = new LinkedList<>(); - int partitions = size / logsInMillisecond; - - for (int i = 0; i < partitions; i++) - { - long timestamp = firstTimestamp.toEpochMilli(); - firstTimestamp = firstTimestamp.plusSeconds(1); - - for (int j = 0; j < logsInMillisecond; j++) - logs.add(getLoggingEvent(timestamp)); - } - - return logs; + registerTable(1000); } - private LoggingEvent getLoggingEvent(long timestamp) + @Override + protected String getMessage() { - LoggingEvent event = new LoggingEvent(); - event.setLevel(Level.INFO); - event.setMessage("message " + timestamp); - event.setLoggerName("logger " + timestamp); - event.setThreadName(Thread.currentThread().getName()); - event.setTimeStamp(timestamp); - - return event; + return "message " + Clock.Global.currentTimeMillis(); } } diff --git a/test/unit/org/apache/cassandra/db/virtual/SettingsTableTest.java b/test/unit/org/apache/cassandra/db/virtual/SettingsTableTest.java index 71b9172da798..78fb0d47d6ec 100644 --- a/test/unit/org/apache/cassandra/db/virtual/SettingsTableTest.java +++ b/test/unit/org/apache/cassandra/db/virtual/SettingsTableTest.java @@ -31,6 +31,7 @@ import com.datastax.driver.core.Row; import org.apache.cassandra.config.Config; import org.apache.cassandra.config.DurationSpec; +import org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions.Builder; import org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions.InternodeEncryption; import org.apache.cassandra.config.JMXServerOptions; import org.apache.cassandra.config.ParameterizedClass; @@ -38,7 +39,7 @@ import org.apache.cassandra.security.SSLFactory; import org.yaml.snakeyaml.introspector.Property; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; public class SettingsTableTest extends CQLTester { @@ -176,52 +177,53 @@ public void testEncryptionOverride() throws Throwable List expectedNames = SettingsTable.PROPERTIES.keySet().stream().filter(n -> n.startsWith("server_encryption")).collect(Collectors.toList()); Assert.assertEquals(expectedNames.size(), executeNet(all).all().size()); + Builder serverEncryptionOptionsBuilder = new Builder(config.server_encryption_options); check(pre + "algorithm", null); - config.server_encryption_options = config.server_encryption_options.withAlgorithm("SUPERSSL"); + config.server_encryption_options = serverEncryptionOptionsBuilder.withAlgorithm("SUPERSSL").build(); check(pre + "algorithm", "SUPERSSL"); check(pre + "cipher_suites", null); - config.server_encryption_options = config.server_encryption_options.withCipherSuites("c1", "c2"); + config.server_encryption_options = serverEncryptionOptionsBuilder.withCipherSuites("c1", "c2").build(); check(pre + "cipher_suites", "[c1, c2]"); // name doesn't match yaml check(pre + "protocol", null); - config.server_encryption_options = config.server_encryption_options.withProtocol("TLSv5"); + config.server_encryption_options = serverEncryptionOptionsBuilder.withProtocol("TLSv5").build(); check(pre + "protocol", "[TLSv5]"); - config.server_encryption_options = config.server_encryption_options.withProtocol("TLS"); + config.server_encryption_options = serverEncryptionOptionsBuilder.withProtocol("TLS").build(); check(pre + "protocol", SSLFactory.tlsInstanceProtocolSubstitution().toString()); - config.server_encryption_options = config.server_encryption_options.withProtocol("TLS"); - config.server_encryption_options = config.server_encryption_options.withAcceptedProtocols(ImmutableList.of("TLSv1.2","TLSv1.1")); + config.server_encryption_options = serverEncryptionOptionsBuilder.withProtocol("TLS").build(); + config.server_encryption_options = serverEncryptionOptionsBuilder.withAcceptedProtocols(ImmutableList.of("TLSv1.2","TLSv1.1")).build(); check(pre + "protocol", "[TLSv1.2, TLSv1.1]"); - config.server_encryption_options = config.server_encryption_options.withProtocol("TLSv2"); - config.server_encryption_options = config.server_encryption_options.withAcceptedProtocols(ImmutableList.of("TLSv1.2","TLSv1.1")); + config.server_encryption_options = serverEncryptionOptionsBuilder.withProtocol("TLSv2").build(); + config.server_encryption_options = serverEncryptionOptionsBuilder.withAcceptedProtocols(ImmutableList.of("TLSv1.2","TLSv1.1")).build(); check(pre + "protocol", "[TLSv1.2, TLSv1.1, TLSv2]"); // protocol goes after the explicit accept list if non-TLS check(pre + "optional", "false"); - config.server_encryption_options = config.server_encryption_options.withOptional(true); + config.server_encryption_options = serverEncryptionOptionsBuilder.withOptional(true).build(); check(pre + "optional", "true"); // name doesn't match yaml check(pre + "client_auth", "false"); - config.server_encryption_options = config.server_encryption_options.withRequireClientAuth(REQUIRED); + config.server_encryption_options = serverEncryptionOptionsBuilder.withRequireClientAuth(REQUIRED).build(); check(pre + "client_auth", "true"); // name doesn't match yaml check(pre + "endpoint_verification", "false"); - config.server_encryption_options = config.server_encryption_options.withRequireEndpointVerification(true); + config.server_encryption_options = serverEncryptionOptionsBuilder.withRequireEndpointVerification(true).build(); check(pre + "endpoint_verification", "true"); check(pre + "internode_encryption", "none"); - config.server_encryption_options = config.server_encryption_options.withInternodeEncryption(InternodeEncryption.all); + config.server_encryption_options = serverEncryptionOptionsBuilder.withInternodeEncryption(InternodeEncryption.all).build(); check(pre + "internode_encryption", "all"); check(pre + "enabled", "true"); // name doesn't match yaml check(pre + "legacy_ssl_storage_port", "false"); - config.server_encryption_options = config.server_encryption_options.withLegacySslStoragePort(true); + config.server_encryption_options = serverEncryptionOptionsBuilder.withLegacySslStoragePort(true).build(); check(pre + "legacy_ssl_storage_port", "true"); } diff --git a/test/unit/org/apache/cassandra/db/virtual/SlowQueriesTableTest.java b/test/unit/org/apache/cassandra/db/virtual/SlowQueriesTableTest.java new file mode 100644 index 000000000000..11007f8fdc0d --- /dev/null +++ b/test/unit/org/apache/cassandra/db/virtual/SlowQueriesTableTest.java @@ -0,0 +1,145 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.cassandra.db.virtual; + +import java.util.List; +import java.util.Random; + +import org.junit.Test; + +import ch.qos.logback.classic.spi.LoggingEvent; +import org.apache.cassandra.db.monitoring.MonitorableImpl; +import org.apache.cassandra.db.monitoring.MonitoringTask; +import org.apache.cassandra.db.monitoring.MonitoringTask.Operation; +import org.apache.cassandra.utils.Clock; +import org.apache.cassandra.utils.Generators; +import org.quicktheories.impl.JavaRandom; + +import static org.apache.cassandra.config.CassandraRelevantProperties.LOGS_SLOW_QUERIES_VIRTUAL_TABLE_MAX_ROWS; +import static org.apache.cassandra.db.virtual.SlowQueriesTable.LOGS_VIRTUAL_TABLE_DEFAULT_ROWS; +import static org.apache.cassandra.db.virtual.SlowQueriesTable.LOGS_VIRTUAL_TABLE_MAX_ROWS; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class SlowQueriesTableTest extends AbstractLoggerVirtualTableTest +{ + private final Random random = new Random(); + private final JavaRandom javaRandom = new JavaRandom(random); + + @Override + protected void registerTable(int maxSize) + { + registerVirtualTable(new SlowQueriesTable(keyspace, maxSize)); + } + + @Override + protected void registerTable() + { + registerTable(1000); + } + + @Test + public void testLimitedCapacity() + { + registerTable(100); + + int numberOfRows = 1000; + List loggingEvents = getLoggingEvents(numberOfRows); + loggingEvents.forEach(table::add); + + // even we inserted 1000 rows, only 100 are present as its capacity is bounded + assertEquals(100, numberOfPartitions()); + } + + @Test + public void testDelete() + { + registerTable(); + + int numberOfRows = 100; + List loggingEvents = getLoggingEvents(numberOfRows); + loggingEvents.forEach(table::add); + + Operation operation = table.buffer.get(0); + + assertEquals(100, executeNet(query("select * from %s")).all().size()); + execute(query("delete from %s where keyspace_name = '" + operation.keyspace() + '\'')); + assertTrue(executeNet(query("select * from %s")).all().size() < 100); + } + + @Test + public void testResolvingBufferSize() + { + LOGS_SLOW_QUERIES_VIRTUAL_TABLE_MAX_ROWS.setInt(-1); + assertEquals(LOGS_VIRTUAL_TABLE_DEFAULT_ROWS, resolveBufferSize()); + + LOGS_SLOW_QUERIES_VIRTUAL_TABLE_MAX_ROWS.setInt(0); + assertEquals(LOGS_VIRTUAL_TABLE_DEFAULT_ROWS, resolveBufferSize()); + + LOGS_SLOW_QUERIES_VIRTUAL_TABLE_MAX_ROWS.setInt(1000001); + assertEquals(LOGS_VIRTUAL_TABLE_DEFAULT_ROWS, resolveBufferSize()); + + LOGS_SLOW_QUERIES_VIRTUAL_TABLE_MAX_ROWS.setInt(999); + assertEquals(999, resolveBufferSize()); + + LOGS_SLOW_QUERIES_VIRTUAL_TABLE_MAX_ROWS.setInt(50001); + assertEquals(50001, resolveBufferSize()); + } + + private int resolveBufferSize() + { + return AbstractLoggerVirtualTable.resolveBufferSize(LOGS_SLOW_QUERIES_VIRTUAL_TABLE_MAX_ROWS.getInt(), + LOGS_VIRTUAL_TABLE_MAX_ROWS, + LOGS_VIRTUAL_TABLE_DEFAULT_ROWS); + } + + + @Override + protected String getMessage() + { + MonitoringTask.SlowOperation slowOperation = new MonitoringTask.SlowOperation(new MonitorableImpl() + { + @Override + public String name() + { + return Generators.SYMBOL_GEN.generate(javaRandom); + } + + @Override + public String monitoredOnKeyspace() + { + return Generators.SYMBOL_GEN.generate(javaRandom); + } + + @Override + public String monitoredOnTable() + { + return Generators.SYMBOL_GEN.generate(javaRandom); + } + + @Override + public boolean isCrossNode() + { + return random.nextBoolean(); + } + }, Clock.Global.currentTimeMillis()); + + return Operation.serialize(List.of(slowOperation)); + } +} diff --git a/test/unit/org/apache/cassandra/net/ConnectionTest.java b/test/unit/org/apache/cassandra/net/ConnectionTest.java index 70bb0c8046e3..233d067d1215 100644 --- a/test/unit/org/apache/cassandra/net/ConnectionTest.java +++ b/test/unit/org/apache/cassandra/net/ConnectionTest.java @@ -57,6 +57,7 @@ import io.netty.channel.ChannelPromise; import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.config.EncryptionOptions; +import org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions.Builder; import org.apache.cassandra.db.commitlog.CommitLog; import org.apache.cassandra.distributed.test.log.ClusterMetadataTestHelper; import org.apache.cassandra.exceptions.RequestFailure; @@ -72,7 +73,7 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS; import static java.util.concurrent.TimeUnit.MINUTES; import static java.util.concurrent.TimeUnit.SECONDS; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.NOT_REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.NOT_REQUIRED; import static org.apache.cassandra.net.MessagingService.VERSION_40; import static org.apache.cassandra.net.NoPayload.noPayload; import static org.apache.cassandra.net.MessagingService.current_version; @@ -176,17 +177,18 @@ Settings override(Settings settings) } } - static final EncryptionOptions.ServerEncryptionOptions encryptionOptions = - new EncryptionOptions.ServerEncryptionOptions() + static final EncryptionOptions.Builder encryptionOptionsBuilder = + new Builder() .withLegacySslStoragePort(true) - .withOptional(true) .withInternodeEncryption(EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.all) + .withOptional(true) .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH) .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) .withTrustStore(TlsTestUtils.SERVER_TRUSTSTORE_PATH) .withTrustStorePassword(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD) .withRequireClientAuth(NOT_REQUIRED) .withCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA"); + static final EncryptionOptions.ServerEncryptionOptions encryptionOptions = encryptionOptionsBuilder.build(); static final List> MODIFIERS = ImmutableList.of( settings -> settings.outbound(outbound -> outbound.withEncryption(encryptionOptions)) diff --git a/test/unit/org/apache/cassandra/net/HandshakeTest.java b/test/unit/org/apache/cassandra/net/HandshakeTest.java index c84643497d5d..2806bac86d18 100644 --- a/test/unit/org/apache/cassandra/net/HandshakeTest.java +++ b/test/unit/org/apache/cassandra/net/HandshakeTest.java @@ -39,6 +39,7 @@ import io.netty.util.concurrent.Future; import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions; +import org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions.Builder; import org.apache.cassandra.config.ParameterizedClass; import org.apache.cassandra.db.commitlog.CommitLog; import org.apache.cassandra.distributed.test.log.ClusterMetadataTestHelper; @@ -49,9 +50,9 @@ import org.apache.cassandra.transport.TlsTestUtils; import org.apache.cassandra.utils.concurrent.AsyncPromise; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.NOT_REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; import static org.apache.cassandra.net.ConnectionType.SMALL_MESSAGES; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.NOT_REQUIRED; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; import static org.apache.cassandra.net.MessagingService.current_version; import static org.apache.cassandra.net.MessagingService.minimum_version; import static org.apache.cassandra.net.OutboundConnectionInitiator.Result; @@ -279,26 +280,28 @@ public void testOutboundConnectionDoesntFallbackWhenErrorIsNotSSLRelated() throw private ServerEncryptionOptions getServerEncryptionOptions(SslFallbackConnectionType sslConnectionType, boolean optional) { - ServerEncryptionOptions serverEncryptionOptions = new ServerEncryptionOptions().withOptional(optional) - .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH) - .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) - .withOutboundKeystore(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PATH) - .withOutboundKeystorePassword(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PASSWORD) - .withTrustStore(TlsTestUtils.SERVER_TRUSTSTORE_PATH) - .withTrustStorePassword(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD) - .withSslContextFactory((new ParameterizedClass(DefaultSslContextFactory.class.getName(), - new HashMap<>()))); + Builder serverEncryptionOptionsBuilder = new Builder(); + + serverEncryptionOptionsBuilder.withOutboundKeystore(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PATH) + .withOutboundKeystorePassword(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PASSWORD) + .withOptional(optional) + .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH) + .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) + .withTrustStore(TlsTestUtils.SERVER_TRUSTSTORE_PATH).withTrustStorePassword(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD) + .withSslContextFactory((new ParameterizedClass(DefaultSslContextFactory.class.getName(), + new HashMap<>()))); + if (sslConnectionType == SslFallbackConnectionType.MTLS) { - serverEncryptionOptions = serverEncryptionOptions.withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all) - .withRequireClientAuth(REQUIRED); + serverEncryptionOptionsBuilder.withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all) + .withRequireClientAuth(REQUIRED); } else if (sslConnectionType == SslFallbackConnectionType.SSL) { - serverEncryptionOptions = serverEncryptionOptions.withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all) - .withRequireClientAuth(NOT_REQUIRED); + serverEncryptionOptionsBuilder.withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all) + .withRequireClientAuth(NOT_REQUIRED); } - return serverEncryptionOptions; + return serverEncryptionOptionsBuilder.build(); } private InboundSockets getInboundSocket(ServerEncryptionOptions serverEncryptionOptions) diff --git a/test/unit/org/apache/cassandra/net/MessagingServiceTest.java b/test/unit/org/apache/cassandra/net/MessagingServiceTest.java index 95c72f4bc0b3..45746d5e6e06 100644 --- a/test/unit/org/apache/cassandra/net/MessagingServiceTest.java +++ b/test/unit/org/apache/cassandra/net/MessagingServiceTest.java @@ -50,6 +50,7 @@ import org.apache.cassandra.auth.IInternodeAuthenticator; import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions; +import org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions.Builder; import org.apache.cassandra.db.commitlog.CommitLog; import org.apache.cassandra.distributed.test.log.ClusterMetadataTestHelper; import org.apache.cassandra.exceptions.ConfigurationException; @@ -257,8 +258,7 @@ private static void addDCLatency(long sentAt, long nowTime) public void testFailedOutboundInternodeAuth() throws Exception { // Listen on serverside for connections - ServerEncryptionOptions serverEncryptionOptions = new ServerEncryptionOptions() - .withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.none); + ServerEncryptionOptions serverEncryptionOptions = new Builder().withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.none).build(); DatabaseDescriptor.setInternodeAuthenticator(REJECT_OUTBOUND_AUTHENTICATOR); InetAddress listenAddress = FBUtilities.getJustLocalAddress(); @@ -293,8 +293,7 @@ public void testFailedOutboundInternodeAuth() throws Exception @Test public void testFailedInboundInternodeAuth() throws IOException, InterruptedException { - ServerEncryptionOptions serverEncryptionOptions = new ServerEncryptionOptions() - .withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.none); + ServerEncryptionOptions serverEncryptionOptions = new Builder().withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.none).build(); DatabaseDescriptor.setInternodeAuthenticator(ALLOW_NOTHING_AUTHENTICATOR); InetAddress listenAddress = FBUtilities.getJustLocalAddress(); @@ -348,56 +347,54 @@ public void testFailedInboundInternodeAuth() throws IOException, InterruptedExce @Test public void listenPlainConnection() throws InterruptedException { - ServerEncryptionOptions serverEncryptionOptions = new ServerEncryptionOptions() - .withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.none); + ServerEncryptionOptions serverEncryptionOptions = new Builder().withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.none).build(); listen(serverEncryptionOptions, false); } @Test public void listenPlainConnectionWithBroadcastAddr() throws InterruptedException { - ServerEncryptionOptions serverEncryptionOptions = new ServerEncryptionOptions() - .withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.none); + ServerEncryptionOptions serverEncryptionOptions = new Builder().withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.none).build(); listen(serverEncryptionOptions, true); } @Test public void listenRequiredSecureConnection() throws InterruptedException { - ServerEncryptionOptions serverEncryptionOptions = new ServerEncryptionOptions() - .withOptional(false) - .withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all) - .withLegacySslStoragePort(false); + ServerEncryptionOptions serverEncryptionOptions = new Builder().withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all) + .withLegacySslStoragePort(false) + .withOptional(false) + .build(); listen(serverEncryptionOptions, false); } @Test public void listenRequiredSecureConnectionWithBroadcastAddr() throws InterruptedException { - ServerEncryptionOptions serverEncryptionOptions = new ServerEncryptionOptions() - .withOptional(false) - .withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all) - .withLegacySslStoragePort(false); + ServerEncryptionOptions serverEncryptionOptions = new Builder().withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all) + .withLegacySslStoragePort(false) + .withOptional(false) + .build(); listen(serverEncryptionOptions, true); } @Test public void listenRequiredSecureConnectionWithLegacyPort() throws InterruptedException { - ServerEncryptionOptions serverEncryptionOptions = new ServerEncryptionOptions() - .withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all) - .withOptional(false) - .withLegacySslStoragePort(true); + ServerEncryptionOptions serverEncryptionOptions = new Builder().withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all) + .withLegacySslStoragePort(true) + .withOptional(false) + .build(); listen(serverEncryptionOptions, false); } @Test public void listenRequiredSecureConnectionWithBroadcastAddrAndLegacyPort() throws InterruptedException { - ServerEncryptionOptions serverEncryptionOptions = new ServerEncryptionOptions() - .withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all) - .withOptional(false) - .withLegacySslStoragePort(true); + ServerEncryptionOptions serverEncryptionOptions = new Builder().withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all) + .withLegacySslStoragePort(true) + .withOptional(false) + .build(); listen(serverEncryptionOptions, true); } @@ -406,8 +403,7 @@ public void listenOptionalSecureConnection() throws InterruptedException { for (int i = 0; i < 500; i++) // test used to be flaky, so run in a loop to make sure stable (see CASSANDRA-17033) { - ServerEncryptionOptions serverEncryptionOptions = new ServerEncryptionOptions() - .withOptional(true); + ServerEncryptionOptions serverEncryptionOptions = new Builder().withOptional(true).build(); listen(serverEncryptionOptions, false); } } @@ -415,8 +411,7 @@ public void listenOptionalSecureConnection() throws InterruptedException @Test public void listenOptionalSecureConnectionWithBroadcastAddr() throws InterruptedException { - ServerEncryptionOptions serverEncryptionOptions = new ServerEncryptionOptions() - .withOptional(true); + ServerEncryptionOptions serverEncryptionOptions = new Builder().withOptional(true).build(); listen(serverEncryptionOptions, true); } diff --git a/test/unit/org/apache/cassandra/security/DefaultSslContextFactoryTest.java b/test/unit/org/apache/cassandra/security/DefaultSslContextFactoryTest.java index fa3eb7c845ee..5dc6d7e39bdc 100644 --- a/test/unit/org/apache/cassandra/security/DefaultSslContextFactoryTest.java +++ b/test/unit/org/apache/cassandra/security/DefaultSslContextFactoryTest.java @@ -33,17 +33,17 @@ import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslProvider; import org.apache.cassandra.config.EncryptionOptions; +import org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions.Builder; import org.apache.cassandra.distributed.shared.WithProperties; import org.apache.cassandra.transport.TlsTestUtils; import static org.apache.cassandra.config.CassandraRelevantProperties.DISABLE_TCACTIVE_OPENSSL; - -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.NOT_REQUIRED; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.NOT_REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; public class DefaultSslContextFactoryTest { - private Map commonConfig = new HashMap<>(); + private Map commonConfig = new HashMap<>(); @Before public void setup() @@ -54,7 +54,7 @@ public void setup() commonConfig.put("cipher_suites", Arrays.asList("TLS_RSA_WITH_AES_128_CBC_SHA")); } - private void addKeystoreOptions(Map config) + private void addKeystoreOptions(Map config) { config.put("keystore", TlsTestUtils.SERVER_KEYSTORE_PATH); config.put("keystore_password", TlsTestUtils.SERVER_KEYSTORE_PASSWORD); @@ -69,14 +69,18 @@ private void addOutboundKeystoreOptions(Map config) @Test public void getSslContextOpenSSL() throws IOException { - EncryptionOptions.ServerEncryptionOptions options = new EncryptionOptions.ServerEncryptionOptions().withTrustStore(TlsTestUtils.SERVER_TRUSTSTORE_PATH) - .withTrustStorePassword(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD) - .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH) - .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) - .withOutboundKeystore(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PATH) - .withOutboundKeystorePassword(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PASSWORD) - .withRequireClientAuth(NOT_REQUIRED) - .withCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA"); + EncryptionOptions.ServerEncryptionOptions.Builder builder = new Builder(); + EncryptionOptions.ServerEncryptionOptions options = builder + .withOutboundKeystore(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PATH) + .withOutboundKeystorePassword(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PASSWORD) + .withTrustStore(TlsTestUtils.SERVER_TRUSTSTORE_PATH) + .withTrustStorePassword(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD) + .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH) + .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) + .withRequireClientAuth(NOT_REQUIRED) + .withCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA") + .build(); + SslContext sslContext = SSLFactory.getOrCreateSslContext(options, REQUIRED, ISslContextFactory.SocketType.CLIENT, "test"); Assert.assertNotNull(sslContext); if (OpenSsl.isAvailable()) @@ -88,7 +92,7 @@ public void getSslContextOpenSSL() throws IOException @Test(expected = IOException.class) public void buildTrustManagerFactoryWithInvalidTruststoreFile() throws IOException { - Map config = new HashMap<>(); + Map config = new HashMap<>(); config.putAll(commonConfig); config.put("truststore", "/this/is/probably/not/a/file/on/your/test/machine"); @@ -100,7 +104,7 @@ public void buildTrustManagerFactoryWithInvalidTruststoreFile() throws IOExcepti @Test(expected = IOException.class) public void buildTrustManagerFactoryWithBadPassword() throws IOException { - Map config = new HashMap<>(); + Map config = new HashMap<>(); config.putAll(commonConfig); config.put("truststore_password", "HomeOfBadPasswords"); @@ -112,7 +116,7 @@ public void buildTrustManagerFactoryWithBadPassword() throws IOException @Test public void buildTrustManagerFactoryHappyPath() throws IOException { - Map config = new HashMap<>(); + Map config = new HashMap<>(); config.putAll(commonConfig); DefaultSslContextFactory defaultSslContextFactoryImpl = new DefaultSslContextFactory(config); @@ -124,7 +128,7 @@ public void buildTrustManagerFactoryHappyPath() throws IOException @Test(expected = IOException.class) public void buildKeyManagerFactoryWithInvalidKeystoreFile() throws IOException { - Map config = new HashMap<>(); + Map config = new HashMap<>(); config.putAll(commonConfig); config.put("keystore", "/this/is/probably/not/a/file/on/your/test/machine"); config.put("keystore_password", "ThisWontMatter"); @@ -137,7 +141,7 @@ public void buildKeyManagerFactoryWithInvalidKeystoreFile() throws IOException @Test(expected = IOException.class) public void buildKeyManagerFactoryWithBadPassword() throws IOException { - Map config = new HashMap<>(); + Map config = new HashMap<>(); config.putAll(commonConfig); addKeystoreOptions(config); config.put("keystore_password", "HomeOfBadPasswords"); @@ -149,7 +153,7 @@ public void buildKeyManagerFactoryWithBadPassword() throws IOException @Test public void buildKeyManagerFactoryHappyPath() throws IOException { - Map config = new HashMap<>(); + Map config = new HashMap<>(); config.putAll(commonConfig); DefaultSslContextFactory defaultSslContextFactoryImpl = new DefaultSslContextFactory(config); @@ -222,12 +226,13 @@ public void buildOutboundKeyManagerFactoryHappyPath() throws IOException } @Test - public void testDisableOpenSslForInJvmDtests() { + public void testDisableOpenSslForInJvmDtests() + { // The configuration name below is hard-coded intentionally to make sure we don't break the contract without // changing the documentation appropriately try (WithProperties properties = new WithProperties().set(DISABLE_TCACTIVE_OPENSSL, true)) { - Map config = new HashMap<>(); + Map config = new HashMap<>(); config.putAll(commonConfig); DefaultSslContextFactory defaultSslContextFactoryImpl = new DefaultSslContextFactory(config); diff --git a/test/unit/org/apache/cassandra/security/DummySslContextFactoryImpl.java b/test/unit/org/apache/cassandra/security/DummySslContextFactoryImpl.java index ca4f4e86f06e..12649cfb0cc6 100644 --- a/test/unit/org/apache/cassandra/security/DummySslContextFactoryImpl.java +++ b/test/unit/org/apache/cassandra/security/DummySslContextFactoryImpl.java @@ -44,7 +44,7 @@ public SSLContext createJSSESslContext(boolean verifyPeerCertificate) throws SSL } @Override - public SSLContext createJSSESslContext(EncryptionOptions.ClientAuth clientAuth) throws SSLException + public SSLContext createJSSESslContext(EncryptionOptions.ClientEncryptionOptions.ClientAuth clientAuth) throws SSLException { return null; } @@ -56,7 +56,7 @@ public SslContext createNettySslContext(boolean verifyPeerCertificate, SocketTyp } @Override - public SslContext createNettySslContext(EncryptionOptions.ClientAuth clientAuth, SocketType socketType, + public SslContext createNettySslContext(EncryptionOptions.ClientEncryptionOptions.ClientAuth clientAuth, SocketType socketType, CipherSuiteFilter cipherFilter) throws SSLException { return null; diff --git a/test/unit/org/apache/cassandra/security/FileBasedSslContextFactoryTest.java b/test/unit/org/apache/cassandra/security/FileBasedSslContextFactoryTest.java index d6d936ba0e6c..cc6c05af5d25 100644 --- a/test/unit/org/apache/cassandra/security/FileBasedSslContextFactoryTest.java +++ b/test/unit/org/apache/cassandra/security/FileBasedSslContextFactoryTest.java @@ -36,11 +36,12 @@ import static org.apache.cassandra.config.CassandraRelevantProperties.CASSANDRA_CONFIG; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.NOT_REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.NOT_REQUIRED; public class FileBasedSslContextFactoryTest { private EncryptionOptions.ServerEncryptionOptions encryptionOptions; + private EncryptionOptions.ServerEncryptionOptions.Builder encryptionOptionsBuilder; static WithProperties properties; @@ -60,7 +61,10 @@ public static void tearDownDatabaseDescriptor() @Before public void setup() { - encryptionOptions = new EncryptionOptions.ServerEncryptionOptions() + encryptionOptionsBuilder = new EncryptionOptions.ServerEncryptionOptions.Builder(); + encryptionOptions = encryptionOptionsBuilder + .withOutboundKeystore(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PATH) + .withOutboundKeystorePassword(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PASSWORD) .withSslContextFactory(new ParameterizedClass(TestFileBasedSSLContextFactory.class.getName(), new HashMap<>())) .withTrustStore(TlsTestUtils.SERVER_TRUSTSTORE_PATH) @@ -69,8 +73,7 @@ public void setup() .withCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA") .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH) .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) - .withOutboundKeystore(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PATH) - .withOutboundKeystorePassword(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PASSWORD); + .build(); } @Test @@ -95,11 +98,12 @@ public void testHappyPath() throws SSLException @Test public void testEmptyKeystorePasswords() throws SSLException { - EncryptionOptions.ServerEncryptionOptions localEncryptionOptions = encryptionOptions + EncryptionOptions.ServerEncryptionOptions localEncryptionOptions = encryptionOptionsBuilder + .withOutboundKeystorePassword("") + .withOutboundKeystore("test/conf/cassandra_ssl_test_nopassword.keystore") .withKeyStorePassword("") .withKeyStore("test/conf/cassandra_ssl_test_nopassword.keystore") - .withOutboundKeystorePassword("") - .withOutboundKeystore("test/conf/cassandra_ssl_test_nopassword.keystore"); + .build(); Assert.assertEquals("org.apache.cassandra.security.FileBasedSslContextFactoryTest$TestFileBasedSSLContextFactory", localEncryptionOptions.ssl_context_factory.class_name); @@ -118,13 +122,14 @@ public void testKeystorePasswordFile() throws SSLException { // Here we only override password configuration and specify password_file configuration since keystore paths // are already loaded in the `encryptionOptions` - EncryptionOptions.ServerEncryptionOptions localEncryptionOptions = encryptionOptions - .withKeyStorePassword(null) - .withKeyStorePasswordFile(TlsTestUtils.SERVER_KEYSTORE_PASSWORD_FILE) + EncryptionOptions.ServerEncryptionOptions localEncryptionOptions = encryptionOptionsBuilder .withOutboundKeystorePassword(null) .withOutboundKeystorePasswordFile(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PASSWORD_FILE) + .withKeyStorePassword(null) + .withKeyStorePasswordFile(TlsTestUtils.SERVER_KEYSTORE_PASSWORD_FILE) .withTrustStorePassword(null) - .withTrustStorePasswordFile(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD_FILE); + .withTrustStorePasswordFile(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD_FILE) + .build(); Assert.assertEquals("org.apache.cassandra.security.FileBasedSslContextFactoryTest$TestFileBasedSSLContextFactory", localEncryptionOptions.ssl_context_factory.class_name); @@ -144,13 +149,14 @@ public void testBadKeystorePasswordFile() throws SSLException { // Here we only override password configuration and specify password_file configuration since keystore paths // are already loaded in the `encryptionOptions` - encryptionOptions - .withKeyStorePassword(null) - .withKeyStorePasswordFile("/path/to/non-existance-password-file") + encryptionOptionsBuilder .withOutboundKeystorePassword(null) .withOutboundKeystorePasswordFile("/path/to/non-existance-password-file") + .withKeyStorePassword(null) + .withKeyStorePasswordFile("/path/to/non-existance-password-file") .withTrustStorePassword(null) - .withTrustStorePasswordFile("/path/to/non-existance-password-file"); + .withTrustStorePasswordFile("/path/to/non-existance-password-file") + .build(); } /** @@ -159,7 +165,9 @@ public void testBadKeystorePasswordFile() throws SSLException @Test(expected = IllegalArgumentException.class) public void testNullKeystorePasswordDisallowed() throws SSLException { - EncryptionOptions.ServerEncryptionOptions localEncryptionOptions = encryptionOptions.withKeyStorePassword(null); + EncryptionOptions.ServerEncryptionOptions localEncryptionOptions = encryptionOptionsBuilder + .withKeyStorePassword(null) + .build(); Assert.assertEquals("org.apache.cassandra.security.FileBasedSslContextFactoryTest$TestFileBasedSSLContextFactory", localEncryptionOptions.ssl_context_factory.class_name); @@ -187,7 +195,9 @@ public void testNullKeystorePasswordDisallowed() throws SSLException @Test public void testOnlyEmptyOutboundKeystorePassword() throws SSLException { - EncryptionOptions.ServerEncryptionOptions localEncryptionOptions = encryptionOptions.withOutboundKeystorePassword(null); + EncryptionOptions.ServerEncryptionOptions localEncryptionOptions = encryptionOptionsBuilder + .withOutboundKeystorePassword(null) + .build(); Assert.assertEquals("org.apache.cassandra.security.FileBasedSslContextFactoryTest$TestFileBasedSSLContextFactory", localEncryptionOptions.ssl_context_factory.class_name); @@ -203,7 +213,9 @@ public void testOnlyEmptyOutboundKeystorePassword() throws SSLException @Test public void testEmptyTruststorePassword() throws SSLException { - EncryptionOptions.ServerEncryptionOptions localEncryptionOptions = encryptionOptions.withTrustStorePassword(null); + EncryptionOptions.ServerEncryptionOptions localEncryptionOptions = encryptionOptionsBuilder + .withTrustStorePassword(null) + .build(); Assert.assertEquals("org.apache.cassandra.security.FileBasedSslContextFactoryTest$TestFileBasedSSLContextFactory", localEncryptionOptions.ssl_context_factory.class_name); Assert.assertNotNull("keystore_password must not be null", localEncryptionOptions.keystore_password); diff --git a/test/unit/org/apache/cassandra/security/PEMBasedSslContextFactoryTest.java b/test/unit/org/apache/cassandra/security/PEMBasedSslContextFactoryTest.java index 9781e9d08a71..18d323286d3e 100644 --- a/test/unit/org/apache/cassandra/security/PEMBasedSslContextFactoryTest.java +++ b/test/unit/org/apache/cassandra/security/PEMBasedSslContextFactoryTest.java @@ -39,8 +39,8 @@ import org.apache.cassandra.transport.TlsTestUtils; import static org.apache.cassandra.config.CassandraRelevantProperties.DISABLE_TCACTIVE_OPENSSL; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.NOT_REQUIRED; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.NOT_REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; import static org.apache.cassandra.security.PEMBasedSslContextFactory.ConfigKey.ENCODED_CERTIFICATES; import static org.apache.cassandra.security.PEMBasedSslContextFactory.ConfigKey.ENCODED_KEY; import static org.apache.cassandra.security.PEMBasedSslContextFactory.ConfigKey.KEY_PASSWORD; @@ -215,12 +215,14 @@ public void getSslContextOpenSSL() throws IOException { ParameterizedClass sslContextFactory = new ParameterizedClass(PEMBasedSslContextFactory.class.getSimpleName() , new HashMap<>()); - EncryptionOptions options = new EncryptionOptions().withTrustStore(TlsTestUtils.SERVER_TRUSTSTORE_PEM_PATH) - .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH_PEM) - .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) - .withRequireClientAuth(NOT_REQUIRED) - .withCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA") - .withSslContextFactory(sslContextFactory); + EncryptionOptions.ClientEncryptionOptions options = new EncryptionOptions.ClientEncryptionOptions.Builder() + .withTrustStore(TlsTestUtils.SERVER_TRUSTSTORE_PEM_PATH) + .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH_PEM) + .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) + .withRequireClientAuth(NOT_REQUIRED) + .withCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA") + .withSslContextFactory(sslContextFactory) + .build(); SslContext sslContext = SSLFactory.getOrCreateSslContext(options, REQUIRED, ISslContextFactory.SocketType.SERVER, "test"); Assert.assertNotNull(sslContext); if (OpenSsl.isAvailable()) @@ -234,14 +236,16 @@ public void getSslContextOpenSSLOutboundKeystore() throws IOException { ParameterizedClass sslContextFactory = new ParameterizedClass(PEMBasedSslContextFactory.class.getSimpleName() , new HashMap<>()); - EncryptionOptions.ServerEncryptionOptions options = new EncryptionOptions.ServerEncryptionOptions().withTrustStore(TlsTestUtils.SERVER_TRUSTSTORE_PEM_PATH) - .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH_PEM) - .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) - .withOutboundKeystore(TlsTestUtils.SERVER_KEYSTORE_PATH_PEM) - .withOutboundKeystorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) - .withRequireClientAuth(NOT_REQUIRED) - .withCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA") - .withSslContextFactory(sslContextFactory); + EncryptionOptions.ServerEncryptionOptions options = + new EncryptionOptions.ServerEncryptionOptions.Builder().withOutboundKeystore(TlsTestUtils.SERVER_KEYSTORE_PATH_PEM) + .withOutboundKeystorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) + .withTrustStore(TlsTestUtils.SERVER_TRUSTSTORE_PEM_PATH) + .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH_PEM) + .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) + .withRequireClientAuth(NOT_REQUIRED) + .withCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA") + .withSslContextFactory(sslContextFactory) + .build(); SslContext sslContext = SSLFactory.getOrCreateSslContext(options, REQUIRED, ISslContextFactory.SocketType.CLIENT, "test"); Assert.assertNotNull(sslContext); if (OpenSsl.isAvailable()) diff --git a/test/unit/org/apache/cassandra/security/SSLFactoryTest.java b/test/unit/org/apache/cassandra/security/SSLFactoryTest.java index ba46588686bc..7ac95173376c 100644 --- a/test/unit/org/apache/cassandra/security/SSLFactoryTest.java +++ b/test/unit/org/apache/cassandra/security/SSLFactoryTest.java @@ -1,21 +1,21 @@ /* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.cassandra.security; import java.io.FileInputStream; @@ -46,18 +46,20 @@ import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.config.EncryptionOptions; import org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions; +import org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions.Builder; import org.apache.cassandra.config.ParameterizedClass; import org.apache.cassandra.io.util.File; import org.apache.cassandra.transport.TlsTestUtils; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.NOT_REQUIRED; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.NOT_REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; public class SSLFactoryTest { static final SelfSignedCertificate ssc; + static { DatabaseDescriptor.daemonInitialization(); @@ -77,33 +79,41 @@ public class SSLFactoryTest public void setup() { SSLFactory.clearSslContextCache(); - encryptionOptions = new ServerEncryptionOptions() - .withTrustStore(TlsTestUtils.SERVER_TRUSTSTORE_PATH) - .withTrustStorePassword(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD) - .withRequireClientAuth(NOT_REQUIRED) - .withCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA") - .withSslContextFactory(new ParameterizedClass(TestFileBasedSSLContextFactory.class.getName(), - new HashMap<>())); + encryptionOptions = new Builder().withTrustStore(TlsTestUtils.SERVER_TRUSTSTORE_PATH) + .withTrustStorePassword(TlsTestUtils.SERVER_TRUSTSTORE_PASSWORD) + .withRequireClientAuth(NOT_REQUIRED) + .withCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA") + .withSslContextFactory(new ParameterizedClass(TestFileBasedSSLContextFactory.class.getName(), + new HashMap<>())) + .build(); } - private ServerEncryptionOptions addKeystoreOptions(ServerEncryptionOptions options) + private Builder addKeystoreOptions(ServerEncryptionOptions options) { - return options.withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH) - .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) - .withOutboundKeystore(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PATH) - .withOutboundKeystorePassword(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PASSWORD); + EncryptionOptions.ServerEncryptionOptions.Builder builder = new EncryptionOptions.ServerEncryptionOptions.Builder(options); + + builder.withOutboundKeystorePassword(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PASSWORD) + .withOutboundKeystore(TlsTestUtils.SERVER_OUTBOUND_KEYSTORE_PATH) + .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) + .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH); + + return builder; } - private ServerEncryptionOptions addPEMKeystoreOptions(ServerEncryptionOptions options) + private Builder addPEMKeystoreOptions(ServerEncryptionOptions options) { ParameterizedClass sslContextFactoryClass = new ParameterizedClass("org.apache.cassandra.security.PEMBasedSslContextFactory", new HashMap<>()); - return options.withSslContextFactory(sslContextFactoryClass) - .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH_PEM) - .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) - .withOutboundKeystore(TlsTestUtils.SERVER_KEYSTORE_PATH_PEM) - .withOutboundKeystorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) - .withTrustStore(TlsTestUtils.SERVER_TRUSTSTORE_PEM_PATH); + EncryptionOptions.ServerEncryptionOptions.Builder builder = new EncryptionOptions.ServerEncryptionOptions.Builder(options); + + builder.withOutboundKeystore(TlsTestUtils.SERVER_KEYSTORE_PATH_PEM) + .withOutboundKeystorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) + .withSslContextFactory(sslContextFactoryClass) + .withKeyStore(TlsTestUtils.SERVER_KEYSTORE_PATH_PEM) + .withKeyStorePassword(TlsTestUtils.SERVER_KEYSTORE_PASSWORD) + .withTrustStore(TlsTestUtils.SERVER_TRUSTSTORE_PEM_PATH); + + return builder; } @Test @@ -111,9 +121,13 @@ public void testSslContextReload_HappyPath() throws IOException, InterruptedExce { try { - ServerEncryptionOptions options = addKeystoreOptions(encryptionOptions) - .withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all); - ServerEncryptionOptions legacyOptions = options.withOptional(false).withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all); + Builder optionsBuilder = addKeystoreOptions(encryptionOptions) + .withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all); + ServerEncryptionOptions options = optionsBuilder.build(); + ServerEncryptionOptions legacyOptions = optionsBuilder + .withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all) + .withOptional(false) + .build(); options.sslContextFactoryInstance.initHotReloading(); legacyOptions.sslContextFactoryInstance.initHotReloading(); @@ -146,8 +160,9 @@ public void testSslContextReload_HappyPath() throws IOException, InterruptedExce public void testServerSocketShouldUseKeystore() throws IOException, CertificateException, KeyStoreException, NoSuchAlgorithmException, NoSuchFieldException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException { ServerEncryptionOptions options = addKeystoreOptions(encryptionOptions) - .withOutboundKeystore("dummyKeystore") - .withOutboundKeystorePassword("dummyPassword"); + .withOutboundKeystore("dummyKeystore") + .withOutboundKeystorePassword("dummyPassword") + .build(); // Server socket type should create a keystore with keystore & keystore password final OpenSslServerContext context = (OpenSslServerContext) SSLFactory.createNettySslContext(options, REQUIRED, ISslContextFactory.SocketType.SERVER); @@ -163,8 +178,9 @@ public void testServerSocketShouldUseKeystore() throws IOException, CertificateE public void testClientSocketShouldUseOutboundKeystore() throws IOException, CertificateException, KeyStoreException, NoSuchAlgorithmException, NoSuchFieldException, ClassNotFoundException, InvocationTargetException, IllegalAccessException, NoSuchMethodException { ServerEncryptionOptions options = addKeystoreOptions(encryptionOptions) - .withKeyStore("dummyKeystore") - .withKeyStorePassword("dummyPassword"); + .withKeyStore("dummyKeystore") + .withKeyStorePassword("dummyPassword") + .build(); // Client socket type should create a keystore with outbound Keystore & outbound password final OpenSslClientContext context = (OpenSslClientContext) SSLFactory.createNettySslContext(options, REQUIRED, ISslContextFactory.SocketType.CLIENT); @@ -181,10 +197,14 @@ public void testPEMSslContextReload_HappyPath() throws IOException { try { - ServerEncryptionOptions options = addPEMKeystoreOptions(encryptionOptions) - .withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.dc); + Builder optionsBuilder = addPEMKeystoreOptions(encryptionOptions); + ServerEncryptionOptions options = optionsBuilder.withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.dc) + .build(); // emulate InboundSockets and share the cert but with different options, no extra hot reloading init - ServerEncryptionOptions legacyOptions = options.withOptional(false).withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all); + ServerEncryptionOptions legacyOptions = optionsBuilder + .withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all) + .withOptional(false) + .build(); options.sslContextFactoryInstance.initHotReloading(); legacyOptions.sslContextFactoryInstance.initHotReloading(); @@ -217,8 +237,9 @@ public void testPEMSslContextReload_HappyPath() throws IOException public void testSslFactorySslInit_BadPassword_ThrowsException() throws IOException { ServerEncryptionOptions options = addKeystoreOptions(encryptionOptions) - .withKeyStorePassword("bad password") - .withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all); + .withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all) + .withKeyStorePassword("bad password") + .build(); SSLFactory.validateSslContext("testSslFactorySslInit_BadPassword_ThrowsException", options, NOT_REQUIRED, true); } @@ -228,13 +249,17 @@ public void testSslFactoryHotReload_BadPassword_DoesNotClearExistingSslContext() { try { - ServerEncryptionOptions options = addKeystoreOptions(encryptionOptions); + Builder optionsBuilder = addKeystoreOptions(encryptionOptions); + ServerEncryptionOptions options = optionsBuilder.build(); // emulate InboundSockets and share the cert but with different options, no extra hot reloading init - ServerEncryptionOptions legacyOptions = options.withOptional(false).withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all); + ServerEncryptionOptions legacyOptions = optionsBuilder + .withInternodeEncryption(ServerEncryptionOptions.InternodeEncryption.all) + .withOptional(false) + .build(); File testKeystoreFile = new File(options.keystore + ".test"); FileUtils.copyFile(new File(options.keystore).toJavaIOFile(), testKeystoreFile.toJavaIOFile()); - options = options.withKeyStore(testKeystoreFile.path()); + options = new Builder(options).withKeyStore(testKeystoreFile.path()).build(); SSLFactory.initHotReloading(options, options, true); // deliberately not initializing with legacyOptions to match InboundSockets.addBindings @@ -261,11 +286,12 @@ public void testSslFactoryHotReload_CorruptOrNonExistentFile_DoesNotClearExistin { try { - ServerEncryptionOptions options = addKeystoreOptions(encryptionOptions); + Builder optionsBuilder = addKeystoreOptions(encryptionOptions); + ServerEncryptionOptions options = optionsBuilder.build(); File testKeystoreFile = new File(options.keystore + ".test"); FileUtils.copyFile(new File(options.keystore).toJavaIOFile(), testKeystoreFile.toJavaIOFile()); - options = options.withKeyStore(testKeystoreFile.path()); + options = optionsBuilder.withKeyStore(testKeystoreFile.path()).build(); SSLFactory.initHotReloading(options, options, true); @@ -294,8 +320,10 @@ public void testSslFactoryHotReload_CorruptOrNonExistentFile_DoesNotClearExistin @Test public void getSslContext_ParamChanges() throws IOException { - ServerEncryptionOptions options = addKeystoreOptions(encryptionOptions) - .withCipherSuites("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"); + Builder optionsBuilder = addKeystoreOptions(encryptionOptions); + ServerEncryptionOptions options = optionsBuilder + .withCipherSuites("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256") + .build(); SslContext ctx1 = SSLFactory.getOrCreateSslContext(options, REQUIRED, ISslContextFactory.SocketType.SERVER, "test"); @@ -303,7 +331,7 @@ public void getSslContext_ParamChanges() throws IOException Assert.assertTrue(ctx1.isServer()); Assert.assertEquals(ctx1.cipherSuites(), options.cipher_suites); - options = options.withCipherSuites("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"); + options = optionsBuilder.withCipherSuites("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256").build(); SslContext ctx2 = SSLFactory.getOrCreateSslContext(options, REQUIRED, ISslContextFactory.SocketType.CLIENT, "test"); @@ -313,30 +341,33 @@ public void getSslContext_ParamChanges() throws IOException } @Test - public void testCacheKeyEqualityForCustomSslContextFactory() { + public void testCacheKeyEqualityForCustomSslContextFactory() + { - Map parameters1 = new HashMap<>(); + Map parameters1 = new HashMap<>(); parameters1.put("key1", "value1"); parameters1.put("key2", "value2"); - EncryptionOptions encryptionOptions1 = - new EncryptionOptions() + EncryptionOptions.ClientEncryptionOptions encryptionOptions1 = + new EncryptionOptions.ClientEncryptionOptions.Builder() .withSslContextFactory(new ParameterizedClass(DummySslContextFactoryImpl.class.getName(), parameters1)) .withProtocol("TLSv1.1") .withRequireClientAuth(REQUIRED) - .withRequireEndpointVerification(false); + .withRequireEndpointVerification(false) + .build(); SSLFactory.CacheKey cacheKey1 = new SSLFactory.CacheKey(encryptionOptions1, ISslContextFactory.SocketType.SERVER, "test" ); - Map parameters2 = new HashMap<>(); + Map parameters2 = new HashMap<>(); parameters2.put("key1", "value1"); parameters2.put("key2", "value2"); - EncryptionOptions encryptionOptions2 = - new EncryptionOptions() + EncryptionOptions.ClientEncryptionOptions encryptionOptions2 = + new EncryptionOptions.ClientEncryptionOptions.Builder() .withSslContextFactory(new ParameterizedClass(DummySslContextFactoryImpl.class.getName(), parameters2)) .withProtocol("TLSv1.1") .withRequireClientAuth(REQUIRED) - .withRequireEndpointVerification(false); + .withRequireEndpointVerification(false) + .build(); SSLFactory.CacheKey cacheKey2 = new SSLFactory.CacheKey(encryptionOptions2, ISslContextFactory.SocketType.SERVER, "test" ); @@ -345,26 +376,29 @@ public void testCacheKeyEqualityForCustomSslContextFactory() { } @Test - public void testCacheKeyInequalityForCustomSslContextFactory() { + public void testCacheKeyInequalityForCustomSslContextFactory() + { - Map parameters1 = new HashMap<>(); + Map parameters1 = new HashMap<>(); parameters1.put("key1", "value11"); parameters1.put("key2", "value12"); - EncryptionOptions encryptionOptions1 = - new EncryptionOptions() + EncryptionOptions.ClientEncryptionOptions encryptionOptions1 = + new EncryptionOptions.ClientEncryptionOptions.Builder() .withSslContextFactory(new ParameterizedClass(DummySslContextFactoryImpl.class.getName(), parameters1)) - .withProtocol("TLSv1.1"); + .withProtocol("TLSv1.1") + .build(); SSLFactory.CacheKey cacheKey1 = new SSLFactory.CacheKey(encryptionOptions1, ISslContextFactory.SocketType.SERVER, "test" ); - Map parameters2 = new HashMap<>(); + Map parameters2 = new HashMap<>(); parameters2.put("key1", "value21"); parameters2.put("key2", "value22"); - EncryptionOptions encryptionOptions2 = - new EncryptionOptions() + EncryptionOptions.ClientEncryptionOptions encryptionOptions2 = + new EncryptionOptions.ClientEncryptionOptions.Builder() .withSslContextFactory(new ParameterizedClass(DummySslContextFactoryImpl.class.getName(), parameters2)) - .withProtocol("TLSv1.1"); + .withProtocol("TLSv1.1") + .build(); SSLFactory.CacheKey cacheKey2 = new SSLFactory.CacheKey(encryptionOptions2, ISslContextFactory.SocketType.SERVER, "test" ); @@ -372,7 +406,8 @@ public void testCacheKeyInequalityForCustomSslContextFactory() { Assert.assertNotEquals(cacheKey1, cacheKey2); } - public static class TestFileBasedSSLContextFactory extends FileBasedSslContextFactory { + public static class TestFileBasedSSLContextFactory extends FileBasedSslContextFactory + { public TestFileBasedSSLContextFactory(Map parameters) { super(parameters); diff --git a/test/unit/org/apache/cassandra/service/ClientWarningsTest.java b/test/unit/org/apache/cassandra/service/ClientWarningsTest.java index cf6d6ed40032..fb9f594801b3 100644 --- a/test/unit/org/apache/cassandra/service/ClientWarningsTest.java +++ b/test/unit/org/apache/cassandra/service/ClientWarningsTest.java @@ -70,7 +70,7 @@ public void testUnloggedBatch() throws Exception createTable("CREATE TABLE %s (pk int PRIMARY KEY, v text)"); // v4 and higher - try (SimpleClient client = new SimpleClient(nativeAddr.getHostAddress(), nativePort, version, true, new EncryptionOptions())) + try (SimpleClient client = new SimpleClient(nativeAddr.getHostAddress(), nativePort, version, true, new EncryptionOptions.ClientEncryptionOptions())) { client.connect(false); @@ -90,7 +90,7 @@ public void testLargeBatch() throws Exception createTable("CREATE TABLE %s (pk int PRIMARY KEY, v text)"); // v4 and higher - try (SimpleClient client = new SimpleClient(nativeAddr.getHostAddress(), nativePort, version, true, new EncryptionOptions())) + try (SimpleClient client = new SimpleClient(nativeAddr.getHostAddress(), nativePort, version, true, new EncryptionOptions.ClientEncryptionOptions())) { client.connect(false); @@ -112,7 +112,7 @@ public void testTombstoneWarning() throws Exception final int iterations = 10000; createTable("CREATE TABLE %s (pk int, ck int, v int, PRIMARY KEY (pk, ck))"); - try (SimpleClient client = new SimpleClient(nativeAddr.getHostAddress(), nativePort, version, true, new EncryptionOptions())) + try (SimpleClient client = new SimpleClient(nativeAddr.getHostAddress(), nativePort, version, true, new EncryptionOptions.ClientEncryptionOptions())) { client.connect(false); diff --git a/test/unit/org/apache/cassandra/service/NativeTransportServiceTest.java b/test/unit/org/apache/cassandra/service/NativeTransportServiceTest.java index 645d5b8f8bca..960289940062 100644 --- a/test/unit/org/apache/cassandra/service/NativeTransportServiceTest.java +++ b/test/unit/org/apache/cassandra/service/NativeTransportServiceTest.java @@ -36,7 +36,7 @@ public class NativeTransportServiceTest { - static EncryptionOptions defaultOptions; + static EncryptionOptions.ClientEncryptionOptions defaultOptions; @BeforeClass public static void setupDD() @@ -48,7 +48,7 @@ public static void setupDD() @After public void resetConfig() { - DatabaseDescriptor.updateNativeProtocolEncryptionOptions(update -> new EncryptionOptions(defaultOptions).applyConfig()); + DatabaseDescriptor.updateNativeProtocolEncryptionOptions(update -> new EncryptionOptions.ClientEncryptionOptions.Builder(defaultOptions).build()); } @Test @@ -127,8 +127,11 @@ public void testPlainDefaultPort() public void testSSLOnly() { // default ssl settings: client encryption enabled and default native transport port used for ssl only - DatabaseDescriptor.updateNativeProtocolEncryptionOptions(options -> options.withEnabled(true) - .withOptional(false)); + DatabaseDescriptor.updateNativeProtocolEncryptionOptions(options -> + new EncryptionOptions.ClientEncryptionOptions.Builder(options) + .withEnabled(true) + .withOptional(false) + .build()); withService((NativeTransportService service) -> { @@ -144,8 +147,11 @@ public void testSSLOnly() public void testSSLOptional() { // default ssl settings: client encryption enabled and default native transport port used for optional ssl - DatabaseDescriptor.updateNativeProtocolEncryptionOptions(options -> options.withEnabled(true) - .withOptional(true)); + DatabaseDescriptor.updateNativeProtocolEncryptionOptions(options -> + new EncryptionOptions.ClientEncryptionOptions.Builder(options) + .withEnabled(true) + .withOptional(true) + .build()); withService((NativeTransportService service) -> { diff --git a/test/unit/org/apache/cassandra/service/ProtocolBetaVersionTest.java b/test/unit/org/apache/cassandra/service/ProtocolBetaVersionTest.java index a5b32bfa1fa7..22324f178b03 100644 --- a/test/unit/org/apache/cassandra/service/ProtocolBetaVersionTest.java +++ b/test/unit/org/apache/cassandra/service/ProtocolBetaVersionTest.java @@ -68,7 +68,7 @@ public void testProtocolBetaVersion() throws Exception createTable("CREATE TABLE %s (pk int PRIMARY KEY, v int)"); assertTrue(betaVersion.isBeta()); // change to another beta version or remove test if no beta version - try (SimpleClient client = new SimpleClient(nativeAddr.getHostAddress(), nativePort, betaVersion, true, new EncryptionOptions())) + try (SimpleClient client = new SimpleClient(nativeAddr.getHostAddress(), nativePort, betaVersion, true, new EncryptionOptions.ClientEncryptionOptions())) { client.connect(false); for (int i = 0; i < 10; i++) @@ -103,7 +103,7 @@ public void unforcedProtocolVersionTest() throws Exception } assertTrue(betaVersion.isBeta()); // change to another beta version or remove test if no beta version - try (SimpleClient client = new SimpleClient(nativeAddr.getHostAddress(), nativePort, betaVersion, false, new EncryptionOptions())) + try (SimpleClient client = new SimpleClient(nativeAddr.getHostAddress(), nativePort, betaVersion, false, new EncryptionOptions.ClientEncryptionOptions())) { client.connect(false); fail("Exception should have been thrown"); diff --git a/test/unit/org/apache/cassandra/tools/LoaderOptionsTest.java b/test/unit/org/apache/cassandra/tools/LoaderOptionsTest.java index 4fc23256770a..b203af1b4357 100644 --- a/test/unit/org/apache/cassandra/tools/LoaderOptionsTest.java +++ b/test/unit/org/apache/cassandra/tools/LoaderOptionsTest.java @@ -28,6 +28,7 @@ import org.junit.Test; import org.apache.cassandra.io.util.File; +import org.apache.cassandra.transport.TlsTestUtils; import static org.apache.cassandra.tools.OfflineToolUtils.sstableDirName; import static org.junit.Assert.assertEquals; @@ -85,6 +86,35 @@ public void testEncryptionSettings() throws Exception assertEquals("test.jks", options.clientEncOptions.keystore); } + /** + * Tests for client_encryption_options override from the command line. + */ + @Test + public void testEncryptionSettingsOverride() throws Exception + { + // Default Cassandra config + File config = new File(Paths.get(".", "test", "conf", "cassandra-mtls.yaml").normalize()); + String[] args = { "-d", "127.9.9.1", "-f", config.absolutePath(), + "-ts", "test.jks", "-tspw", "truststorePass1", + "-ks", "test.jks", "-kspw", "testdata1", + "--ssl-ciphers", "TLS_RSA_WITH_AES_256_CBC_SHA", + "--ssl-alg", "SunX509", "--store-type", "JKS", "--ssl-protocol", "TLS", + sstableDirName("legacy_sstables", "legacy_ma_simple") }; + LoaderOptions options = LoaderOptions.builder().parseArgs(args).build(); + // Below two lines validating server encryption options is to verify that we are loading config from the yaml + assertEquals(TlsTestUtils.SERVER_KEYSTORE_PATH, options.serverEncOptions.keystore); + assertEquals(TlsTestUtils.SERVER_KEYSTORE_PASSWORD, options.serverEncOptions.keystore_password); + // Below asserts validate the overrides for the client encryption options from the command line + // Since the values are provided by (and local to) this test, they are hardcoded + assertEquals("JKS", options.clientEncOptions.store_type); + assertEquals("test.jks", options.clientEncOptions.truststore); + assertEquals("truststorePass1", options.clientEncOptions.truststore_password); + assertEquals("test.jks", options.clientEncOptions.keystore); + assertEquals("testdata1", options.clientEncOptions.keystore_password); + assertEquals("TLS_RSA_WITH_AES_256_CBC_SHA", options.clientEncOptions.cipherSuitesArray()[0]); + assertEquals("SunX509", options.clientEncOptions.algorithm); + } + @Test public void testThrottleDefaultSettings() { diff --git a/test/unit/org/apache/cassandra/transport/EarlyAuthenticationTest.java b/test/unit/org/apache/cassandra/transport/EarlyAuthenticationTest.java index ed98140b9b5e..a581086c7645 100644 --- a/test/unit/org/apache/cassandra/transport/EarlyAuthenticationTest.java +++ b/test/unit/org/apache/cassandra/transport/EarlyAuthenticationTest.java @@ -84,23 +84,23 @@ public void initNetwork() throws IOException, TimeoutException }); } - private EncryptionOptions clientEncryptionOptions(boolean presentClientCertificate) + private EncryptionOptions.ClientEncryptionOptions clientEncryptionOptions(boolean presentClientCertificate) { - EncryptionOptions encryptionOptions = new EncryptionOptions() - .withEnabled(true) - .withRequireClientAuth(EncryptionOptions.ClientAuth.OPTIONAL) - .withTrustStore(TlsTestUtils.CLIENT_TRUSTSTORE_PATH) - .withTrustStorePassword(TlsTestUtils.CLIENT_TRUSTSTORE_PASSWORD) - .withSslContextFactory(new ParameterizedClass(SimpleClientSslContextFactory.class.getName())); + EncryptionOptions.ClientEncryptionOptions.Builder builder = new EncryptionOptions.ClientEncryptionOptions.Builder(); + builder.withEnabled(true) + .withRequireClientAuth(EncryptionOptions.ClientEncryptionOptions.ClientAuth.OPTIONAL) + .withTrustStore(TlsTestUtils.CLIENT_TRUSTSTORE_PATH) + .withTrustStorePassword(TlsTestUtils.CLIENT_TRUSTSTORE_PASSWORD) + .withSslContextFactory(new ParameterizedClass(SimpleClientSslContextFactory.class.getName())); if (presentClientCertificate) { - encryptionOptions = encryptionOptions.withKeyStore(TlsTestUtils.CLIENT_SPIFFE_KEYSTORE_PATH) - .withStoreType("JKS") - .withKeyStorePassword(TlsTestUtils.CLIENT_SPIFFE_KEYSTORE_PASSWORD); + builder.withKeyStore(TlsTestUtils.CLIENT_SPIFFE_KEYSTORE_PATH) + .withStoreType("JKS") + .withKeyStorePassword(TlsTestUtils.CLIENT_SPIFFE_KEYSTORE_PASSWORD); } - return new EncryptionOptions(encryptionOptions); + return new EncryptionOptions.ClientEncryptionOptions(builder.build()); } @Test @@ -180,6 +180,5 @@ public Consumer expectAuthenticationError(final String expecte } }; } - } diff --git a/test/unit/org/apache/cassandra/transport/MessagePayloadTest.java b/test/unit/org/apache/cassandra/transport/MessagePayloadTest.java index a50174bd8702..42c6cbd021ba 100644 --- a/test/unit/org/apache/cassandra/transport/MessagePayloadTest.java +++ b/test/unit/org/apache/cassandra/transport/MessagePayloadTest.java @@ -127,7 +127,7 @@ public void testMessagePayloadBeta() throws Throwable nativePort, ProtocolVersion.V5, true, - new EncryptionOptions()); + new EncryptionOptions.ClientEncryptionOptions()); try { client.connect(false); diff --git a/test/unit/org/apache/cassandra/transport/SimpleClientSslContextFactory.java b/test/unit/org/apache/cassandra/transport/SimpleClientSslContextFactory.java index 1a6871716a53..468c9cbc17b3 100644 --- a/test/unit/org/apache/cassandra/transport/SimpleClientSslContextFactory.java +++ b/test/unit/org/apache/cassandra/transport/SimpleClientSslContextFactory.java @@ -30,12 +30,12 @@ import org.apache.cassandra.config.EncryptionOptions; import org.apache.cassandra.security.FileBasedSslContextFactory; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.NOT_REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.NOT_REQUIRED; /** * A custom implementation of {@link FileBasedSslContextFactory} to be used by tests utilizing {@link SimpleClient}. *

- * Provides a subtly different implementation of {@link #createNettySslContext(EncryptionOptions.ClientAuth, SocketType, CipherSuiteFilter)} + * Provides a subtly different implementation of {@link #createNettySslContext(EncryptionOptions.ClientEncryptionOptions.ClientAuth, SocketType, CipherSuiteFilter)} * that only configures an {@link SslContext} for clients and most importantly only configures a key manager if an * outbound keystore is configured, where the existing implementation always does this. This is useful for tests * that try to create a client that uses encryption but does not provide a certificate. @@ -49,7 +49,7 @@ public SimpleClientSslContextFactory(Map parameters) } @Override - public SSLContext createJSSESslContext(EncryptionOptions.ClientAuth clientAuth) throws SSLException + public SSLContext createJSSESslContext(EncryptionOptions.ClientEncryptionOptions.ClientAuth clientAuth) throws SSLException { TrustManager[] trustManagers = null; if (clientAuth != NOT_REQUIRED) @@ -76,7 +76,7 @@ public SSLContext createJSSESslContext(EncryptionOptions.ClientAuth clientAuth) } @Override - public SslContext createNettySslContext(EncryptionOptions.ClientAuth clientAuth, SocketType socketType, + public SslContext createNettySslContext(EncryptionOptions.ClientEncryptionOptions.ClientAuth clientAuth, SocketType socketType, CipherSuiteFilter cipherFilter) throws SSLException { SslContextBuilder builder = SslContextBuilder.forClient(); diff --git a/test/unit/org/apache/cassandra/transport/TlsTestUtils.java b/test/unit/org/apache/cassandra/transport/TlsTestUtils.java index 30a6054127ca..76faec85b1eb 100644 --- a/test/unit/org/apache/cassandra/transport/TlsTestUtils.java +++ b/test/unit/org/apache/cassandra/transport/TlsTestUtils.java @@ -86,17 +86,18 @@ public class TlsTestUtils public static String CLIENT_TRUSTSTORE_PATH = "test/conf/cassandra_ssl_test.truststore"; public static String CLIENT_TRUSTSTORE_PASSWORD = "cassandra"; - public static EncryptionOptions getClientEncryptionOptions() + public static EncryptionOptions.ClientEncryptionOptions getClientEncryptionOptions() { - return new EncryptionOptions(new EncryptionOptions() + return new EncryptionOptions.ClientEncryptionOptions(new EncryptionOptions.ClientEncryptionOptions.Builder() .withEnabled(true) - .withRequireClientAuth(EncryptionOptions.ClientAuth.OPTIONAL) + .withRequireClientAuth(EncryptionOptions.ClientEncryptionOptions.ClientAuth.OPTIONAL) .withOptional(true) .withKeyStore(SERVER_KEYSTORE_PATH) .withKeyStorePassword(SERVER_KEYSTORE_PASSWORD) .withTrustStore(SERVER_TRUSTSTORE_PATH) .withTrustStorePassword(SERVER_TRUSTSTORE_PASSWORD) - .withRequireEndpointVerification(false)); + .withRequireEndpointVerification(false) + .build()); } public static void configureWithMutualTlsWithPasswordFallbackAuthenticator(Config config) @@ -129,7 +130,7 @@ public static SSLOptions getSSLOptions(boolean provideClientCert) throws SSLExce { return RemoteEndpointAwareJdkSSLOptions.builder() .withSSLContext(getClientSslContextFactory(provideClientCert) - .createJSSESslContext(EncryptionOptions.ClientAuth.OPTIONAL)) + .createJSSESslContext(EncryptionOptions.ClientEncryptionOptions.ClientAuth.OPTIONAL)) .build(); } @@ -139,7 +140,7 @@ public static SSLOptions getSSLOptions(Path keystorePath, Path truststorePath) t { return RemoteEndpointAwareJdkSSLOptions.builder() .withSSLContext(getClientSslContextFactory(keystorePath, truststorePath) - .createJSSESslContext(EncryptionOptions.ClientAuth.OPTIONAL)) + .createJSSESslContext(EncryptionOptions.ClientEncryptionOptions.ClientAuth.OPTIONAL)) .build(); } catch (SSLException e) diff --git a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsTransport.java b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsTransport.java index cf629998225b..ccdf0a53b207 100644 --- a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsTransport.java +++ b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsTransport.java @@ -44,31 +44,32 @@ public SettingsTransport(TOptions options, SettingsCredentials credentials) this.credentials = credentials; } - public EncryptionOptions getEncryptionOptions() + public EncryptionOptions.ClientEncryptionOptions getEncryptionOptions() { - EncryptionOptions encOptions = new EncryptionOptions().applyConfig(); + EncryptionOptions.ClientEncryptionOptions encOptions = new EncryptionOptions.ClientEncryptionOptions().applyConfig(); if (options.trustStore.present()) { - encOptions = encOptions - .withEnabled(true) - .withTrustStore(options.trustStore.value()) - .withTrustStorePassword(options.trustStorePw.setByUser() ? options.trustStorePw.value() : credentials.transportTruststorePassword) - .withAlgorithm(options.alg.value()) - .withProtocol(options.protocol.value()) - .withCipherSuites(options.ciphers.value().split(",")); + EncryptionOptions.Builder encOptionsBuilder = new EncryptionOptions.ClientEncryptionOptions.Builder(encOptions) + .withEnabled(true) + .withTrustStore(options.trustStore.value()) + .withTrustStorePassword(options.trustStorePw.setByUser() ? options.trustStorePw.value() : credentials.transportTruststorePassword) + .withAlgorithm(options.alg.value()) + .withProtocol(options.protocol.value()) + .withCipherSuites(options.ciphers.value().split(",")); + if (options.keyStore.present()) { - encOptions = encOptions - .withKeyStore(options.keyStore.value()) - .withKeyStorePassword(options.keyStorePw.setByUser() ? options.keyStorePw.value() : credentials.transportKeystorePassword); + encOptionsBuilder.withKeyStore(options.keyStore.value()) + .withKeyStorePassword(options.keyStorePw.setByUser() ? options.keyStorePw.value() : credentials.transportKeystorePassword); } else { // mandatory for SSLFactory.createSSLContext(), see CASSANDRA-9325 - encOptions = encOptions - .withKeyStore(encOptions.truststore) - .withKeyStorePassword(encOptions.truststore_password != null ? encOptions.truststore_password : credentials.transportTruststorePassword); + encOptionsBuilder.withKeyStore(encOptions.truststore) + .withKeyStorePassword(encOptions.truststore_password != null ? encOptions.truststore_password : credentials.transportTruststorePassword); } + + encOptions = encOptionsBuilder.build(); } return encOptions; } diff --git a/tools/stress/src/org/apache/cassandra/stress/settings/StressSettings.java b/tools/stress/src/org/apache/cassandra/stress/settings/StressSettings.java index 6aea048b4cc0..f81c4a9787c9 100644 --- a/tools/stress/src/org/apache/cassandra/stress/settings/StressSettings.java +++ b/tools/stress/src/org/apache/cassandra/stress/settings/StressSettings.java @@ -139,7 +139,7 @@ public JavaDriverClient getJavaDriverClient(String keyspace) if (client != null) return client; - EncryptionOptions encOptions = transport.getEncryptionOptions(); + EncryptionOptions.ClientEncryptionOptions encOptions = transport.getEncryptionOptions(); JavaDriverClient c = new JavaDriverClient(this, node.nodes, port.nativePort, encOptions); c.connect(mode.compression()); if (keyspace != null) diff --git a/tools/stress/src/org/apache/cassandra/stress/util/JavaDriverClient.java b/tools/stress/src/org/apache/cassandra/stress/util/JavaDriverClient.java index 3d72828daf73..f2a92fe5aa7d 100644 --- a/tools/stress/src/org/apache/cassandra/stress/util/JavaDriverClient.java +++ b/tools/stress/src/org/apache/cassandra/stress/util/JavaDriverClient.java @@ -41,7 +41,7 @@ import org.apache.cassandra.security.SSLFactory; import org.apache.cassandra.stress.settings.StressSettings; -import static org.apache.cassandra.config.EncryptionOptions.ClientAuth.REQUIRED; +import static org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions.ClientAuth.REQUIRED; public class JavaDriverClient { @@ -60,7 +60,7 @@ public class JavaDriverClient public final int connectionsPerHost; private final ProtocolVersion protocolVersion; - private final EncryptionOptions encryptionOptions; + private final EncryptionOptions.ClientEncryptionOptions encryptionOptions; private Cluster cluster; private Session session; private final LoadBalancingPolicy loadBalancingPolicy; @@ -69,15 +69,15 @@ public class JavaDriverClient public JavaDriverClient(StressSettings settings, String host, int port) { - this(settings, Collections.singletonList(host), port, new EncryptionOptions()); + this(settings, Collections.singletonList(host), port, new EncryptionOptions.ClientEncryptionOptions()); } public JavaDriverClient(StressSettings settings, List hosts, int port) { - this(settings, hosts, port, new EncryptionOptions()); + this(settings, hosts, port, new EncryptionOptions.ClientEncryptionOptions()); } - public JavaDriverClient(StressSettings settings, List hosts, int port, EncryptionOptions encryptionOptions) + public JavaDriverClient(StressSettings settings, List hosts, int port, EncryptionOptions.ClientEncryptionOptions encryptionOptions) { this.protocolVersion = settings.mode.protocolVersion; this.hosts = hosts; @@ -85,7 +85,7 @@ public JavaDriverClient(StressSettings settings, List hosts, int port, E this.username = settings.mode.username; this.password = settings.mode.password; this.authProvider = settings.mode.authProvider; - this.encryptionOptions = new EncryptionOptions(encryptionOptions).applyConfig(); + this.encryptionOptions = new EncryptionOptions.ClientEncryptionOptions(encryptionOptions).applyConfig(); this.loadBalancingPolicy = loadBalancingPolicy(settings); this.connectionsPerHost = settings.mode.connectionsPerHost == null ? 8 : settings.mode.connectionsPerHost;