You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by pa...@apache.org on 2018/02/11 13:26:30 UTC

cassandra-dtest git commit: Add tests for CASSANDRA-14092: properly handle overflow of localExpirationTime

Repository: cassandra-dtest
Updated Branches:
  refs/heads/master 7c05a111a -> 781c4ecdf


Add tests for CASSANDRA-14092: properly handle overflow of localExpirationTime


Project: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/commit/781c4ecd
Tree: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/tree/781c4ecd
Diff: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/diff/781c4ecd

Branch: refs/heads/master
Commit: 781c4ecdf67bb63f508e8af70599b45b896c28ae
Parents: 7c05a11
Author: Paulo Motta <pa...@gmail.com>
Authored: Fri Jan 26 19:16:48 2018 -0200
Committer: Paulo Motta <pa...@apache.org>
Committed: Sat Feb 10 15:31:26 2018 -0200

----------------------------------------------------------------------
 scrub_test.py                                   |   9 +-
 .../2.1/ks-ttl_table-ka-1-CompressionInfo.db    | Bin 0 -> 43 bytes
 sstables/ttl_test/2.1/ks-ttl_table-ka-1-Data.db | Bin 0 -> 67 bytes
 .../ttl_test/2.1/ks-ttl_table-ka-1-Digest.sha1  |   1 +
 .../ttl_test/2.1/ks-ttl_table-ka-1-Filter.db    | Bin 0 -> 16 bytes
 .../ttl_test/2.1/ks-ttl_table-ka-1-Index.db     | Bin 0 -> 18 bytes
 .../2.1/ks-ttl_table-ka-1-Statistics.db         | Bin 0 -> 4450 bytes
 .../ttl_test/2.1/ks-ttl_table-ka-1-Summary.db   | Bin 0 -> 92 bytes
 sstables/ttl_test/2.1/ks-ttl_table-ka-1-TOC.txt |   8 ++
 .../2.1/ks-ttl_table-ka-2-CompressionInfo.db    | Bin 0 -> 43 bytes
 sstables/ttl_test/2.1/ks-ttl_table-ka-2-Data.db | Bin 0 -> 61 bytes
 .../ttl_test/2.1/ks-ttl_table-ka-2-Digest.sha1  |   1 +
 .../ttl_test/2.1/ks-ttl_table-ka-2-Filter.db    | Bin 0 -> 176 bytes
 .../ttl_test/2.1/ks-ttl_table-ka-2-Index.db     | Bin 0 -> 18 bytes
 .../2.1/ks-ttl_table-ka-2-Statistics.db         | Bin 0 -> 4454 bytes
 .../ttl_test/2.1/ks-ttl_table-ka-2-Summary.db   | Bin 0 -> 92 bytes
 sstables/ttl_test/2.1/ks-ttl_table-ka-2-TOC.txt |   8 ++
 .../ttl_test/3.0/mc-1-big-CompressionInfo.db    | Bin 0 -> 43 bytes
 sstables/ttl_test/3.0/mc-1-big-Data.db          | Bin 0 -> 36 bytes
 sstables/ttl_test/3.0/mc-1-big-Digest.crc32     |   1 +
 sstables/ttl_test/3.0/mc-1-big-Filter.db        | Bin 0 -> 16 bytes
 sstables/ttl_test/3.0/mc-1-big-Index.db         | Bin 0 -> 8 bytes
 sstables/ttl_test/3.0/mc-1-big-Statistics.db    | Bin 0 -> 4631 bytes
 sstables/ttl_test/3.0/mc-1-big-Summary.db       | Bin 0 -> 56 bytes
 sstables/ttl_test/3.0/mc-1-big-TOC.txt          |   8 ++
 .../ttl_test/3.0/mc-2-big-CompressionInfo.db    | Bin 0 -> 51 bytes
 sstables/ttl_test/3.0/mc-2-big-Data.db          | Bin 0 -> 51 bytes
 sstables/ttl_test/3.0/mc-2-big-Digest.crc32     |   1 +
 sstables/ttl_test/3.0/mc-2-big-Filter.db        | Bin 0 -> 16 bytes
 sstables/ttl_test/3.0/mc-2-big-Index.db         | Bin 0 -> 8 bytes
 sstables/ttl_test/3.0/mc-2-big-Statistics.db    | Bin 0 -> 4647 bytes
 sstables/ttl_test/3.0/mc-2-big-Summary.db       | Bin 0 -> 56 bytes
 sstables/ttl_test/3.0/mc-2-big-TOC.txt          |   8 ++
 .../ttl_test/3.11/mc-1-big-CompressionInfo.db   | Bin 0 -> 43 bytes
 sstables/ttl_test/3.11/mc-1-big-Data.db         | Bin 0 -> 36 bytes
 sstables/ttl_test/3.11/mc-1-big-Digest.crc32    |   1 +
 sstables/ttl_test/3.11/mc-1-big-Filter.db       | Bin 0 -> 16 bytes
 sstables/ttl_test/3.11/mc-1-big-Index.db        | Bin 0 -> 8 bytes
 sstables/ttl_test/3.11/mc-1-big-Statistics.db   | Bin 0 -> 4631 bytes
 sstables/ttl_test/3.11/mc-1-big-Summary.db      | Bin 0 -> 56 bytes
 sstables/ttl_test/3.11/mc-1-big-TOC.txt         |   8 ++
 .../ttl_test/3.11/mc-2-big-CompressionInfo.db   | Bin 0 -> 51 bytes
 sstables/ttl_test/3.11/mc-2-big-Data.db         | Bin 0 -> 51 bytes
 sstables/ttl_test/3.11/mc-2-big-Digest.crc32    |   1 +
 sstables/ttl_test/3.11/mc-2-big-Filter.db       | Bin 0 -> 16 bytes
 sstables/ttl_test/3.11/mc-2-big-Index.db        | Bin 0 -> 8 bytes
 sstables/ttl_test/3.11/mc-2-big-Statistics.db   | Bin 0 -> 4647 bytes
 sstables/ttl_test/3.11/mc-2-big-Summary.db      | Bin 0 -> 56 bytes
 sstables/ttl_test/3.11/mc-2-big-TOC.txt         |   8 ++
 thrift_test.py                                  |  42 +++++-
 ttl_test.py                                     | 137 ++++++++++++++++++-
 51 files changed, 232 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/scrub_test.py
----------------------------------------------------------------------
diff --git a/scrub_test.py b/scrub_test.py
index 2df11c7..3d50d70 100644
--- a/scrub_test.py
+++ b/scrub_test.py
@@ -110,7 +110,7 @@ class TestHelper(Tester):
         if not common.is_win():  # nodetool always prints out on windows
             assert_length_equal(response, 0)  # nodetool does not print anything unless there is an error
 
-    def launch_standalone_scrub(self, ks, cf):
+    def launch_standalone_scrub(self, ks, cf, reinsert_overflowed_ttl=False, no_validate=False):
         """
         Launch the standalone scrub
         """
@@ -119,7 +119,12 @@ class TestHelper(Tester):
         scrub_bin = node1.get_tool('sstablescrub')
         logger.debug(scrub_bin)
 
-        args = [scrub_bin, ks, cf]
+        args = [scrub_bin]
+        if reinsert_overflowed_ttl:
+            args += ['--reinsert-overflowed-ttl']
+        if no_validate:
+            args += ['--no-validate']
+        args += [ks, cf] if reinsert_overflowed_ttl else [ks, cf]
         p = subprocess.Popen(args, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
         out, err = p.communicate()
         logger.debug(out.decode("utf-8"))

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/2.1/ks-ttl_table-ka-1-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/2.1/ks-ttl_table-ka-1-CompressionInfo.db b/sstables/ttl_test/2.1/ks-ttl_table-ka-1-CompressionInfo.db
new file mode 100644
index 0000000..908f3b1
Binary files /dev/null and b/sstables/ttl_test/2.1/ks-ttl_table-ka-1-CompressionInfo.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Data.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Data.db b/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Data.db
new file mode 100644
index 0000000..e8988bd
Binary files /dev/null and b/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Data.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Digest.sha1
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Digest.sha1 b/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Digest.sha1
new file mode 100644
index 0000000..9bc6ae9
--- /dev/null
+++ b/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Digest.sha1
@@ -0,0 +1 @@
+1496387912
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Filter.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Filter.db b/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Filter.db
new file mode 100644
index 0000000..00a88b4
Binary files /dev/null and b/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Filter.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Index.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Index.db b/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Index.db
new file mode 100644
index 0000000..c3b42d8
Binary files /dev/null and b/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Index.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Statistics.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Statistics.db b/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Statistics.db
new file mode 100644
index 0000000..6bd0b99
Binary files /dev/null and b/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Statistics.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Summary.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Summary.db b/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Summary.db
new file mode 100644
index 0000000..6bfc8aa
Binary files /dev/null and b/sstables/ttl_test/2.1/ks-ttl_table-ka-1-Summary.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/2.1/ks-ttl_table-ka-1-TOC.txt
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/2.1/ks-ttl_table-ka-1-TOC.txt b/sstables/ttl_test/2.1/ks-ttl_table-ka-1-TOC.txt
new file mode 100644
index 0000000..84b22da
--- /dev/null
+++ b/sstables/ttl_test/2.1/ks-ttl_table-ka-1-TOC.txt
@@ -0,0 +1,8 @@
+Digest.sha1
+Filter.db
+CompressionInfo.db
+Index.db
+Summary.db
+Statistics.db
+Data.db
+TOC.txt

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/2.1/ks-ttl_table-ka-2-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/2.1/ks-ttl_table-ka-2-CompressionInfo.db b/sstables/ttl_test/2.1/ks-ttl_table-ka-2-CompressionInfo.db
new file mode 100644
index 0000000..54b0b18
Binary files /dev/null and b/sstables/ttl_test/2.1/ks-ttl_table-ka-2-CompressionInfo.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Data.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Data.db b/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Data.db
new file mode 100644
index 0000000..22702a3
Binary files /dev/null and b/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Data.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Digest.sha1
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Digest.sha1 b/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Digest.sha1
new file mode 100644
index 0000000..bddcb01
--- /dev/null
+++ b/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Digest.sha1
@@ -0,0 +1 @@
+163451363
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Filter.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Filter.db b/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Filter.db
new file mode 100644
index 0000000..dfcab1f
Binary files /dev/null and b/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Filter.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Index.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Index.db b/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Index.db
new file mode 100644
index 0000000..c3b42d8
Binary files /dev/null and b/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Index.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Statistics.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Statistics.db b/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Statistics.db
new file mode 100644
index 0000000..1af89e8
Binary files /dev/null and b/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Statistics.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Summary.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Summary.db b/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Summary.db
new file mode 100644
index 0000000..6bfc8aa
Binary files /dev/null and b/sstables/ttl_test/2.1/ks-ttl_table-ka-2-Summary.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/2.1/ks-ttl_table-ka-2-TOC.txt
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/2.1/ks-ttl_table-ka-2-TOC.txt b/sstables/ttl_test/2.1/ks-ttl_table-ka-2-TOC.txt
new file mode 100644
index 0000000..09ee8f7
--- /dev/null
+++ b/sstables/ttl_test/2.1/ks-ttl_table-ka-2-TOC.txt
@@ -0,0 +1,8 @@
+Data.db
+Index.db
+Summary.db
+CompressionInfo.db
+Filter.db
+TOC.txt
+Digest.sha1
+Statistics.db

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.0/mc-1-big-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.0/mc-1-big-CompressionInfo.db b/sstables/ttl_test/3.0/mc-1-big-CompressionInfo.db
new file mode 100644
index 0000000..b6c6220
Binary files /dev/null and b/sstables/ttl_test/3.0/mc-1-big-CompressionInfo.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.0/mc-1-big-Data.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.0/mc-1-big-Data.db b/sstables/ttl_test/3.0/mc-1-big-Data.db
new file mode 100644
index 0000000..1a19484
Binary files /dev/null and b/sstables/ttl_test/3.0/mc-1-big-Data.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.0/mc-1-big-Digest.crc32
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.0/mc-1-big-Digest.crc32 b/sstables/ttl_test/3.0/mc-1-big-Digest.crc32
new file mode 100644
index 0000000..32324c8
--- /dev/null
+++ b/sstables/ttl_test/3.0/mc-1-big-Digest.crc32
@@ -0,0 +1 @@
+3686576784
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.0/mc-1-big-Filter.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.0/mc-1-big-Filter.db b/sstables/ttl_test/3.0/mc-1-big-Filter.db
new file mode 100644
index 0000000..f9c2d6e
Binary files /dev/null and b/sstables/ttl_test/3.0/mc-1-big-Filter.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.0/mc-1-big-Index.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.0/mc-1-big-Index.db b/sstables/ttl_test/3.0/mc-1-big-Index.db
new file mode 100644
index 0000000..b077026
Binary files /dev/null and b/sstables/ttl_test/3.0/mc-1-big-Index.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.0/mc-1-big-Statistics.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.0/mc-1-big-Statistics.db b/sstables/ttl_test/3.0/mc-1-big-Statistics.db
new file mode 100644
index 0000000..6a8f3b4
Binary files /dev/null and b/sstables/ttl_test/3.0/mc-1-big-Statistics.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.0/mc-1-big-Summary.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.0/mc-1-big-Summary.db b/sstables/ttl_test/3.0/mc-1-big-Summary.db
new file mode 100644
index 0000000..4547a94
Binary files /dev/null and b/sstables/ttl_test/3.0/mc-1-big-Summary.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.0/mc-1-big-TOC.txt
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.0/mc-1-big-TOC.txt b/sstables/ttl_test/3.0/mc-1-big-TOC.txt
new file mode 100644
index 0000000..8a21a81
--- /dev/null
+++ b/sstables/ttl_test/3.0/mc-1-big-TOC.txt
@@ -0,0 +1,8 @@
+CompressionInfo.db
+Index.db
+Statistics.db
+TOC.txt
+Filter.db
+Data.db
+Summary.db
+Digest.crc32

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.0/mc-2-big-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.0/mc-2-big-CompressionInfo.db b/sstables/ttl_test/3.0/mc-2-big-CompressionInfo.db
new file mode 100644
index 0000000..6a21554
Binary files /dev/null and b/sstables/ttl_test/3.0/mc-2-big-CompressionInfo.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.0/mc-2-big-Data.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.0/mc-2-big-Data.db b/sstables/ttl_test/3.0/mc-2-big-Data.db
new file mode 100644
index 0000000..350e2a0
Binary files /dev/null and b/sstables/ttl_test/3.0/mc-2-big-Data.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.0/mc-2-big-Digest.crc32
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.0/mc-2-big-Digest.crc32 b/sstables/ttl_test/3.0/mc-2-big-Digest.crc32
new file mode 100644
index 0000000..37a7440
--- /dev/null
+++ b/sstables/ttl_test/3.0/mc-2-big-Digest.crc32
@@ -0,0 +1 @@
+2832791077
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.0/mc-2-big-Filter.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.0/mc-2-big-Filter.db b/sstables/ttl_test/3.0/mc-2-big-Filter.db
new file mode 100644
index 0000000..f9c2d6e
Binary files /dev/null and b/sstables/ttl_test/3.0/mc-2-big-Filter.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.0/mc-2-big-Index.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.0/mc-2-big-Index.db b/sstables/ttl_test/3.0/mc-2-big-Index.db
new file mode 100644
index 0000000..b077026
Binary files /dev/null and b/sstables/ttl_test/3.0/mc-2-big-Index.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.0/mc-2-big-Statistics.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.0/mc-2-big-Statistics.db b/sstables/ttl_test/3.0/mc-2-big-Statistics.db
new file mode 100644
index 0000000..145166e
Binary files /dev/null and b/sstables/ttl_test/3.0/mc-2-big-Statistics.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.0/mc-2-big-Summary.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.0/mc-2-big-Summary.db b/sstables/ttl_test/3.0/mc-2-big-Summary.db
new file mode 100644
index 0000000..4547a94
Binary files /dev/null and b/sstables/ttl_test/3.0/mc-2-big-Summary.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.0/mc-2-big-TOC.txt
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.0/mc-2-big-TOC.txt b/sstables/ttl_test/3.0/mc-2-big-TOC.txt
new file mode 100644
index 0000000..f6f2c2b
--- /dev/null
+++ b/sstables/ttl_test/3.0/mc-2-big-TOC.txt
@@ -0,0 +1,8 @@
+Summary.db
+TOC.txt
+CompressionInfo.db
+Data.db
+Index.db
+Statistics.db
+Filter.db
+Digest.crc32

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.11/mc-1-big-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.11/mc-1-big-CompressionInfo.db b/sstables/ttl_test/3.11/mc-1-big-CompressionInfo.db
new file mode 100644
index 0000000..b6c6220
Binary files /dev/null and b/sstables/ttl_test/3.11/mc-1-big-CompressionInfo.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.11/mc-1-big-Data.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.11/mc-1-big-Data.db b/sstables/ttl_test/3.11/mc-1-big-Data.db
new file mode 100644
index 0000000..1a19484
Binary files /dev/null and b/sstables/ttl_test/3.11/mc-1-big-Data.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.11/mc-1-big-Digest.crc32
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.11/mc-1-big-Digest.crc32 b/sstables/ttl_test/3.11/mc-1-big-Digest.crc32
new file mode 100644
index 0000000..32324c8
--- /dev/null
+++ b/sstables/ttl_test/3.11/mc-1-big-Digest.crc32
@@ -0,0 +1 @@
+3686576784
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.11/mc-1-big-Filter.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.11/mc-1-big-Filter.db b/sstables/ttl_test/3.11/mc-1-big-Filter.db
new file mode 100644
index 0000000..f9c2d6e
Binary files /dev/null and b/sstables/ttl_test/3.11/mc-1-big-Filter.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.11/mc-1-big-Index.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.11/mc-1-big-Index.db b/sstables/ttl_test/3.11/mc-1-big-Index.db
new file mode 100644
index 0000000..b077026
Binary files /dev/null and b/sstables/ttl_test/3.11/mc-1-big-Index.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.11/mc-1-big-Statistics.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.11/mc-1-big-Statistics.db b/sstables/ttl_test/3.11/mc-1-big-Statistics.db
new file mode 100644
index 0000000..8f244e2
Binary files /dev/null and b/sstables/ttl_test/3.11/mc-1-big-Statistics.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.11/mc-1-big-Summary.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.11/mc-1-big-Summary.db b/sstables/ttl_test/3.11/mc-1-big-Summary.db
new file mode 100644
index 0000000..4547a94
Binary files /dev/null and b/sstables/ttl_test/3.11/mc-1-big-Summary.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.11/mc-1-big-TOC.txt
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.11/mc-1-big-TOC.txt b/sstables/ttl_test/3.11/mc-1-big-TOC.txt
new file mode 100644
index 0000000..c3937ec
--- /dev/null
+++ b/sstables/ttl_test/3.11/mc-1-big-TOC.txt
@@ -0,0 +1,8 @@
+Index.db
+Filter.db
+CompressionInfo.db
+Statistics.db
+TOC.txt
+Data.db
+Summary.db
+Digest.crc32

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.11/mc-2-big-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.11/mc-2-big-CompressionInfo.db b/sstables/ttl_test/3.11/mc-2-big-CompressionInfo.db
new file mode 100644
index 0000000..6a21554
Binary files /dev/null and b/sstables/ttl_test/3.11/mc-2-big-CompressionInfo.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.11/mc-2-big-Data.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.11/mc-2-big-Data.db b/sstables/ttl_test/3.11/mc-2-big-Data.db
new file mode 100644
index 0000000..350e2a0
Binary files /dev/null and b/sstables/ttl_test/3.11/mc-2-big-Data.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.11/mc-2-big-Digest.crc32
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.11/mc-2-big-Digest.crc32 b/sstables/ttl_test/3.11/mc-2-big-Digest.crc32
new file mode 100644
index 0000000..37a7440
--- /dev/null
+++ b/sstables/ttl_test/3.11/mc-2-big-Digest.crc32
@@ -0,0 +1 @@
+2832791077
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.11/mc-2-big-Filter.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.11/mc-2-big-Filter.db b/sstables/ttl_test/3.11/mc-2-big-Filter.db
new file mode 100644
index 0000000..f9c2d6e
Binary files /dev/null and b/sstables/ttl_test/3.11/mc-2-big-Filter.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.11/mc-2-big-Index.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.11/mc-2-big-Index.db b/sstables/ttl_test/3.11/mc-2-big-Index.db
new file mode 100644
index 0000000..b077026
Binary files /dev/null and b/sstables/ttl_test/3.11/mc-2-big-Index.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.11/mc-2-big-Statistics.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.11/mc-2-big-Statistics.db b/sstables/ttl_test/3.11/mc-2-big-Statistics.db
new file mode 100644
index 0000000..5e44bc4
Binary files /dev/null and b/sstables/ttl_test/3.11/mc-2-big-Statistics.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.11/mc-2-big-Summary.db
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.11/mc-2-big-Summary.db b/sstables/ttl_test/3.11/mc-2-big-Summary.db
new file mode 100644
index 0000000..4547a94
Binary files /dev/null and b/sstables/ttl_test/3.11/mc-2-big-Summary.db differ

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/sstables/ttl_test/3.11/mc-2-big-TOC.txt
----------------------------------------------------------------------
diff --git a/sstables/ttl_test/3.11/mc-2-big-TOC.txt b/sstables/ttl_test/3.11/mc-2-big-TOC.txt
new file mode 100644
index 0000000..b4632c3
--- /dev/null
+++ b/sstables/ttl_test/3.11/mc-2-big-TOC.txt
@@ -0,0 +1,8 @@
+Filter.db
+TOC.txt
+Digest.crc32
+Statistics.db
+Summary.db
+Data.db
+Index.db
+CompressionInfo.db

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/thrift_test.py
----------------------------------------------------------------------
diff --git a/thrift_test.py b/thrift_test.py
index 0990d71..4d51f91 100644
--- a/thrift_test.py
+++ b/thrift_test.py
@@ -30,6 +30,8 @@ from thrift_bindings.thrift010.Cassandra import (CfDef, Column, ColumnDef,
                                            SuperColumn)
 from tools.assertions import (assert_all, assert_none, assert_one)
 
+MAX_TTL = 20 * 365 * 24 * 60 * 60  # 20 years in seconds
+
 since = pytest.mark.since
 logger = logging.getLogger(__name__)
 utf8encoder = codecs.getencoder('utf-8')
@@ -80,7 +82,10 @@ class TestThrift(Tester):
         if not self.dtest_config.use_vnodes:
             node1.set_configuration_options(values={'initial_token': 'abcd'})
 
-        fixture_dtest_setup.cluster.start(wait_for_binary_proto=True)
+        # CASSANDRA-14092 - prevent max ttl tests from failing
+        fixture_dtest_setup.cluster.start(jvm_args=['-Dcassandra.expiration_date_overflow_policy=CAP',
+                                                    '-Dcassandra.expiration_overflow_warning_interval_minutes=0'],
+                                          wait_for_binary_proto=True)
         fixture_dtest_setup.cluster.nodelist()[0].watch_log_for("Listening for thrift clients")  # Wait for the thrift port to open
         time.sleep(0.1)
         # this is ugly, but the whole test module is written against a global client
@@ -112,7 +117,8 @@ class TestThrift(Tester):
             Cassandra.CfDef('Keyspace1', 'Indexed2', comparator_type='TimeUUIDType', column_metadata=[Cassandra.ColumnDef(uuid.UUID('00000000-0000-1000-0000-000000000000').bytes, 'LongType', Cassandra.IndexType.KEYS)]),
             Cassandra.CfDef('Keyspace1', 'Indexed3', comparator_type='TimeUUIDType', column_metadata=[Cassandra.ColumnDef(uuid.UUID('00000000-0000-1000-0000-000000000000').bytes, 'UTF8Type', Cassandra.IndexType.KEYS)]),
             Cassandra.CfDef('Keyspace1', 'Indexed4', column_metadata=[Cassandra.ColumnDef(utf8encode('a'), 'LongType', Cassandra.IndexType.KEYS, 'a_index'), Cassandra.ColumnDef(utf8encode('z'), 'UTF8Type')]),
-            Cassandra.CfDef('Keyspace1', 'Expiring', default_time_to_live=2)
+            Cassandra.CfDef('Keyspace1', 'Expiring', default_time_to_live=2),
+            Cassandra.CfDef('Keyspace1', 'ExpiringMaxTTL', default_time_to_live=MAX_TTL)
         ])
 
         keyspace2 = Cassandra.KsDef('Keyspace2', 'org.apache.cassandra.locator.SimpleStrategy', {'replication_factor': '1'},
@@ -2004,13 +2010,35 @@ class TestMutations(TestThrift):
         assert 'Standard1' in [x.name for x in ks1.cf_defs]
 
     def test_insert_ttl(self):
-        """ Test simple insertion of a column with ttl """
+        self._base_insert_ttl()
+
+    def test_insert_max_ttl(self):
+        self._base_insert_ttl(ttl=MAX_TTL, max_default_ttl=False)
+
+    def test_insert_max_default_ttl(self):
+        self._base_insert_ttl(ttl=None, max_default_ttl=True)
+
+    def _base_insert_ttl(self, ttl=5, max_default_ttl=False):
+
+        """ Test simple insertion of a column with max ttl """
         _set_keyspace('Keyspace1')
-        self.truncate_all('Standard1')
+        cf = 'ExpiringMaxTTL' if max_default_ttl else 'Standard1'
+        logprefix = 'default ' if max_default_ttl else ''
+        self.truncate_all(cf)
 
-        column = Column(utf8encode('cttl1'), utf8encode('value1'), 0, 5)
-        client.insert(utf8encode('key1'), ColumnParent('Standard1'), column, ConsistencyLevel.ONE)
-        assert client.get(utf8encode('key1'), ColumnPath('Standard1', column=utf8encode('cttl1')), ConsistencyLevel.ONE).column == column
+        node1 = self.cluster.nodelist()[0]
+        mark = node1.mark_log()
+
+        column = Column(utf8encode('cttl1'), utf8encode('value1'), 0, ttl)
+        expected = Column(utf8encode('cttl1'), utf8encode('value1'), 0, MAX_TTL) if max_default_ttl else column
+        client.insert(utf8encode('key1'), ColumnParent(cf), column, ConsistencyLevel.ONE)
+        assert client.get(utf8encode('key1'), ColumnPath(cf, column=utf8encode('cttl1')), ConsistencyLevel.ONE).column == expected
+
+        if ttl and ttl < MAX_TTL:
+            assert not node1.grep_log("exceeds maximum supported expiration", from_mark=mark), "Should not print max expiration date exceeded warning"
+        else:
+            node1.watch_log_for("Request on table {}.{} with {}ttl of {} seconds exceeds maximum supported expiration"
+                                .format('Keyspace1', cf, logprefix, MAX_TTL), timeout=10)
 
     def test_simple_expiration(self):
         """ Test that column ttled do expires """

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/781c4ecd/ttl_test.py
----------------------------------------------------------------------
diff --git a/ttl_test.py b/ttl_test.py
index b7237d6..4a7ad06 100644
--- a/ttl_test.py
+++ b/ttl_test.py
@@ -1,10 +1,13 @@
+import os
 import time
 import pytest
 import logging
 
 from collections import OrderedDict
+from distutils import dir_util
+from distutils.version import LooseVersion
 
-from cassandra import ConsistencyLevel
+from cassandra import ConsistencyLevel, InvalidRequest
 from cassandra.query import SimpleStatement
 from cassandra.util import sortedset
 
@@ -15,6 +18,8 @@ from tools.assertions import (assert_all, assert_almost_equal, assert_none,
 since = pytest.mark.since
 logger = logging.getLogger(__name__)
 
+from scrub_test import TestHelper
+
 
 @since('2.0')
 class TestTTL(Tester):
@@ -333,6 +338,77 @@ class TestTTL(Tester):
         self.session1.execute("delete from session where id = 'abc' if usr ='abc'")
         assert_row_count(self.session1, 'session', 0)
 
+    @since('2.1')
+    def test_expiration_overflow_policy_cap(self):
+        self._base_expiration_overflow_policy_test(default_ttl=False, policy='CAP')
+
+    @since('2.1')
+    def test_expiration_overflow_policy_cap_default_ttl(self):
+        self._base_expiration_overflow_policy_test(default_ttl=False, policy='CAP')
+
+    @since('3.0')
+    def test_expiration_overflow_policy_capnowarn(self):
+        self._base_expiration_overflow_policy_test(default_ttl=False, policy='CAP_NOWARN')
+
+    @since('3.0')
+    def test_expiration_overflow_policy_capnowarn_default_ttl(self):
+        self._base_expiration_overflow_policy_test(default_ttl=False, policy='CAP_NOWARN')
+
+    @since('2.1')
+    def test_expiration_overflow_policy_reject(self):
+        self._base_expiration_overflow_policy_test(default_ttl=False, policy='REJECT')
+
+    @since('2.1')
+    def test_expiration_overflow_policy_reject_default_ttl(self):
+        self._base_expiration_overflow_policy_test(default_ttl=False, policy='REJECT')
+
+    def _base_expiration_overflow_policy_test(self, default_ttl, policy):
+        """
+        Checks that expiration date overflow policy is correctly applied
+        @jira_ticket CASSANDRA-14092
+        """
+        MAX_TTL = 20 * 365 * 24 * 60 * 60  # 20 years in seconds
+        default_time_to_live = MAX_TTL if default_ttl else None
+        self.prepare(default_time_to_live=default_time_to_live)
+
+        # Restart node with expiration_date_overflow_policy
+        self.cluster.stop()
+        self.cluster.start(jvm_args=['-Dcassandra.expiration_date_overflow_policy={}'.format(policy)], wait_for_binary_proto=True)
+        self.session1 = self.patient_cql_connection(self.cluster.nodelist()[0])
+        self.session1.execute("USE ks;")
+
+        # Try to insert data, should only fail if policy is REJECT
+        query = 'INSERT INTO ttl_table (key, col1) VALUES (%d, %d)' % (1, 1)
+        if not default_time_to_live:
+            query = query + "USING TTL %d" % (MAX_TTL)
+        try:
+            result = self.session1.execute_async(query + ";")
+            result.result()
+            if policy == 'REJECT':
+                self.fail("should throw InvalidRequest")
+            if self.cluster.version() >= '3.0':  # client warn only on 3.0+
+                if policy == 'CAP':
+                    logger.debug("Warning is {}", result.warnings[0])
+                    assert 'exceeds maximum supported expiration' in result.warnings[0], 'Warning not found'
+                else:
+                    assert not result.warnings, "There should be no warnings"
+
+        except InvalidRequest as e:
+            if policy != 'REJECT':
+                self.fail("should not throw InvalidRequest")
+
+        self.cluster.flush()
+        # Data should be present unless policy is reject
+        assert_row_count(self.session1, 'ttl_table', 0 if policy == 'REJECT' else 1)
+
+        # Check that warning is always logged, unless policy is REJECT
+        if policy != 'REJECT':
+            node1 = self.cluster.nodelist()[0]
+            prefix = 'default ' if default_ttl else ''
+            warning = node1.grep_log("Request on table {}.{} with {}ttl of {} seconds exceeds maximum supported expiration"
+                                     .format('ks', 'ttl_table', prefix, MAX_TTL))
+            assert warning, 'Log message should be print for CAP and CAP_NOWARN policy'
+
 
 class TestDistributedTTL(Tester):
     """ Test Time To Live Feature in a distributed environment """
@@ -480,3 +556,62 @@ class TestDistributedTTL(Tester):
         ttl_session2 = session2.execute('SELECT ttl(col1) FROM ttl_table;')
         ttl_session1 = ttl_session1[0][0] - (time.time() - ttl_start)
         assert_almost_equal(ttl_session1, ttl_session2[0][0], error=0.005)
+
+
+class TestRecoverNegativeExpirationDate(TestHelper):
+
+    @since('2.1')
+    def test_recover_negative_expiration_date_sstables_with_scrub(self):
+        """
+        @jira_ticket CASSANDRA-14092
+        Check that row with negative overflowed ttl is recovered by offline scrub
+        """
+        cluster = self.cluster
+        cluster.populate(1).start(wait_for_binary_proto=True)
+        [node] = cluster.nodelist()
+
+        session = self.patient_cql_connection(node)
+        create_ks(session, 'ks', 1)
+        session.execute("DROP TABLE IF EXISTS ttl_table;")
+        query = """
+            CREATE TABLE ttl_table (
+                key int primary key,
+                col1 int,
+                col2 int,
+                col3 int,
+            )
+        """
+        session.execute(query)
+
+        version = '2.1' if self.cluster.version() < LooseVersion('3.0') else \
+                  ('3.0' if self.cluster.version() < LooseVersion('3.11') else '3.11')
+
+        corrupt_sstable_dir = os.path.join('sstables', 'ttl_test', version)
+        table_dir = self.get_table_paths('ttl_table')[0]
+        logger.debug("Copying sstables from {} into {}", corrupt_sstable_dir, table_dir)
+        dir_util.copy_tree(corrupt_sstable_dir, table_dir)
+
+        logger.debug("Load corrupted sstable")
+        node.nodetool('refresh ks ttl_table')
+        node.watch_log_for('Loading new SSTables', timeout=10)
+
+        logger.debug("Check that there are no rows present")
+        assert_row_count(session, 'ttl_table', 0)
+
+        logger.debug("Shutting down node")
+        self.cluster.stop()
+
+        logger.debug("Will run offline scrub on sstable")
+        scrubbed_sstables = self.launch_standalone_scrub('ks', 'ttl_table',
+                                                         reinsert_overflowed_ttl=True,
+                                                         no_validate=True)
+
+        logger.debug("Executed offline scrub on {}", str(scrubbed_sstables))
+
+        logger.debug("Starting node again")
+        self.cluster.start(wait_for_binary_proto=True)
+        session = self.patient_cql_connection(node)
+        session.execute("USE ks;")
+
+        logger.debug("Check that row was recovered")
+        assert_all(session, "SELECT * FROM ttl_table;", [[1, 1, None, None]])


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