Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yugabyte#1465 Fix EnumerateIntents and add a test to capture conflict…
…s at hash key level in serializable isolation Summary: Fix EnumerateIntents to generate weak intents for all prefixes of a DocKey, starting with the hash part only, through every range key, and then through every subkey. We only generate partial range key prefixes for YSQL, and don't generate them for YCQL. So for YCQL the only new weak intent generated would be the prefix consisting of the hash component. This is needed e.g. for detecting a conflict between inserting a row and scanning all rows with a particular hash component that matches the inserted row at serializable isolation. Also adding a test for this: testSerializableWholeHashVsScanConflict in TestPgTransactions. Other fixes: - Allow comparing DocKey values where one has a hash component and the other does not. - Fix SubDocKey comparison in case two invalid DocHybridTimes are provided that have different write id values, and therefore would be considered unequal by DocHybridTime comparator functions. We could fix DocHybridTime comparison itself, but that raises the question of whether two invalid DocHybridTime values should be considered equal, like NULLs in a database. Performance comparison to avoid performance regressions, using the CassandraTransactionalKeyValue sample app with the primary key with 50 subkeys: https://gist.githubusercontent.com/mbautin/77b1ab98f43325f2a05d10d0e9c013bb/raw There does not seem to be any significant performance difference on this workload with and without this patch. Test Plan: Jenkins Reviewers: mihnea, neil, neha, sergei Reviewed By: sergei Subscribers: yql Differential Revision: https://phabricator.dev.yugabyte.com/D6759 Note: This commit provides additional functionality that is logically related to the earlier commit yugabyte@e0c2b61 and supersedes the commit yugabyte@24501a4
- Loading branch information