ElasticSearch can I reach GET consistency cross replicas (for same client)?

Hi, I was reading https://discuss.elastic.co/t/question-on-read-consistency/14232/10

ElasticSearch can I reach GET consistency cross replicas (for same client, client does set then get)?

Please correct me if i'm wrong but it looks to me like i can reach "consistency" meaning I will always get the latest value written even if my read gets to a replica which did not get my last write if:

  1. I use action.get.realtime: true (which is default).
  2. when I do write I use param replication: sync (which is also default).

And in this case even if i wrote a value to a master, and then immediately read it with a client on any replica on any situation, i will always get my latest get because:

  1. action.get.realtime: true makes sure I read from transactionlog if value is not already store. but this is only per a shard
  2. If i reach any other replica shard then the fact that I used replication:sync which is also default means that when I did the write i got success only when finished the writing. so any replica shard will return to me the last value.

so in that manner a GET after PUT is always consistent and not just eventual consistent.

is that correct??

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.