-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
changefeedccl, backupresolver: refactor to hold on to mapping of target to descriptor #79260
changefeedccl, backupresolver: refactor to hold on to mapping of target to descriptor #79260
Conversation
d75c933
to
5a4b7fc
Compare
@@ -306,7 +306,7 @@ func NewDescriptorResolver(descs []catalog.Descriptor) (*DescriptorResolver, err | |||
// session database) or if one of its tables matches the targets. All expanded | |||
// DBs, via either `foo.*` or `DATABASE foo` are noted, as are those explicitly | |||
// named as DBs (e.g. with `DATABASE foo`, not `foo.*`). These distinctions are | |||
// used e.g. by RESTORE. | |||
// used e.g. by RESTORE. tablePatternMap will be populated if non-nil. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it really worth it to optimize? Perhaps just return this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not my package
At some point we should move this to pkg/sql/something, maybe pkg/sql/catalog/targets, since it doesn't really belong in backup's package either.
0492326
to
37ee373
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd still prefer to tjust have 1 method. @dt also agrees.
…et to descriptor Changefeed statements need to resolve a bunch of table names at once, but unlike backups and grants they need to know which returned descriptor corresponded to which input because they (now) take target-specific options. We were reconstructing this awkwardly on the calling side. This PR adds a DescsByTablePattern map to the backupresolver method being used so that it can track which descriptor belongs to which input. Release note: None
37ee373
to
537edf0
Compare
Okay, done. |
bors r=[miretskiy,dt] |
1 similar comment
bors r=[miretskiy,dt] |
Already running a review |
Build succeeded: |
Changefeed statements need to resolve a bunch of table names at once,
but unlike backups and grants they need to know which returned
descriptor corresponded to which input because they (now) take
target-specific options. We were reconstructing this awkwardly on
the calling side. This PR adds an optional parameter to the
backupresolver method being used so that it can track which
descriptor belongs to which input.
I'm probably being overly polite by making this optional,
but hey, it is a little extra memory footprint and not my package.
Release note: None