]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] Missing script for soft-wipe capability for Cassandra added
authorTomek Mrugalski <tomasz@isc.org>
Thu, 23 Jun 2016 14:51:46 +0000 (16:51 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Thu, 23 Jun 2016 14:51:46 +0000 (16:51 +0200)
 This is a leftover from github21_cherry merge.

src/share/database/scripts/cql/Makefile.am
src/share/database/scripts/cql/soft_wipe.cql [new file with mode: 0644]

index 400bcfcc6dbeaead23cdb6286f2365d23cfbda51..8a32f195b14c12b087b71e098da1460d7c82d701 100644 (file)
@@ -5,3 +5,5 @@ sqlscripts_DATA = dhcpdb_create.cql
 sqlscripts_DATA += dhcpdb_drop.cql
 
 EXTRA_DIST = ${sqlscripts_DATA}
+
+noinst_EXTRA_DIST = soft_wipe.cql
diff --git a/src/share/database/scripts/cql/soft_wipe.cql b/src/share/database/scripts/cql/soft_wipe.cql
new file mode 100644 (file)
index 0000000..e3dd6c4
--- /dev/null
@@ -0,0 +1,24 @@
+-- Copyright (C) 2016 Internet Systems Consortium.
+--
+-- This Source Code Form is subject to the terms of the Mozilla Public
+-- License, v. 2.0. If a copy of the MPL was not distributed with this
+-- file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+-- This is the soft wipe script for CQL (Cassandra). This capability may be
+-- used when running Cassandra unit-tests.
+--
+-- In some deployments (e.g. in case of Tomek's dev system) Cassandra tests take
+-- a very long time to execute. This was traced back to slow table/indexes
+-- creation/deletion. With full wipe and recreation of all structures, it
+-- took over 60 seconds for each test to execute. To avoid this problem, a
+-- feature called soft-wipe has been implemented. If enabled, it does not
+-- remove the structures, just the data from essential tables. To enable
+-- it set KEA_TEST_CASSANDRA_WIPE environment variable to 'soft'. Make sure
+-- that the database schema is set up properly before running in soft-wipe
+-- mode.
+
+TRUNCATE TABLE lease4;
+TRUNCATE TABLE lease6;
+TRUNCATE TABLE hosts;
+TRUNCATE TABLE dhcp4_options;
+TRUNCATE TABLE dhcp6_options;