At present, we introduce an error called
special_keys_cross_module_read when your
getRange touches more than one module.
I am thinking we can use
readThroughEnd to make the call more smooth without an error.
readThroughEnd are only set to be
true if you read to
\xff\xff\xff\xff, respectively, which rarely happen since you will always get the
special_keys_cross_module_read first, since, by default, your module is only a range like
Instead, we can omit the error when key selectors go outside the module’s boundaries and just set
readThroughEnd as reference for user to know whether his calls crossed the module.
If he wants cross-module results, he can set the transaction option
SPECIAL_KEY_SPACE_RELAXED to achieve.
A potential use case is when you want to use key selectors that are potentially cross-module.
getRange(firstLessOrEqual("\xff\xff/transaction/read_conflict_range/foo), <end_key>) will throw
special_keys_cross_module_read if there are no read conflict ranges’ begin keys <=
This is a little bit not easy to use, since, by intuition, the user needs to deal with the error which he does not have a good idea how to deal with when he’s writing the code. If he wants to avoid this error, he can only use key selectors conservatively, which loses some flexibility.
Instead, we can just set
readToBegin=true and return the result. Then the user knows there is no such begin keys<=
The implementation is straightforward to change so we only need to care which one is better to use.