I'm using ES 0.90.1. I've run into a little race condition-ish problem
concerning sending an update request for a document after its TTL has
expired but before ES has run the TTL cleanup.
Here are the replication steps:
% curl -XPUT localhost:9200/test-ttl -d '{
"settings" : {
"index.number_of_shards" : 1,
"index.number_of_replicas" : 0
},
"mappings" : {
"test-doc" : {
"_ttl" : {
"enabled" : true,
"default" : "1m"
}
}
}
}'
% curl -XPUT 'localhost:9200/test-ttl/test-doc/1' -d '{ "title" : "test
title" }'
% curl -XPOST 'localhost:9200/test-ttl/test-doc/1/_update' -d '{ "doc" : {
"title" : "test update title" } }'
In another window, I have this running:
% while true ; do date ; curl -XGET
'http://localhost:9200/test-ttl/test-doc/1?pretty=true&fields=title,_ttl' ;
sleep 1 ; done
While that's running, I can watch the _ttl field decrease. When it becomes
negative, the document is in a state such that its TTL has expired, but ES
hasn't yet run the cleanup step. I can still retrieve the document, even
though technically speaking it's "expired".
When the document is in this state, if I do:
% curl -XPOST 'localhost:9200/test-ttl/test-doc/1/_update' -d '{ "doc" : {
"title" : "test update title" } }'
... I get the following error message:
{"error":"ElasticSearchIllegalArgumentException[TTL value must be > 0.
Illegal value provided [-209]]","status":400}
This is causing me a little bit of grief because the program I have written
to update documents in ES doesn't handle this properly, so it just bombs
out entirely (which I really need to fix regardless). Is there another way
I should be updating documents that could be in this "expired but still
available" state?
Thanks,
Brad.
--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.