# Relationship between action.replication\_type and action.write\_consistency

**URL:** <https://discuss.elastic.co/t/relationship-between-action-replication-type-and-action-write-consistency/13192>\
**Category:** Elasticsearch\
**Created:** [August 13, 2013, 3:41am UTC](https://discuss.elastic.co/t/relationship-between-action-replication-type-and-action-write-consistency/13192 "2013-08-13T03:41:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oli\_McCormack](https://avatars.discourse-cdn.com/v4/letter/o/fbc32d/32.png) [@Oli\_McCormack](https://discuss.elastic.co/u/Oli_McCormack)\
**Post date:** [August 13, 2013, 3:41am UTC](https://discuss.elastic.co/t/relationship-between-action-replication-type-and-action-write-consistency/13192/1 "2013-08-13T03:41:53Z")

</div>

Hi there,

The _action.replication\_type=sync_ option suggests to me that \*all \*shards  
(primary + replicas) must be written to before an index operation returns.  
However, my reading of _action.write\_consistency_ suggests that it actually  
dictates how many shards need to be present for a write/index to occur.

If I have the following settings:  
shards: 1 primary + 2 replicas  
action.replication\_type: sync  
action.write\_consistency: quorum

What is the result? Will indexing success on the primary and a single  
replica return a successful write operation to me?

Thanks very much for any help. I've included some related docs/links that  
I've been through below, but have yet to be conclusive on this!

- oli

Some useful related links:  
Notes on these settings in the docs[http://www.elasticsearch.org/guide/reference/api/index\_/](http://www.elasticsearch.org/guide/reference/api/index_/)  
Get consistency and quorum from the list[https://groups.google.com/forum/#!searchin/elasticsearch/action.replication\_type/elasticsearch/YbaM-TPhZMg/zppsQBuxbV8J](https://groups.google.com/forum/#!searchin/elasticsearch/action.replication_type/elasticsearch/YbaM-TPhZMg/zppsQBuxbV8J)  
Video from Shay discussing the nature of push replication for shards[http://vimeo.com/26710663](http://vimeo.com/26710663)

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Oli\_McCormack](https://avatars.discourse-cdn.com/v4/letter/o/fbc32d/32.png) [@Oli\_McCormack](https://discuss.elastic.co/u/Oli_McCormack)\
**Post date:** [September 10, 2013, 1:03pm UTC](https://discuss.elastic.co/t/relationship-between-action-replication-type-and-action-write-consistency/13192/2 "2013-09-10T13:03:56Z")

</div>

I got an answer to this question, so for anyone else that comes across it:

Setting action.replication\_type: sync means that success will be returned  
once action.write\_consistency is achieved. In the following scenario:

shards: 1 primary + 2 replicas  
action.replication\_type: sync  
action.write\_consistency: quorum

A sync indexing operation will succeed once quorum (a primary and a single  
replica) have been written to.

- oli

On Tue, Aug 13, 2013 at 4:41 AM, Oli [oli@climate.com](mailto:oli@climate.com) wrote:

> Hi there,
> 
> The _action.replication\_type=sync_ option suggests to me that \*all \*shards  
> (primary + replicas) must be written to before an index operation returns.  
> However, my reading of _action.write\_consistency_ suggests that it  
> actually dictates how many shards need to be present for a write/index to  
> occur.
> 
> If I have the following settings:  
> shards: 1 primary + 2 replicas  
> action.replication\_type: sync  
> action.write\_consistency: quorum
> 
> What is the result? Will indexing success on the primary and a single  
> replica return a successful write operation to me?
> 
> Thanks very much for any help. I've included some related docs/links that  
> I've been through below, but have yet to be conclusive on this!
> 
> - oli
> 
> Some useful related links:  
> Notes on these settings in the docs[http://www.elasticsearch.org/guide/reference/api/index\_/](http://www.elasticsearch.org/guide/reference/api/index_/)  
> Get consistency and quorum from the list[https://groups.google.com/forum/#!searchin/elasticsearch/action.replication\_type/elasticsearch/YbaM-TPhZMg/zppsQBuxbV8J](https://groups.google.com/forum/#!searchin/elasticsearch/action.replication_type/elasticsearch/YbaM-TPhZMg/zppsQBuxbV8J)  
> Video from Shay discussing the nature of push replication for shards[http://vimeo.com/26710663](http://vimeo.com/26710663)
> 
> --  
> 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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:17am UTC](https://discuss.elastic.co/t/relationship-between-action-replication-type-and-action-write-consistency/13192/3 "2017-07-06T02:17:18Z")

</div>


