-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Catalog and Routing
-
1
-
None
-
3
-
TBD
-
None
-
None
-
None
-
None
-
None
-
None
The changeReadSourceIfNeeded function is very challenging to understand and therefore maintain. This ticket is to refactor this function to make it easier to reason about. Some things that make this function confusing are
- A true response from the function shouldReadAtLastApplied does not imply that the operation must read at last applied, just that under certain scenarios it will do so (and same with the variable readAtLastApplied)
- The helper function canReadAtLastApplied returning true does not imply that the operation can read at last applied since there are multiple subsequent checks that also affect whether the operation can actually read at last applied
- The return value of the function is not explained anywhere and seems to only be the result of shouldReadAtLastApplied regardless of what the function actually ends up doing to the read source