cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

first range replication never succeeds

Open petermattis opened this issue 11 years ago • 11 comments

This can be seen in the TestRangeReplication acceptance test. Run using TESTS=RangeReplication acceptance/run.sh. Every once in a while the test will hang after finding 2 replicas. Still trying to piece together what is going on. Looks like something is going wrong with gossip. All 3 nodes are complaining about:

W0529 16:58:45.168017       1 gossip.go:483] missing sentinel gossip 1; assuming partition and reconnecting

That might be a red-herring, though. Early in the logs I'm seeing errors like:

E0529 16:52:39.105180       1 range_command.go:395] InternalRangeLookup dispatched to correct range, but no matching RangeDescriptor was found. key range "\x00\x00meta1\xff\xff"-"" outside of bounds of range ""-"\xff\xff"

petermattis avatar May 29 '15 17:05 petermattis

https://github.com/cockroachdb/cockroach/pull/1171/files

might fix the error log you are seeing. On Fri, May 29, 2015 at 1:08 PM Peter Mattis [email protected] wrote:

This can be seen in the TestRangeReplication acceptance test. Run using TESTS=RangeR eplication acceptance/run.sh. Every once in a while the test will hang after finding 2 replicas. Still trying to piece together what is going on. Looks like something is going wrong with gossip. All 3 nodes are complaining about:

W0529 16:58:45.168017 1 gossip.go:483] missing sentinel gossip 1; assuming partition and reconnecting

That might be a red-herring, though. Early in the logs I'm seeing errors like:

E0529 16:52:39.105180 1 range_command.go:395] InternalRangeLookup dispatched to correct range, but no matching RangeDescriptor was found. key range "\x00\x00meta1\xff\xff"-"" outside of bounds of range ""-"\xff\xff"

— Reply to this email directly or view it on GitHub https://github.com/cockroachdb/cockroach/issues/1193.

vivekmenezes avatar May 29 '15 17:05 vivekmenezes

Do you have a full log for this @petermattis? If you can reproduce it, see if it goes away if you set multiraft.EventBufferSize to (say) 1000. If that fixes it, then you've likely got #1185 on two nodes, preventing a working first range and thus gossiping.

tbg avatar May 29 '15 21:05 tbg

@tschottdorf It is very reproducible. I just run while :; do go test -v -tags acceptance -run RangeReplication; done until it hangs. Do you want me to grab logs? Any particular -vmodule settings?

petermattis avatar May 29 '15 21:05 petermattis

Let me see if I can just get it here.

tbg avatar May 29 '15 21:05 tbg

Ok. I'm trying to reproduce with the following patch applied:

diff --git a/storage/store.go b/storage/store.go
index 7d8055a..d6fffdb 100644
--- a/storage/store.go
+++ b/storage/store.go
@@ -419,6 +419,7 @@ func (s *Store) Start(stopper *util.Stopper) error {
                TickInterval:           s.ctx.RaftTickInterval,
                ElectionTimeoutTicks:   s.ctx.RaftElectionTimeoutTicks,
                HeartbeatIntervalTicks: s.ctx.RaftHeartbeatIntervalTicks,
+               EventBufferSize:        1000,
                EntryFormatter:         raftEntryFormatter,
        }, s.stopper); err != nil {
                return err

petermattis avatar May 29 '15 21:05 petermattis

FYI, it can can a dozen or so runs for the problem to occur.

petermattis avatar May 29 '15 21:05 petermattis

I'm well above 100 runs on current master without getting this. Must be Your Magic Machine(TM). Let's see if the diff above makes it disappear. That would be a fairly clear indication if it's otherwise reproducible.

tbg avatar May 29 '15 21:05 tbg

It's running fine for me with the patch. Let me try without the patch to verify I can reproduce.

petermattis avatar May 29 '15 21:05 petermattis

Ok, reproduced again without the patch. Took 71 runs. Going to leave it running with the patch again.

petermattis avatar May 29 '15 21:05 petermattis

With the patch I've completed 507 successful runs. Seems pretty clear that the raft deadlock was the problem.

petermattis avatar May 29 '15 23:05 petermattis

Cool. Wanna close this in favor of #1185?

tbg avatar May 29 '15 23:05 tbg