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

Cannot mark an unqueryable datasources segments used #16125

Closed
zachjsh opened this issue Mar 14, 2024 · 0 comments · Fixed by #16127
Closed

Cannot mark an unqueryable datasources segments used #16125

zachjsh opened this issue Mar 14, 2024 · 0 comments · Fixed by #16127

Comments

@zachjsh
Copy link
Contributor

zachjsh commented Mar 14, 2024

Description

It seems that Druid has a check that short circuits the work to mark segments used if it thinks that the datasource does not exist. However, if all of the data in the table has been soft deleted (markUnused), then Druid thinks the datasource doesnt exist, which consequently means that if all data in a datasource in soft deleted, it cannot be recovered:

Here is the Druid check:

https://github.com/implydata/druid/blame/4c252b85c30dd780cdcaa5d342abf21d9a5d52f7/[…]main/java/org/apache/druid/server/http/DataSourcesResource.java

It seems that this logic has been here since the inception of the markUsed api #7490.

My thought is that the check for datasource existence was copied from the MarkAsUnused api logic, and used to save potentially unnecessary metadata ops . For markingAsUnused, I believe it does make sense to check for queryable datasource, because if there are any segments to mark as unused, then they are presumably used now, which would make the datasource queryable. However this same check is not appropriate when marking segments used, as there may be no queryable segments.

Motivation

Without fixing this, users cannot easily recover the data for a datasource for which all data has been previously marked unused.

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

Successfully merging a pull request may close this issue.

1 participant