job-scheduler
job-scheduler copied to clipboard
[BUG] Race condition on restoring from snapshot
What is the bug?
This is just my thought process. If extension of job scheduler with short interval acquire lock, it will create an index .opendistro-job-scheduler-lock
.
After taking a snapshot, and if we restore the snapshot, the index for extension of job scheduler can be restored first and it will trigger the task which will create .opendistro-job-scheduler-lock
index. If restoration of .opendistro-job-scheduler-lock
is happened after that, it will fail due to index name conflict.
How can one reproduce the bug? Steps to reproduce the behavior:
- Create extension of job scheduler with short run interval which also acquire lock.
- Take snapshot
- Restore from snapshot
- Restore of
.opendistro-job-scheduler-lock
will fail
What is the expected behavior?
Maybe, .opendistro-job-scheduler-lock
should be taken in snapshot or restoring of it should be blocked.
What is your host/environment? N/A
Do you have any screenshots? N/A
Do you have any additional context? https://github.com/opensearch-project/OpenSearch/issues/7778