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

Check running job before create backup #5013

Merged
merged 5 commits into from
Dec 27, 2022

Conversation

pengweisong
Copy link
Contributor

@pengweisong pengweisong commented Dec 7, 2022

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

#5012
#4975

Description:

How do you solve it?

  1. add more job type to check
  2. add some test

Special notes for your reviewer, ex. impact of this fix, design document, etc:

Checklist:

Tests:

  • Unit test(positive and negative cases)
  • Function test
  • Performance test
  • N/A

Affects:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatibility (If it breaks the compatibility, please describe it and add the label.)
  • If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

Please confirm whether to be reflected in release notes and how to describe:

ex. Fixed the bug .....

@pengweisong pengweisong requested a review from a team as a code owner December 7, 2022 03:42
@pengweisong pengweisong added the ready-for-testing PR: ready for the CI test label Dec 7, 2022
Copy link
Contributor

@wenhaocs wenhaocs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is to prevent BR running when there are other jobs, which is definitely a must. But in the issue, it is the other way around: stop the Balance job running when there are backup jobs. Will it be solved somewhere else?

src/meta/processors/admin/CreateBackupProcessor.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@panda-sheep panda-sheep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job.
I have a question.
In the second step of CreateBackupProcessor::process, if a blocking_ lock is added to the part of the storage engine, writing is not allowed, but it will not block the execution of the job? Such as compact job

src/meta/processors/admin/CreateBackupProcessor.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@yixinglu yixinglu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good enhancement!

src/interface/common.thrift Outdated Show resolved Hide resolved
@pengweisong
Copy link
Contributor Author

pengweisong commented Dec 22, 2022

This PR is to prevent BR running when there are other jobs, which is definitely a must. But in the issue, it is the other way around: stop the Balance job running when there are backup jobs. Will it be solved somewhere else?

No, since BR use hard link instead of copy data, it will be very fast. But indeed, we could use the global lock to handle the corner case.

@pengweisong
Copy link
Contributor Author

Good job. I have a question. In the second step of CreateBackupProcessor::process, if a blocking_ lock is added to the part of the storage engine, writing is not allowed, but it will not block the execution of the job? Such as compact job

Ineed, then we should:

  1. check when we start backup, there is no these jobs.
  2. in the backup process we should prevent relevant jobs starting to run.

For the 1, we already check. The latter is the same problem raised by wenhao. We may could use an lock on space.

@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2022

Codecov Report

Base: 77.34% // Head: 77.96% // Increases project coverage by +0.61% 🎉

Coverage data is based on head (4be1a5e) compared to base (70d0bb2).
Patch coverage: 62.96% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5013      +/-   ##
==========================================
+ Coverage   77.34%   77.96%   +0.61%     
==========================================
  Files        1105     1108       +3     
  Lines       82146    82642     +496     
==========================================
+ Hits        63539    64430     +891     
+ Misses      18607    18212     -395     
Impacted Files Coverage Δ
src/clients/meta/MetaClient.cpp 79.03% <0.00%> (+2.69%) ⬆️
src/common/graph/Response.h 48.99% <ø> (ø)
src/graph/validator/MaintainValidator.h 65.27% <ø> (+2.77%) ⬆️
src/meta/processors/job/JobManager.h 100.00% <ø> (ø)
src/parser/MaintainSentences.h 90.86% <ø> (+3.47%) ⬆️
src/graph/validator/MaintainValidator.cpp 81.79% <53.33%> (+6.85%) ⬆️
...rc/meta/processors/admin/CreateBackupProcessor.cpp 53.08% <80.00%> (+2.77%) ⬆️
src/meta/processors/job/AdminJobProcessor.cpp 66.31% <100.00%> (+0.35%) ⬆️
src/meta/processors/job/JobManager.cpp 74.10% <100.00%> (+3.45%) ⬆️
src/meta/processors/index/FTIndexProcessor.cpp 37.86% <0.00%> (-44.78%) ⬇️
... and 98 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

critical27
critical27 previously approved these changes Dec 26, 2022
codesigner
codesigner previously approved these changes Dec 26, 2022
critical27
critical27 previously approved these changes Dec 26, 2022
SuperYoko
SuperYoko previously approved these changes Dec 26, 2022
yixinglu
yixinglu previously approved these changes Dec 26, 2022
change back to snapshot lock and acquire lock when add job
@Sophie-Xie Sophie-Xie merged commit 23dc0d0 into vesoft-inc:master Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/hi-pri Priority: high ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants