Re: What Happens to Consistency if I kill a Leader and Startup it again?

2013-05-03 Thread Furkan KAMACI
Shawn thanks for detailed answer, it explains everything. I think that
there is no problem. I will use 4.3. when it is available and if I see a
situation something like that I will report.

2013/5/3 Shawn Heisey s...@elyograg.org

 On 5/2/2013 2:19 PM, Furkan KAMACI wrote:
  I see that at my admin page:
 
  Replication (Slave)  Version  GenSize
  Master:  1367307652512   82  778.04 MB
  Slave:   1367307658862   82  781.05 MB
 
  and I started to figure about it so that's why I asked this question.

 As we've been trying to tell you, the sizes can (and will) be different
 between replicas on SolrCloud.  Also, if you're not running a recent
 release candidate of 4.3, then the version numbers on the replication
 screen are misleading.  See SOLR-4661 for more details.

 Your example of version numbers like 100, 90, and 95 wouldn't actually
 happen, because the version number is based on the current time in
 milliseconds since 1970-01-01 00:00:00 UTC.  If you index after killing
 the leader, the new leader's version number will be higher than the
 offline replica.

 If you can find actual proof of a problem with index updates related to
 killing the leader, then we can take the bug report and work on fixing
 it.  Here's how you would go about finding proof.  It would be easiest
 to have one shard, but if you want to make sure it's OK with multiple
 shards, you would have to kill all the leaders.

 * Start with a functional collection with two replicas.
 * Index a document with a recognizable ID like A.
 * Make sure you can find document A.
 * Kill the leader replica, let's say it was replica1.
 * Make sure replica2 becomes leader.
 * Make sure you can find document A.
 * Index document B.
 * Start replica1, wait for it to turn green.
 * Make sure you can still find document B.
 * Kill the leader again, this time it's replica2.
 * Make sure you can still find document B.

 To my knowledge, nobody has reported a real problem with proof.  I would
 imagine that more than one person has done testing like this to make
 sure that SolrCloud is reliable.

 Thanks,
 Shawn




Re: What Happens to Consistency if I kill a Leader and Startup it again?

2013-05-02 Thread Otis Gospodnetic
The leader would not be behind replica because the old leader would not
come back and take over the leader role. It would ne just a replica and it
would replicate the index from whichever node is the leader.

Otis
Solr  ElasticSearch Support
http://sematext.com/
On Apr 29, 2013 5:31 PM, Furkan KAMACI furkankam...@gmail.com wrote:

 I think about such situation:

 Let's assume that I am indexing at my SolrCloud. My leader has a version of
 higher than replica as well (I have one leader and one replica for each
 shard). If I kill leader, replica will be leader as well. When I startup
 old leader again it will be a replica for my shard.

 However I think that leader will have less document than replica and a less
 version than replica. Does it cause a problem because of leader is behing
 of replica?



Re: What Happens to Consistency if I kill a Leader and Startup it again?

2013-05-02 Thread Furkan KAMACI
Thanks for the answer. This is what I try to say:

time = t
Node A (Leader):  version is 100
Node B (Replica): version is 90

time = t+1
Node A (Killing):  version is 100 and killed
Node B (Replica): version is 90

time = t+2
Node A (Killed):  version is 100 and killed
Node B (Become Leader): version is 95 (we indexed something)

time = t+3
Node A (Started as Replica):  version is 100 and live
Node B (Leader): version is 95

so I think that leader will behind replica. Is there anything different for
such scenario?



2013/5/2 Otis Gospodnetic otis.gospodne...@gmail.com

 The leader would not be behind replica because the old leader would not
 come back and take over the leader role. It would ne just a replica and it
 would replicate the index from whichever node is the leader.

 Otis
 Solr  ElasticSearch Support
 http://sematext.com/
 On Apr 29, 2013 5:31 PM, Furkan KAMACI furkankam...@gmail.com wrote:

  I think about such situation:
 
  Let's assume that I am indexing at my SolrCloud. My leader has a version
 of
  higher than replica as well (I have one leader and one replica for each
  shard). If I kill leader, replica will be leader as well. When I startup
  old leader again it will be a replica for my shard.
 
  However I think that leader will have less document than replica and a
 less
  version than replica. Does it cause a problem because of leader is behing
  of replica?
 



Re: What Happens to Consistency if I kill a Leader and Startup it again?

2013-05-02 Thread Raymond Wiker
If you're using zookeeper, this should not be allowed to happen (I think).


On Thu, May 2, 2013 at 2:12 PM, Furkan KAMACI furkankam...@gmail.comwrote:

 Thanks for the answer. This is what I try to say:

 time = t
 Node A (Leader):  version is 100
 Node B (Replica): version is 90

 time = t+1
 Node A (Killing):  version is 100 and killed
 Node B (Replica): version is 90

 time = t+2
 Node A (Killed):  version is 100 and killed
 Node B (Become Leader): version is 95 (we indexed something)

 time = t+3
 Node A (Started as Replica):  version is 100 and live
 Node B (Leader): version is 95

 so I think that leader will behind replica. Is there anything different for
 such scenario?



 2013/5/2 Otis Gospodnetic otis.gospodne...@gmail.com

  The leader would not be behind replica because the old leader would not
  come back and take over the leader role. It would ne just a replica and
 it
  would replicate the index from whichever node is the leader.
 
  Otis
  Solr  ElasticSearch Support
  http://sematext.com/
  On Apr 29, 2013 5:31 PM, Furkan KAMACI furkankam...@gmail.com wrote:
 
   I think about such situation:
  
   Let's assume that I am indexing at my SolrCloud. My leader has a
 version
  of
   higher than replica as well (I have one leader and one replica for each
   shard). If I kill leader, replica will be leader as well. When I
 startup
   old leader again it will be a replica for my shard.
  
   However I think that leader will have less document than replica and a
  less
   version than replica. Does it cause a problem because of leader is
 behing
   of replica?
  
 



Re: What Happens to Consistency if I kill a Leader and Startup it again?

2013-05-02 Thread Otis Gospodnetic
Hi,

Can you actually make this happen?

Otis
Solr  ElasticSearch Support
http://sematext.com/
On May 2, 2013 8:12 AM, Furkan KAMACI furkankam...@gmail.com wrote:

 Thanks for the answer. This is what I try to say:

 time = t
 Node A (Leader):  version is 100
 Node B (Replica): version is 90

 time = t+1
 Node A (Killing):  version is 100 and killed
 Node B (Replica): version is 90

 time = t+2
 Node A (Killed):  version is 100 and killed
 Node B (Become Leader): version is 95 (we indexed something)

 time = t+3
 Node A (Started as Replica):  version is 100 and live
 Node B (Leader): version is 95

 so I think that leader will behind replica. Is there anything different for
 such scenario?



 2013/5/2 Otis Gospodnetic otis.gospodne...@gmail.com

  The leader would not be behind replica because the old leader would not
  come back and take over the leader role. It would ne just a replica and
 it
  would replicate the index from whichever node is the leader.
 
  Otis
  Solr  ElasticSearch Support
  http://sematext.com/
  On Apr 29, 2013 5:31 PM, Furkan KAMACI furkankam...@gmail.com wrote:
 
   I think about such situation:
  
   Let's assume that I am indexing at my SolrCloud. My leader has a
 version
  of
   higher than replica as well (I have one leader and one replica for each
   shard). If I kill leader, replica will be leader as well. When I
 startup
   old leader again it will be a replica for my shard.
  
   However I think that leader will have less document than replica and a
  less
   version than replica. Does it cause a problem because of leader is
 behing
   of replica?
  
 



Re: What Happens to Consistency if I kill a Leader and Startup it again?

2013-05-02 Thread Furkan KAMACI
Hi Otis;

I see that at my admin page:

Replication (Slave)  Version  GenSize
Master:  1367307652512   82  778.04 MB
Slave:   1367307658862   82  781.05 MB

and I started to figure about it so that's why I asked this question.


2013/5/2 Otis Gospodnetic otis.gospodne...@gmail.com

 Hi,

 Can you actually make this happen?

 Otis
 Solr  ElasticSearch Support
 http://sematext.com/
 On May 2, 2013 8:12 AM, Furkan KAMACI furkankam...@gmail.com wrote:

  Thanks for the answer. This is what I try to say:
 
  time = t
  Node A (Leader):  version is 100
  Node B (Replica): version is 90
 
  time = t+1
  Node A (Killing):  version is 100 and killed
  Node B (Replica): version is 90
 
  time = t+2
  Node A (Killed):  version is 100 and killed
  Node B (Become Leader): version is 95 (we indexed something)
 
  time = t+3
  Node A (Started as Replica):  version is 100 and live
  Node B (Leader): version is 95
 
  so I think that leader will behind replica. Is there anything different
 for
  such scenario?
 
 
 
  2013/5/2 Otis Gospodnetic otis.gospodne...@gmail.com
 
   The leader would not be behind replica because the old leader would not
   come back and take over the leader role. It would ne just a replica and
  it
   would replicate the index from whichever node is the leader.
  
   Otis
   Solr  ElasticSearch Support
   http://sematext.com/
   On Apr 29, 2013 5:31 PM, Furkan KAMACI furkankam...@gmail.com
 wrote:
  
I think about such situation:
   
Let's assume that I am indexing at my SolrCloud. My leader has a
  version
   of
higher than replica as well (I have one leader and one replica for
 each
shard). If I kill leader, replica will be leader as well. When I
  startup
old leader again it will be a replica for my shard.
   
However I think that leader will have less document than replica and
 a
   less
version than replica. Does it cause a problem because of leader is
  behing
of replica?
   
  
 



Re: What Happens to Consistency if I kill a Leader and Startup it again?

2013-05-02 Thread Shawn Heisey
On 5/2/2013 2:19 PM, Furkan KAMACI wrote:
 I see that at my admin page:
 
 Replication (Slave)  Version  GenSize
 Master:  1367307652512   82  778.04 MB
 Slave:   1367307658862   82  781.05 MB
 
 and I started to figure about it so that's why I asked this question.

As we've been trying to tell you, the sizes can (and will) be different
between replicas on SolrCloud.  Also, if you're not running a recent
release candidate of 4.3, then the version numbers on the replication
screen are misleading.  See SOLR-4661 for more details.

Your example of version numbers like 100, 90, and 95 wouldn't actually
happen, because the version number is based on the current time in
milliseconds since 1970-01-01 00:00:00 UTC.  If you index after killing
the leader, the new leader's version number will be higher than the
offline replica.

If you can find actual proof of a problem with index updates related to
killing the leader, then we can take the bug report and work on fixing
it.  Here's how you would go about finding proof.  It would be easiest
to have one shard, but if you want to make sure it's OK with multiple
shards, you would have to kill all the leaders.

* Start with a functional collection with two replicas.
* Index a document with a recognizable ID like A.
* Make sure you can find document A.
* Kill the leader replica, let's say it was replica1.
* Make sure replica2 becomes leader.
* Make sure you can find document A.
* Index document B.
* Start replica1, wait for it to turn green.
* Make sure you can still find document B.
* Kill the leader again, this time it's replica2.
* Make sure you can still find document B.

To my knowledge, nobody has reported a real problem with proof.  I would
imagine that more than one person has done testing like this to make
sure that SolrCloud is reliable.

Thanks,
Shawn