Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spanconfigsql{watcher,reconciler}: setup SQLWatcher to watch for pts updates #75122

Merged
merged 1 commit into from
Feb 3, 2022

Commits on Feb 3, 2022

  1. spanconfigsql{watcher,reconciler}: setup SQLWatcher to watch for pts …

    …updates
    
    This change sets up a rangefeed on the `system.pts_records` table,
    and adds this to the set of rangefeeds managed by the SQLWatcher. We
    switch the unit emitted by the SQLWatcher to a union type called
    `SQLUpdate` which captures either an update to a descriptor or to a
    protected timestamp target. The zones and descriptor table rangefeeds
    will continue to emit descriptor updates. The pts rangefeed will emit
    descriptor updates for records that target schema objects, and pts target
    updates for records that target cluster or tenants.
    
    The SQLWatcher continues to dedup the SQLUpdates that it emits, so as to
    ensure there is only one SQLUpdate per descriptor ID, and one SQLUpdate
    per cluster or tenant target. The reconciler registers a handler that
    is invoked everytime a batch of SQLUpdates are emitted by the SQLWatcher.
    There is change in semantics in this part of the code, a future PR will teach
    the reconciler to parse the pts target SQLUpdates, and in turn instruct the
    SQLTranslator to generate the appropriate `SystemSpanConfigs`.
    
    Note, this file moves the sqlwatcher tests into a ccl package so as to be
    able to run backup statements to test the rangefeed on the pts table.
    
    Informs: cockroachdb#73727
    
    Release note: None
    adityamaru committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    63a248c View commit details
    Browse the repository at this point in the history