kiorky / db_smart_backup

Another database(db) smart backup tool (mysql/postgresql/slapd/mongo/es/redis)
http://www.makina-corpus.com
Other
28 stars 7 forks source link

Fix on elasticsearch 5.x #14

Closed Phygon closed 4 years ago

Phygon commented 4 years ago

Removed wait_for_completion for -XGET and -XDELETE request. This fixes #13.

kiorky commented 4 years ago

Ok for the idea, but not for the current implementation proposal, check for the error, and if not supported fallback to not use wait_for_completion which is legit in newer versions.

See https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html#snapshots-take-snapshot

kiorky commented 4 years ago

https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html#_snapshot

also on 5.x, the problem is maybe the verb, add -XPUT !

kiorky commented 4 years ago

I think the pb is on the delete method, i removed the parameter here, please retry with master

Phygon commented 4 years ago

The problem is with GET and DELETE. I tested removing wait_for_completion only on the DELETE, but then the GET shows the same error.

Phygon commented 4 years ago

From the docs, only the snapshot (PUT) and restore APIs support wait_for_completion, but it is not specified for GET or DELETE: https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-snapshots.html#monitor-snapshot-restore-progress

It seems that 2.4 ignores the unsupported parameter, while 5.x throws an error.

kiorky commented 4 years ago

Ok, retry with last master :)

Phygon commented 4 years ago

It's working now. Thanks for "merging"!

kiorky commented 4 years ago

No problem, Have fun !