Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
spanconfigreconciler: use fixed timestamp when reading descriptors
Recently when we changed the default value of autocommit_before_ddl to true, we found that the chance of hitting a retry error while running schema changes dramatically increased. The reason was because the backgound span reconciler would need locks for the same keys that were being modified by the schema change job itself -- most notably, the descriptor table and descriptor ID sequence. This patch addresses the issue by making the spanconfig reconciler use the checkpoint timestamp from the rangefeed as the fixed timestamp for the transaction that reads the descriptors whose spans are being reconciled. This allows us to re-enable the autocommit setting for logictests that run in multitenancy. Not only does this resolve the flakes, but it seems more correct, since the reconciler will now read the descriptors as they were at the time of the checkpoint, without including any possible modifications that may have been committed in between the checkpoint and actually appearing at the other end of the rangefeed. Release note: None
- Loading branch information