wait_for_completion doesn't seem to be working when making a snapshot

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

wait_for_completion doesn't seem to be working when making a snapshot

Robin Clarke
I am writing a small script to create a snapshot of my kibana-int index, and hit an odd race condition.

I delete the old snapshot if it exists:
curl -XDELETE 'http://localhost:9200/_snapshot/backup/snapshot_kibana?pretty'

Then make the new snapshot
curl -XPUT "http://localhost:9200/_snapshot/backup/snapshot_kibana?pretty" -d '{
    "indices": "kibana-int",
    "ignore_unavailable": true,
    "wait_for_completion": true,
    "include_global_state": false
}'

Then create a tarball of the backup to transfer to another machine
tar czf /DATA/elasticsearch/kibana-int.tgz -C /DATA/elasticsearch ./backup

When scripted, it seems that the DELETE, and/or PUT are not complete, and I get this error:
tar: ./backup/indices/kibana-int/4: file changed as we read it
tar: ./backup/indices/kibana-int/2: file changed as we read it
tar: ./backup/indices/kibana-int/3: file changed as we read it

I tried putting a sleep between the DELETE and the PUT, and same error, so it seems that perhaps the "wait_for_completion" is not doing what it should...?

Any ideas, other than just putting a sleep in there?

Cheers!

-Robin-

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/7962b247-f4d1-47d3-9e73-25544ff7aa84%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: wait_for_completion doesn't seem to be working when making a snapshot

Igor Motov-3
The wait_for_completion flag has to be specified on URL not in the body. Try this:

    "indices": "kibana-int",
    "ignore_unavailable": true,
    "include_global_state": false
}'

On Wednesday, April 2, 2014 9:43:14 AM UTC-4, Robin Clarke wrote:
I am writing a small script to create a snapshot of my kibana-int index, and hit an odd race condition.

I delete the old snapshot if it exists:
curl -XDELETE '<a href="http://localhost:9200/_snapshot/backup/snapshot_kibana?pretty" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2F_snapshot%2Fbackup%2Fsnapshot_kibana%3Fpretty\46sa\75D\46sntz\0751\46usg\75AFQjCNFX1bzdvICWEX3Hc8S7Pp1urDPZqg';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2F_snapshot%2Fbackup%2Fsnapshot_kibana%3Fpretty\46sa\75D\46sntz\0751\46usg\75AFQjCNFX1bzdvICWEX3Hc8S7Pp1urDPZqg';return true;">http://localhost:9200/_snapshot/backup/snapshot_kibana?pretty'

Then make the new snapshot
curl -XPUT "<a href="http://localhost:9200/_snapshot/backup/snapshot_kibana?pretty" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2F_snapshot%2Fbackup%2Fsnapshot_kibana%3Fpretty\46sa\75D\46sntz\0751\46usg\75AFQjCNFX1bzdvICWEX3Hc8S7Pp1urDPZqg';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2F_snapshot%2Fbackup%2Fsnapshot_kibana%3Fpretty\46sa\75D\46sntz\0751\46usg\75AFQjCNFX1bzdvICWEX3Hc8S7Pp1urDPZqg';return true;">http://localhost:9200/_snapshot/backup/snapshot_kibana?pretty" -d '{
    "indices": "kibana-int",
    "ignore_unavailable": true,
    "wait_for_completion": true,
    "include_global_state": false
}'

Then create a tarball of the backup to transfer to another machine
tar czf /DATA/elasticsearch/kibana-int.tgz -C /DATA/elasticsearch ./backup

When scripted, it seems that the DELETE, and/or PUT are not complete, and I get this error:
tar: ./backup/indices/kibana-int/4: file changed as we read it
tar: ./backup/indices/kibana-int/2: file changed as we read it
tar: ./backup/indices/kibana-int/3: file changed as we read it

I tried putting a sleep between the DELETE and the PUT, and same error, so it seems that perhaps the "wait_for_completion" is not doing what it should...?

Any ideas, other than just putting a sleep in there?

Cheers!

-Robin-

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/beb0d9d0-73ef-4ce1-8e1f-c70e083d65d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: wait_for_completion doesn't seem to be working when making a snapshot

Robin Clarke
Thanks that works!  I didn't notice that detail.  Odd that some parameters work in the URL or body, and some only in the URL... o_O

Cheers,
-Robin-

On Wednesday, 2 April 2014 16:11:27 UTC+2, Igor Motov wrote:
The wait_for_completion flag has to be specified on URL not in the body. Try this:

curl -XPUT "<a href="http://localhost:9200/_snapshot/backup/snapshot_kibana?pretty" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2F_snapshot%2Fbackup%2Fsnapshot_kibana%3Fpretty\46sa\75D\46sntz\0751\46usg\75AFQjCNFX1bzdvICWEX3Hc8S7Pp1urDPZqg';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2F_snapshot%2Fbackup%2Fsnapshot_kibana%3Fpretty\46sa\75D\46sntz\0751\46usg\75AFQjCNFX1bzdvICWEX3Hc8S7Pp1urDPZqg';return true;">http://localhost:9200/_snapshot/backup/snapshot_kibana?wait_for_completion=true&pretty" -d '{
    "indices": "kibana-int",
    "ignore_unavailable": true,
    "include_global_state": false
}'

On Wednesday, April 2, 2014 9:43:14 AM UTC-4, Robin Clarke wrote:
I am writing a small script to create a snapshot of my kibana-int index, and hit an odd race condition.

I delete the old snapshot if it exists:
curl -XDELETE '<a href="http://localhost:9200/_snapshot/backup/snapshot_kibana?pretty" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2F_snapshot%2Fbackup%2Fsnapshot_kibana%3Fpretty\46sa\75D\46sntz\0751\46usg\75AFQjCNFX1bzdvICWEX3Hc8S7Pp1urDPZqg';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2F_snapshot%2Fbackup%2Fsnapshot_kibana%3Fpretty\46sa\75D\46sntz\0751\46usg\75AFQjCNFX1bzdvICWEX3Hc8S7Pp1urDPZqg';return true;">http://localhost:9200/_snapshot/backup/snapshot_kibana?pretty'

Then make the new snapshot
curl -XPUT "<a href="http://localhost:9200/_snapshot/backup/snapshot_kibana?pretty" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2F_snapshot%2Fbackup%2Fsnapshot_kibana%3Fpretty\46sa\75D\46sntz\0751\46usg\75AFQjCNFX1bzdvICWEX3Hc8S7Pp1urDPZqg';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2F_snapshot%2Fbackup%2Fsnapshot_kibana%3Fpretty\46sa\75D\46sntz\0751\46usg\75AFQjCNFX1bzdvICWEX3Hc8S7Pp1urDPZqg';return true;">http://localhost:9200/_snapshot/backup/snapshot_kibana?pretty" -d '{
    "indices": "kibana-int",
    "ignore_unavailable": true,
    "wait_for_completion": true,
    "include_global_state": false
}'

Then create a tarball of the backup to transfer to another machine
tar czf /DATA/elasticsearch/kibana-int.tgz -C /DATA/elasticsearch ./backup

When scripted, it seems that the DELETE, and/or PUT are not complete, and I get this error:
tar: ./backup/indices/kibana-int/4: file changed as we read it
tar: ./backup/indices/kibana-int/2: file changed as we read it
tar: ./backup/indices/kibana-int/3: file changed as we read it

I tried putting a sleep between the DELETE and the PUT, and same error, so it seems that perhaps the "wait_for_completion" is not doing what it should...?

Any ideas, other than just putting a sleep in there?

Cheers!

-Robin-

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/e4f2dca1-b40e-427d-9bec-a44dcd4479ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.