-
Notifications
You must be signed in to change notification settings - Fork 468
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
adapter: add mz_subscriptions system table #17906
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
teskje
force-pushed
the
mz_subscribes
branch
2 times, most recently
from
March 3, 2023 11:39
720a92e
to
e41151f
Compare
teskje
requested review from
a team,
jkosh44,
morsapaes and
philip-stoev
and removed request for
a team
March 3, 2023 18:18
jkosh44
approved these changes
Mar 3, 2023
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.
LGTM
morsapaes
requested changes
Mar 6, 2023
This commit adds a new `mz_subscriptions` system table that contains information about active subscribes. Subscribes are added there when they are sequenced by the coordinator and removed when the coordinator drops them. The main intended usage of this table is making sense of subscribe IDs that appear in compute introspection sources. Prior to this commit, there was no place where one could look these IDs up. I tried to add as much identifying information about subscribes as possible. Subscribes don't have a name, so there is no obvious way for users to map their SQL queries to rows in the table. The `created_at` and `referenced_object_ids` fields can help here, I hope. I would have liked to include the `create_sql` as well, like we do for views. But handling renames of objects appearing in subscribe queries seems difficult.
Thanks for your comments! I've addressed them all, PTAL. |
jkosh44
approved these changes
Mar 6, 2023
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.
LGTM
morsapaes
approved these changes
Mar 6, 2023
TFTRs! |
teskje
changed the title
adapter: add mz_subscribes system table
adapter: add mz_subscriptions system table
Mar 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new
mz_subscribes
system table that contains information about active subscribes. Subscribes are added there when they are sequenced by the coordinator and removed when the coordinator drops them.The main intended usage of this table is making sense of subscribe IDs that appear in compute introspection sources. Prior to this commit, there was no place where one could look these IDs up.
I tried to add as much identifying information about subscribes as possible. Subscribes don't have a name, so there is no obvious way for users to map their SQL queries to rows in the table. The
started_at
time can help here, I hope. I would have liked to include thecreate_sql
as well, like we do for views. But handling renames of objects appearing in subscribe queries seems difficult.For now
mz_subscribes
lives in themz_internal
schema. I think we can move it to the catalog at some point, but I didn't want to stabilize it immediately.Motivation
It would be good to have a table that lists active subscribes, so users have something to look up the
t*
GlobalIds they find in the introspection sources.Tips for reviewer
The functionality is implemented, but this is still missing:
Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way) and therefore is tagged with aT-proto
label.mz_internal.mz_subscribe
system table, which lists in-progress subscribes.