job-scheduler icon indicating copy to clipboard operation
job-scheduler copied to clipboard

[BUG] Race condition on restoring from snapshot

Open heemin32 opened this issue 1 year ago • 3 comments

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:

  1. Create extension of job scheduler with short run interval which also acquire lock.
  2. Take snapshot
  3. Restore from snapshot
  4. 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

heemin32 avatar Jun 01 '23 22:06 heemin32