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

streamingccl,sql: add sql syntax and ingestion planning logic #59112

Merged
merged 2 commits into from
Jan 29, 2021

Conversation

adityamaru
Copy link
Contributor

@adityamaru adityamaru commented Jan 18, 2021

commit 1 - add ingestion job SQL syntax

commit 2 - add ingestion job plan hook and hookup planning, job, and processors.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@pbardea pbardea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- I want to take a look after rebasing on top of #59139 (sorry!)

}

// We only support a TENANT target, so error out if that is nil.
if ingestionStmt.Targets.Tenant == (roachpb.TenantID{}) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also check that the other targets are nil and error out if they're not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

StreamAddress: streamingccl.StreamAddress(from[0]),
Span: roachpb.Span{Key: prefix, EndKey: prefix.Next()},
// TODO: Figure out what the initial ts should be.
StartTime: hlc.Timestamp{},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will end up being the endtime of the backup that we're restoring when that is hooked up. I think that keeping it at empty should be good for now.

@adityamaru adityamaru changed the title [WIP] streamingccl,sql: add sql syntax and ingestion planning logic streamingccl,sql: add sql syntax and ingestion planning logic Jan 26, 2021
This change adds basic SQL syntax to start the ingestion job which will
read from the replication stream it is pointed to, and ingest the KVs
into the destination tenant's keyspace.

Release note (sql change): add SQL syntax for `RESTORE tenant x FROM
REPLICATION STREAM FROM 'replication_stream'`. This allows the user to
start an ingestion job to ingest KVs from the replication stream into
the destination tenant's keyspace.
This change adds the boiler plate plan hook that configures and starts
up the ingestion job.

Release note: None
@adityamaru
Copy link
Contributor Author

TFTR!

bors r=pbardea

@craig
Copy link
Contributor

craig bot commented Jan 29, 2021

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants