You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
alternator, tablets: improve Alternator LSI tablets test
The test test_tablet_alternator_lsi_consistency, checking that Alternator
LSI allow strongly-consistent reads even with tablets, used a large
cluster (10 nodes), to improve the chance of reaching an "unlucky" tablet
placement - and even then only failed in about half the runs without
the code fixed.
In this patch, we rewrite the test using a much more reliable approach:
We start only two nodes, and force the base's tablet onto one node, and
the view's table onto the second node. This ensures with 100% certainty
that the view update is remote, and the new test fails every single time
before the code fix (I reverted the fix to verify) - and passes after it.
The new test is not only more reliable, it's also significantly faster
because it doesn't need to start a 10-node cluster.
Signed-off-by: Nadav Har'El <[email protected]>
# "table_or_view_name" may be either a table or a view, and those are
25
+
# listed in different system tables so we may need to search both:
26
+
matches=list(awaitcql.run_async(f"select id from system_schema.tables where keyspace_name = '{keyspace_name}' and table_name = '{table_or_view_name}'"))
27
+
ifnotmatches:
28
+
matches=list(awaitcql.run_async(f"select id from system_schema.views where keyspace_name = '{keyspace_name}' and view_name = '{table_or_view_name}'"))
29
+
assertlen(matches) ==1
30
+
returnmatches[0].id
31
+
23
32
# This convenience function takes the name of a table or a view, and a token,
24
33
# and returns the list of host_id,shard pairs holding tablets for this token
# "table_or_view_name" may be either a table or a view, and those are
35
-
# listed in different system tables so we may need to search both:
36
-
matches=list(awaitmanager.cql.run_async(f"select id from system_schema.tables where keyspace_name = '{keyspace_name}' and table_name = '{table_or_view_name}'"))
37
-
ifnotmatches:
38
-
matches=list(awaitmanager.cql.run_async(f"select id from system_schema.views where keyspace_name = '{keyspace_name}' and view_name = '{table_or_view_name}'"))
0 commit comments