Current state: Accepted
Discussion thread: https://lists.apache.org/thread.html/rdc6a06316882d24b224444b81cd0cc5debfe7020c57ed6dd52334f9a%40%3Cdev.lucene.apache.org%3E
JIRA:
Released: NA
Large scale Solr installations often require cross data-center replication in order to achieve data replication for both, access latency reasons as well as disaster recovery.
In the past users have either designed their own solutions to deal with this or have tried to rely on the now-deprecated CDCR.
It would be really good to have support for cross data-center replication within Solr, that is offered and supported by the community. This would allow the effort around this shared problem to converge.
Briefly list any new interfaces that will be introduced as part of this proposal or any existing interfaces that will be removed or changed. The purpose of this section is to concisely call out the public contract that will come along with this feature.
The definition of a public interface is found on the main SIP page.
The XDC replication design intends to use an independent messaging layer in the middle. This layer would allow Solr to concentrate on what it does best, instead of having to also behave like a message queue.
Solr would provide an abstraction that would allow users to implement a solution that supports their messaging system of choice.
The Solr cluster that receives the updates first would have the extra responsibility of versioning the documents, and pushing them to a messaging queue of choice. Once done, the mirroring logic outside of Solr would be responsible for copying this data to a local topic/queue for other DR clusters. (Diagram Below)
Cross DC Consumer
Update Flow
Admin requests
Conditionally replicate the admin requests. Collection creation should be replicated so that a user can start sending updates without having to remember to manually create collections in all clusters. The original replication factor would be the same across the clusters.
All subsequent replica management requests e.g. ADDREPLICA or DELETEREPLICA should not be mirrored as these are used to handle query/update scaling in specific DCs.
Architecture


Cross-DC consumer would be a standalone application that would consume data from a messaging queue, and write to Solr.
Reading from the messaging queue, and writing back to a retry queue would be abstracted out, allowing users to have custom implementations based on their choice of queue.
Sending updates to Solr would be implemented as part of the consumer, in a manner that would allow users to extend the application to handle custom requests.
Interface SourceQueue
Interface TargetStore
Admin Interface to skip/rewind the queue pointer
The Solr package would be deployed with the Solr instance. This would basically include an Update Request Processor which would handle the following:
Based on the current proposal, deploying the XDC solution would include deploying and configuring the consumer as well as the plugin.
The plugin should be standard and agnostic of the messaging queue and other replicated clusters.
This information can be provided by either an independent znode or a cluster property.
Consider the following situation:
Proposed Solution: Require clients to ensure update response comes back positive. Retry if it doesn’t (conditionally).
Describe in few sentences how the SIP will be tested. We are mostly interested in system tests (since unit-tests are specific to implementation details). How will we know that the implementation works as expected? How will we know nothing broke?
If there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.