On 6/8/2018 3:56 AM, SOLR4189 wrote:
> /When a document is sent to a Solr node for indexing, the system first
> determines which Shard that document belongs to, and then which node is
> currently hosting the leader for that shard. The document is then forwarded
> to the current leader for indexing, and the leader forwards the update to
> all of the other replicas./
>
> So my question, what does happen when I'm sending index request to replica
> server instead leader server?
>
> Replica becomes a leader for this request? Or replica becomes only federator
> that resends request to leader and then leader will resend to replica?

Terminology nit:  The leader *is* a replica.  It just has a temporary
special job.  It doesn't lose its status as a replica when it is elected
leader.

If you send a document update to an index that is not the leader for the
correct shard, it will do just what you said above -- figure out the
correct shard, figure out which replica is the leader of that shard, and
forward the request there.  That leader will index the request itself
and then handle updating the other replicas.  It will also reply to the
index where you sent the request, which will reply to you.  The leader
role will not change to another core unless there is a leader election
and the existing leader loses that election.  An election is not going
to happen without a significant cluster event.  Examples are an explicit
election request, or the core/server with the the leader role going down.

Thanks,
Shawn

Reply via email to