adelapena commented on code in PR #3011:
URL: https://github.com/apache/cassandra/pull/3011#discussion_r1440428504
##########
test/unit/org/apache/cassandra/index/SecondaryIndexManagerTest.java:
##########
@@ -56,6 +57,20 @@ public void after()
TestingIndex.clear();
}
+ @Test
+ public void createSasiAfterSai()
+ {
+ execute(format("CREATE TABLE %s.abc (id int PRIMARY KEY, val text)",
KEYSPACE));
+ execute(format("CREATE INDEX ON %s.abc (val) USING 'sai'", KEYSPACE));
+ waitForTableIndexesQueryable(KEYSPACE, "abc");
+ execute(format("INSERT INTO %s.abc (id, val) VALUES (1, 'a')",
KEYSPACE));
+ execute(format("SELECT * FROM %s.abc WHERE val = 'a'", KEYSPACE));
+ flush(KEYSPACE);
+ execute(format("CREATE CUSTOM INDEX on %s.abc (val) USING
'org.apache.cassandra.index.sasi.SASIIndex'", KEYSPACE));
+ waitForTableIndexesQueryable(KEYSPACE, "abc");
+ execute(format("SELECT * FROM %s.abc WHERE val = 'a'", KEYSPACE));
Review Comment:
It seems that a minor issue with the test is that it doesn't consistently
reproduce the bug. It would only reproduce it with the old code if the
concurrent map containing the indexes happens to return the SAI index first.
This doesn't seem deterministic, and in fact, the test sometimes passes without
the fix. This is not a big deal IMO, because the test aims at a very specific
bug that doesn't exist anymore.
--
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]