Added API to check if 2 tables are co-located #13403
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #11788.
Approach: For each partition get the set of servers on which the partition resides for each table and verify that the 2 server sets are equal
Edge case: Consider table0 (with replication factor: 2) and table1 (replication factor: 1)
server0: segment0_table0_replica_0, segment0_table1_replica_0
server1: segment0_table0_replia_1
In the above case the API will return false i.e tables aren't co-located (because the server sets must match exactly).
Notes:
The reason I am returning a string response ("true" or "false") is so that we can decide in the UI how to display it to the user
Testing:
Tested both positive and negative scenarios