cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jrwest <...@git.apache.org>
Subject [GitHub] cassandra-dtest pull request #37: Add tests for CASSANDRA-14145
Date Tue, 18 Sep 2018 00:35:39 GMT
Github user jrwest commented on a diff in the pull request:

    https://github.com/apache/cassandra-dtest/pull/37#discussion_r218267799
  
    --- Diff: repair_tests/incremental_repair_test.py ---
    @@ -918,3 +931,196 @@ def test_subrange(self):
             self.assertRepairedAndUnrepaired(node1, 'ks')
             self.assertRepairedAndUnrepaired(node2, 'ks')
             self.assertRepairedAndUnrepaired(node3, 'ks')
    +
    +    @since('4.0')
    +    def test_repaired_tracking_with_partition_deletes(self):
    +        """
    +        check that when an tracking repaired data status following a digest mismatch,
    +        repaired data mismatches are marked as unconfirmed as we may skip sstables
    +        after the partition delete are encountered.
    +        @jira_ticket CASSANDRA-14145
    +        """
    +        session, node1, node2 = self.setup_for_repaired_data_tracking()
    +        stmt = SimpleStatement("INSERT INTO ks.tbl (k, c, v) VALUES (%s, %s, %s)")
    +        stmt.consistency_level = ConsistencyLevel.ALL
    +        for i in range(10):
    +            session.execute(stmt, (i, i, i))
    +
    +        for node in self.cluster.nodelist():
    +            node.flush()
    +            self.assertNoRepairedSSTables(node, 'ks')
    +
    +        node1.repair(options=['ks'])
    +        node2.stop(wait_other_notice=True)
    +
    +        session.execute("delete from ks.tbl where k = 5")
    +
    +        node1.flush()
    +        node2.start(wait_other_notice=True)
    +
    +        # expect unconfirmed inconsistencies as the partition deletes cause some sstables
to be skipped
    +        with JolokiaAgent(node1) as jmx:
    +            self.query_and_check_repaired_mismatches(jmx, session, "SELECT * FROM ks.tbl
WHERE k = 5",
    +                                                     expect_unconfirmed_inconsistencies=True)
    +            self.query_and_check_repaired_mismatches(jmx, session, "SELECT * FROM ks.tbl
WHERE k = 5 AND c = 5",
    +                                                     expect_unconfirmed_inconsistencies=True)
    +            # no digest reads for range queries so blocking read repair metric isn't
incremented
    +            # *all* sstables are read for partition ranges too, and as the repaired set
is still in sync there should
    +            # be no inconsistencies
    +            self.query_and_check_repaired_mismatches(jmx, session, "SELECT * FROM ks.tbl",
expect_read_repair=False)
    +
    +    @since('4.0')
    +    def test_repaired_tracking_with_varying_sstable_sets(self):
    +        """
    +        verify that repaired data digests are computed over the merged data for each
replica
    +        and that the particular number of sstables on each doesn't affect the comparisons
    +        both replicas start with the same repaired set, comprising 2 sstables. node1's
is
    +        then compacted and additional unrepaired data added (which overwrites some in
the
    +        repaired set). We expect the repaired digests to still match as the tracking
will
    +        force all sstables containing the partitions to be read
    +        there are two variants of this, for single partition slice & names reads
and range reads
    +        @jira_ticket CASSANDRA-14145
    +        """
    +        session, node1, node2 = self.setup_for_repaired_data_tracking()
    +        stmt = SimpleStatement("INSERT INTO ks.tbl (k, c, v) VALUES (%s, %s, %s)")
    +        stmt.consistency_level = ConsistencyLevel.ALL
    +        for i in range(10):
    +            session.execute(stmt, (i, i, i))
    +
    +        for node in self.cluster.nodelist():
    +            node.flush()
    +
    +        for i in range(10,20):
    +            session.execute(stmt, (i, i, i))
    +
    +        for node in self.cluster.nodelist():
    +            node.flush()
    +            self.assertNoRepairedSSTables(node, 'ks')
    +
    +        node1.repair(options=['ks'])
    +        node2.stop(wait_other_notice=True)
    +
    +        session.execute("insert into ks.tbl (k, c, v) values (5, 5, 55)")
    +        session.execute("insert into ks.tbl (k, c, v) values (15, 15, 155)")
    +        node1.flush()
    +        node1.compact()
    +        node1.compact()
    +        node2.start(wait_other_notice=True)
    +
    +        # we don't expect any inconsistencies as all repaired data is read on both replicas
    +        with JolokiaAgent(node1) as jmx:
    +            self.query_and_check_repaired_mismatches(jmx, session, "SELECT * FROM ks.tbl
WHERE k = 5")
    +            self.query_and_check_repaired_mismatches(jmx, session, "SELECT * FROM ks.tbl
WHERE k = 5 AND c = 5")
    +            # no digest reads for range queries so read repair metric isn't incremented
    +            self.query_and_check_repaired_mismatches(jmx, session, "SELECT * FROM ks.tbl",
expect_read_repair=False)
    +
    +    @since('4.0')
    +    def test_repaired_tracking_with_mismatching_replicas(self):
    +        """
    +        there are two variants of this, for single partition slice & names reads
and range reads
    --- End diff --
    
    This test would benefit from an in-depth description like the ones you added to the other
tests. 


---

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


Mime
View raw message