Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
126404: crosscluster/logical: prevent data looping via OriginID session variable r=dt a=msbutler Previously, LDR would prevent data looping by spinning up rangefeeds with filtering. This big hammer prevented LDR replicated data from appearing in destination side changefeeds. This patch replaces this data loop prevention strategy by 1) binding an OriginID of 1 to the MVCCValueHeader of each replicated KV during ingestion; 2) filtering these KVs with their OriginID value when these replicated KVs appear as LDR source side rangefeed events. To implement 1), the Internal Execetor in the LDR row processor now sets the OriginIDForLogicalDataReplication session variable to 1, which has the effect of binding OriginID=1 to each batch request header created by the InternalExecutor's write queries. The request header value will be plumbed to each KV's Value header in the kv layer. To implement 2), source side rangefeeds are now initialized with the WithEmitMatchingOriginIDs option, causing rangefeeds to only emit local writes, with OriginID=0. Note that a similar ingestion side plumbing strategy will be used for OriginTimestamp even though each ingested row may have a different timestamp. We can still bind the OriginTimestamp to the Internal Executor session before each query because 1) each IE query creates a new session; 2) we do not plan to use multi row insert statements during LDR ingestion via sql. Fixes #126253 Release note: none Co-authored-by: Michael Butler <[email protected]>
- Loading branch information