ekaterinadimitrova2 commented on code in PR #3955:
URL: https://github.com/apache/cassandra/pull/3955#discussion_r1990066688
##########
test/unit/org/apache/cassandra/index/sai/cql/AllowFilteringTest.java:
##########
@@ -391,4 +395,30 @@ private void test(String query, boolean
requiresAllowFiltering) throws Throwable
assertNotNull(execute(query + " ALLOW FILTERING"));
}
+ private final Injections.Barrier blockIndexBuild =
Injections.newBarrier("block_index_build", 2, false)
+
.add(InvokePointBuilder.newInvokePoint().onClass(StorageAttachedIndex.class)
+ .onMethod("startInitialBuild"))
+ .build();
+
+ @Test
+ public void testAllowFilteringDuringIndexBuild() throws Throwable
+ {
+ createTable("CREATE TABLE %s (k int PRIMARY KEY, v int)");
+ Injections.inject(blockIndexBuild);
+ String idx = createIndexAsync(String.format("CREATE CUSTOM INDEX ON
%%s(v) USING '%s'", StorageAttachedIndex.class.getName()));
+
+ assertThatThrownBy(() -> execute("SELECT * FROM %s WHERE v=0"))
+ .hasMessage("The secondary index '" + idx + "' is not yet
available as it is building")
Review Comment:
I have it and I forgot to commit it :-) Good call
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]