Currently, the enforce_home_region_follower_reads_enabled feature uses (1) savepoint rollback and (2) follower reads to dynamically detect a home region for a query which encountered "Query has no home region" error. (1) is used to roll back the original failed read, and (2) is used to ensure that while we try different regions to find the home region we don't actually serve remote reads.
In #111228 we want to change the behavior of savepoint rollbacks to not drop the accumulated read spans, and instead ensure those reads are serializable even after the rollback. This change breaks the above enforce_home_region_follower_reads_enabled functionality because (1) no longer removes the original failed read from the txn's read span, and as a result (2) fails to use AOST because the txn has preceding reads.
Ideally, we would change the behavior of enforce_home_region_follower_reads_enabled to work with the new savepoint behavior but it's unclear how to best approach this. In the mean time, after discussing with @michae2, we agreed we can limit the behavior of enforce_home_region_follower_reads_enabled to work only for queries that already use AOST. This will help because we no longer need to do part (2).
Currently, the
enforce_home_region_follower_reads_enabled
feature uses (1) savepoint rollback and (2) follower reads to dynamically detect a home region for a query which encountered "Query has no home region" error. (1) is used to roll back the original failed read, and (2) is used to ensure that while we try different regions to find the home region we don't actually serve remote reads.In #111228 we want to change the behavior of savepoint rollbacks to not drop the accumulated read spans, and instead ensure those reads are serializable even after the rollback. This change breaks the above
enforce_home_region_follower_reads_enabled
functionality because (1) no longer removes the original failed read from the txn's read span, and as a result (2) fails to use AOST because the txn has preceding reads.Ideally, we would change the behavior of
enforce_home_region_follower_reads_enabled
to work with the new savepoint behavior but it's unclear how to best approach this. In the mean time, after discussing with @michae2, we agreed we can limit the behavior ofenforce_home_region_follower_reads_enabled
to work only for queries that already use AOST. This will help because we no longer need to do part (2).Jira issue: CRDB-33142