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

Decouple clean up ingest temp data from BackendCtxMgr #54007

Closed
tangenta opened this issue Jun 13, 2024 · 3 comments · Fixed by #54008
Closed

Decouple clean up ingest temp data from BackendCtxMgr #54007

tangenta opened this issue Jun 13, 2024 · 3 comments · Fixed by #54008
Assignees
Labels
component/ddl This issue is related to DDL of TiDB. type/enhancement The issue or PR belongs to an enhancement.

Comments

@tangenta
Copy link
Contributor

Enhancement

Use a separate loop for cleaning up is better. Otherwise, if there are no new add index jobs running, temp-dir cannot be cleaned up.

@tangenta tangenta added type/enhancement The issue or PR belongs to an enhancement. component/ddl This issue is related to DDL of TiDB. labels Jun 13, 2024
@tangenta tangenta self-assigned this Jun 14, 2024
@lance6716
Copy link
Contributor

About the problem "if there are no new add index jobs running, temp-dir cannot be cleaned up.", I agree we should use a background loop to periodically check temp-dir. However, the only ownership of temp-dir should still belong to BackendCtxMgr. In other words, only BackendCtxMgr creates and deletes the files under its workering directory which is temp-dr.

Currently my suggestion is spawn a goroutine that calls BackendCtxMgr.CleanUpXXX. And the caller passes processingJobsIDs as an argument to avoid BackendCtxMgr uses getProcessingJobIDs.

@tangenta
Copy link
Contributor Author

@lance6716 I plan to remove BackendCtxMgr and let each backend context managed by ddl worker / distributed framework instead. This is one of the steps.

@lance6716
Copy link
Contributor

@lance6716 I plan to remove BackendCtxMgr and let each backend context managed by ddl worker / distributed framework instead. This is one of the steps.

OK, I realized that clean up stale files is not a functionality of one backend context, it belongs to the "backend context manager" but we are going to remove this concept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/ddl This issue is related to DDL of TiDB. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants