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

backupccl: backup/restore does not handle comments #44396

Open
knz opened this issue Jan 27, 2020 · 14 comments · May be fixed by #48685
Open

backupccl: backup/restore does not handle comments #44396

knz opened this issue Jan 27, 2020 · 14 comments · May be fixed by #48685
Labels
A-disaster-recovery C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) docs-done docs-known-limitation T-disaster-recovery X-nostale Marks an issue/pr that should be ignored by the stale bot

Comments

@knz
Copy link
Contributor

knz commented Jan 27, 2020

Since 19.2 CockroachDB supports the COMMENT statement to decorate database, tables and columns. We plan to extend it for sequences, views, indexes as well (#44135).

Comments are stored in a separate table system.comments.

cockroach dump in the CLI handles this by emitting the COMMENT statements alongside CREATE in the output.

However BACKUP does not capture the comments and they are thus not restorable.

Jira issue: CRDB-5231

@knz knz added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-disaster-recovery labels Jan 27, 2020
@knz
Copy link
Contributor Author

knz commented Jan 27, 2020

cc @hueypark FYI

@knz
Copy link
Contributor Author

knz commented Jan 27, 2020

@jseldess do you still use the "docs-known-limitation" label? Otherwise what's the current process to report and document known limitations?

@dt
Copy link
Member

dt commented Jan 27, 2020

On the bright side, I think the new "full-cluster backup" in 20.1 will preserve comments just fine (indeed, there is a test of this in the current PR h/t @pbardea), but backing up individual tables or databases currently will not right now. Doing so will require adding some special-purpose code to BACKUP to gather the applicable rows from system.comments for the set of IDs being backed up, and then code in RESTORE to re-key those rows to the new IDs and insert them into the existing system.comments on the RESTOREing cluster.

@jseldess
Copy link
Contributor

@knz, yes, we use that label to identify new known limitations to document for a GA release. Once we have in the docs, we add docs-done.

@kenliu
Copy link

kenliu commented Jan 27, 2020

Nice catch @knz

@knz
Copy link
Contributor Author

knz commented Jan 27, 2020

@dt caught it. I merely filed the issue.

@jseldess
Copy link
Contributor

Documented in cockroachdb/docs#7118.

@hueypark
Copy link
Contributor

@knz I think we already resolved this issue(#43152) and merged it to 20.1 branch. Am I wrong?

@knz
Copy link
Contributor Author

knz commented Apr 29, 2020

yes, correct. thanks for noticing!

@knz knz closed this as completed Apr 29, 2020
@hueypark
Copy link
Contributor

@jseldess We should also reflect on the changes in the 20.1 documentation.

@pbardea
Copy link
Contributor

pbardea commented Apr 29, 2020

Hm, unfortunately I don't think that #43152 quite resolves this issue. A BACKUP of a table or database will not by default include system.comments. This table would need to be backed up and manually restored and re-inserted (by first restoring it into a temporary db). So upon restoring there is no way to retrieve the comments.

@pbardea pbardea reopened this Apr 29, 2020
@hueypark
Copy link
Contributor

Interesting. Let me look a little further.

hueypark added a commit to hueypark/cockroach that referenced this issue May 11, 2020
Fixes cockroachdb#44396

Release note: Enterprise `BACKUP` does capture database, table,column and index comments
@hueypark hueypark linked a pull request May 11, 2020 that will close this issue
@adityamaru
Copy link
Contributor

We are considering changing the format we store backup metadata as a project for our 21.2 release. This new format would unlock the ability to store larger types of metadata egs: comments, stats and so we should off on addressing this issue until then!

@github-actions
Copy link

We have marked this issue as stale because it has been inactive for
18 months. If this issue is still relevant, removing the stale label
or adding a comment will keep it active. Otherwise, we'll close it in
10 days to keep the issue queue tidy. Thank you for your contribution
to CockroachDB!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2023
@knz knz reopened this Oct 2, 2023
@knz knz added X-nostale Marks an issue/pr that should be ignored by the stale bot and removed X-stale labels Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-disaster-recovery C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) docs-done docs-known-limitation T-disaster-recovery X-nostale Marks an issue/pr that should be ignored by the stale bot
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

8 participants