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

Cant' snapshot+delete an index in a safe way #1547

Open
hatharom opened this issue Jul 15, 2020 · 0 comments
Open

Cant' snapshot+delete an index in a safe way #1547

hatharom opened this issue Jul 15, 2020 · 0 comments

Comments

@hatharom
Copy link

hatharom commented Jul 15, 2020

General description

I am unable to accomplish the following:
If an index is older than X date unit then take a snapshot and delete it.

Seems an easy task (see below my actions.yaml), however It may occur that the index's date doesnt match the first step's filter so snapshot won't be taken but after the first action it will match the second step (because some second passed since the 1st) and the index gets deleted.

Expected Behavior

Snapshot and delete phase should work on the same set of indices

Actual Behavior

Unfortunately time - as usual - passes between the different actions.

Steps to Reproduce the Problem

actions:
        1:
          action: snapshot
          description: "Creating snapshot"
          options:
            repository: repo
            wait_for_completion: True
            continue_if_exception: False
            disable_action: False
            ignore_empty_list: True
          filters:         
          - filtertype: age 
            source: creation_date
            direction: older         
            unit: minutes
            unit_count: 1       
        2:
          action: delete_indices
          description: "Clean up ES by deleting old indices"
          options:
            continue_if_exception: False
            disable_action: False
            ignore_empty_list: True
          filters:      
          - filtertype: age 
            source: creation_date
            direction: older         
            unit: minutes 
            unit_count: 1  

PUT localhost:9200/myindex at 21:01:03

curator's task gets launched at 22:02:01 :
22:02:02.980 : Action1 filter doesnt match -> no snapshot is taken (or taken for other indices)
22:02:03.100: Action2 filter matches -> deletes the index

I thought that maybe wait_for_completion=False can solve this, but the documentation states it can also take some time to return. And I dont want to be in a situation where it returns immediately and the index gets deleted earlier than a snapshot is taken. edit: it doesnt even work, because of an error thrown by the deletion action (cant delete index that is being snapshot)

So what to do?
Can snapshot and delete based on the same timestamp somehow?
Or can I pass filtered indexes from phase1 to phase2?

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

No branches or pull requests

1 participant