Provide a JMX call to sync schema with local storage

patch by Aleksey Yeschenko; reviewed by Sylvain Lebresne for
CASSANDRA-13954
1 file changed
tree: a711b859c07c1f3030e3fa9ec1735fffcc37f2e5
  1. bin/
  2. byteman/
  3. cassandra-thrift/
  4. conf/
  5. cqlsh_tests/
  6. doxygen/
  7. lib/
  8. meta_tests/
  9. plugins/
  10. repair_tests/
  11. stress_profiles/
  12. thrift_bindings/
  13. tools/
  14. upgrade_tests/
  15. .gitignore
  16. .isort.cfg
  17. .travis.yml
  18. auth_test.py
  19. batch_test.py
  20. bootstrap_test.py
  21. cdc_test.py
  22. cfid_test.py
  23. commitlog_test.py
  24. compaction_test.py
  25. compression_test.py
  26. concurrent_schema_changes_test.py
  27. configuration_test.py
  28. consistency_test.py
  29. consistent_bootstrap_test.py
  30. CONTRIBUTING.md
  31. counter_tests.py
  32. cql_prepared_test.py
  33. cql_tests.py
  34. cql_tracing_test.py
  35. delete_insert_test.py
  36. deletion_test.py
  37. disk_balance_test.py
  38. dtest.py
  39. env.txt
  40. findlibjemalloc.sh
  41. global_row_key_cache_test.py
  42. hintedhandoff_test.py
  43. INSTALL.md
  44. internode_ssl_test.py
  45. jmx_auth_test.py
  46. jmx_test.py
  47. json_test.py
  48. json_tools_test.py
  49. largecolumn_test.py
  50. LICENSE
  51. license.txt
  52. linter_check.sh
  53. materialized_views_test.py
  54. metadata_tests.py
  55. mixed_version_test.py
  56. multidc_putget_test.py
  57. native_transport_ssl_test.py
  58. nodetool_test.py
  59. offline_tools_test.py
  60. paging_test.py
  61. paxos_tests.py
  62. pending_range_test.py
  63. prepared_statements_test.py
  64. pushed_notifications_test.py
  65. putget_test.py
  66. range_ghost_test.py
  67. read_failures_test.py
  68. read_repair_test.py
  69. README.md
  70. rebuild_test.py
  71. replace_address_test.py
  72. replication_test.py
  73. requirements.txt
  74. run_dtests.py
  75. schema_metadata_test.py
  76. schema_test.py
  77. scrub_test.py
  78. secondary_indexes_test.py
  79. snapshot_test.py
  80. snitch_test.py
  81. sslnodetonode_test.py
  82. sstable_generation_loading_test.py
  83. sstablesplit_test.py
  84. sstableutil_test.py
  85. stress_tool_test.py
  86. super_column_cache_test.py
  87. super_counter_test.py
  88. thrift_hsha_test.py
  89. thrift_tests.py
  90. token_generator_test.py
  91. topology_test.py
  92. ttl_test.py
  93. udtencoding_test.py
  94. upgrade_crc_check_chance_test.py
  95. upgrade_internal_auth_test.py
  96. user_functions_test.py
  97. user_types_test.py
  98. wide_rows_test.py
  99. write_failures_test.py
README.md

Cassandra Distributed Tests

Tests for Apache Cassandra clusters.

Prerequisites

An up to date copy of ccm should be installed for starting and stopping Cassandra. The tests are run using nosetests. These tests require the datastax python driver. A few tests still require the deprecated python CQL over thrift driver.

Usage

The tests are run by nosetests. The only thing the framework needs to know is the location of the (compiled) sources for Cassandra. There are two options:

Use existing sources:

CASSANDRA_DIR=~/path/to/cassandra nosetests

Use ccm ability to download/compile released sources from archives.apache.org:

CASSANDRA_VERSION=1.0.0 nosetests

A convenient option if tests are regularly run against the same existing directory is to set a default_dir in ~/.cassandra-dtest. Create the file and set it to something like:

[main]
default_dir=~/path/to/cassandra

The tests will use this directory by default, avoiding the need for any environment variable (that still will have precedence if given though).

Existing tests are probably the best place to start to look at how to write tests.

Each test spawns a new fresh cluster and tears it down after the test. If a test fails, the logs for the node are saved in a logs/<timestamp> directory for analysis (it‘s not perfect but has been good enough so far, I’m open to better suggestions).

To run the upgrade tests, you have must both JDK7 and JDK8 installed. Paths to these installations should be defined in the environment variables JAVA7_HOME and JAVA8_HOME, respectively.

Installation Instructions

See more detailed instructions in the included INSTALL file.

Writing Tests

  • Most of the time when you start a cluster with cluster.start(), you'll want to pass in wait_for_binary_proto=True so the call blocks until the cluster is ready to accept CQL connections. We tried setting this to True by default once, but the problems caused there (e.g. when it waited the full timeout time on a node that was deliberately down) were more unpleasant and more difficult to debug than the problems caused by having it False by default.
  • If you‘re using JMX via the tools.jmxutils module, make sure to call remove_perf_disable_shared_mem on the node or nodes you want to query with JMX before starting the nodes. remove_perf_disable_shared_mem disables a JVM option that’s incompatible with JMX (see this JMX ticket). It works by performing a string replacement in the node's Cassandra startup script, so changes will only propagate to the node at startup time.

If you'd like to know what to expect during a code review, please see the included CONTRIBUTING file.