Node was unavailable after restart and only became healthy after new nodes were added to the cluster
We are running a 3 node cluster in secure mode with version v2.0.6 on Kubernetes using the official Docker image. One of the nodes started failing after a restart. It might be potentially caused by these issues https://github.com/cockroachdb/cockroach#28179 https://github.com/cockroachdb/cockroach#27731
but I'm not 100% sure that's why I'm opening a new one.
The dead node was logging messages like the ones below repeatedly
W181022 10:41:35.303146 266 storage/node_liveness.go:504 [n1,hb] slow heartbeat took 4.5s
W181022 10:41:35.303206 266 storage/node_liveness.go:441 [n1,hb] failed node liveness heartbeat: context deadline exceeded
W181022 10:41:35.752618 267 sql/jobs/registry.go:300 canceling all jobs due to liveness failure
Another node had the following errors in the logs
I181022 10:45:33.278745 6065295 storage/replica_command.go:863 [split,n3,s3,r44/3:/System/tsd/cr.node.sql.m…] initiating a split of this range at key /System/tsd/cr.node.sql.mem.internal.txn.max-p99/1/10s/2018-10-17T23:00:00Z [r534]
I181022 10:45:37.632321 266 gossip/gossip.go:488 [n3] gossip status (ok, 3 nodes)
gossip client (1/3 cur/max conns)
2: cockroachdb-2.cockroachdb.partner.svc.cluster.local:26257 (27h28m6s: infos 47690/20255 sent/received, bytes 10264715B/5678004B sent/received)
gossip server (0/3 cur/max conns, infos 161575/437923 sent/received, bytes 35472029B/69510070B sent/received)
I181022 10:45:37.633375 269 server/status/runtime.go:219 [n3] runtime stats: 9.1 GiB RSS, 298 goroutines, 199 MiB/51 MiB/299 MiB GO alloc/idle/total, 7.5 GiB/8.8 GiB CGO alloc/total, 166.70cgo/sec, 0.04/0.01 %(u/s)time, 0.00 %gc (0x)
W181022 10:45:38.641241 6063587 internal/client/txn.go:556 [split,n3,s3,r5/3:/System/tsd{-/cr.nod…}] failure aborting transaction: HandledRetryableTxnError: TransactionAbortedError: txn aborted "split" id=7ac2db8d key=/Local/Range/System/tsd/RangeDescriptor rw=true pri=0.03857822 iso=SERIALIZABLE stat=PENDING epo=0 ts=1540205078.679824586,0 orig=1540205078.679824586,0 max=1540205079.179824586,0 wto=false rop=false seq=10; abort caused by: failed to send RPC: sending to all 3 replicas failed; last error: {<nil> context deadline exceeded}
E181022 10:45:38.641302 6063587 storage/queue.go:767 [split,n3,s3,r5/3:/System/tsd{-/cr.nod…}] failed to send RPC: sending to all 3 replicas failed; last error: {<nil> context deadline exceeded}
I181022 10:45:38.688012 6065505 storage/replica_command.go:863 [split,n3,s3,r5/3:/System/tsd{-/cr.nod…}] initiating a split of this range at key /System/tsd/cr.node.distsender.batches.partial/2/10s/2018-10-16T09:00:00Z [r535]
I181022 10:45:47.633443 269 server/status/runtime.go:219 [n3] runtime stats: 9.1 GiB RSS, 300 goroutines, 219 MiB/36 MiB/299 MiB GO alloc/idle/total, 7.5 GiB/8.8 GiB CGO alloc/total, 157.80cgo/sec, 0.04/0.01 %(u/s)time, 0.00 %gc (0x)
I181022 10:45:57.633454 269 server/status/runtime.go:219 [n3] runtime stats: 9.1 GiB RSS, 301 goroutines, 242 MiB/17 MiB/299 MiB GO alloc/idle/total, 7.5 GiB/8.8 GiB CGO alloc/total, 155.20cgo/sec, 0.04/0.02 %(u/s)time, 0.00 %gc (0x)
W181022 10:46:03.201423 6064485 internal/client/txn.go:556 [split,n3,s3,r39/3:/System/tsd/cr.node.sql.…] failure aborting transaction: HandledRetryableTxnError: TransactionAbortedError: txn aborted "split" id=a857b7a0 key=/Local/Range/System/tsd/cr.node.sql.service.latency-p90/3/10s/2018-10-05T09:00:00Z/RangeDescriptor rw=true pri=0.00243871 iso=SERIALIZABLE stat=PENDING epo=0 ts=1540205103.277219796,0 orig=1540205103.277219796,0 max=1540205103.777219796,0 wto=false rop=false seq=8; abort caused by: context deadline exceeded
E181022 10:46:03.201479 6064485 storage/queue.go:767 [split,n3,s3,r39/3:/System/tsd/cr.node.sql.…] split at key /System/tsd/cr.node.sql.service.latency-p99.999/2/10s/2018-10-17T09:00:00Z failed: context deadline exceeded
W181022 10:46:03.224616 6065435 storage/intent_resolver.go:388 [n3,s3] failed to cleanup transaction intents: failed to resolve intents: context deadline exceeded
I've checked the certificates and they were all valid and all nodes seemed to be able to open connections to all the other nodes.
Once, I've scaled the cluster to 5 nodes the problem seemed to resolve itself. You can find all the logs obtained by running debug zip command from all the nodes here.
Hey @SpeedyCoder,
Looks like you were correct in that this is related to the first issue you linked above, and your logs confirm this issue.
Luckily this has been fixed in the 2.1 beta release which should be out in a few weeks. Here is the PR that has the fix:
https://github.com/cockroachdb/cockroach/pull/28963
Once you upgrade to the 2.1 beta you shouldn't have this issue anymore. Since this issue is closed, I'll close this issue out as well. However if you run into this issue or any other issues after the upgrade, please feel free to reopen/open a new issue.
Thanks,
Ron
Great, thank you @roncrdb. In the meantime, is there an easy way to fix a node that enters this state other than adding new nodes?
Hey @SpeedyCoder,
Do you mind sending us over your debug zip in order to look into this issue further. If you're unsure how to send that over, you can follow this guide:
https://www.cockroachlabs.com/docs/v2.0/debug-zip.html#subcommands
Thanks,
Ron
So you know why we're asking: the issues you linked to earlier apparently weren't expected to impact 3 node clusters. So either we're looking at a fresh issue or we missed something in the earlier investigation. A debug zip may help confirm.
@roncrdb @tim-o yeah no problem, I've got one that I took during the outage with 3 nodes and another one taken just after with 5 nodes. Where should I send them?
@SpeedyCoder ,
You could upload the debug zip to and send it to us like you did the logs, or email it directly to me at [email protected]
Thanks!
@roncrdb I've sent you an email
@SpeedyCoder ,
Got the email, thanks!
We looked into this issue further, from the logs, does not appear to be the gossip issue we originally thought it was.
Here are the gossip snippets from the time when issue occurred:
GOSSIP 488:
NODE 1:
I181022 08:34:19.211176 254 gossip/gossip.go:488 [n1] gossip status (ok, 3 nodes)
gossip client (1/3 cur/max conns)
2: cockroachdb-2.cockroachdb.partner.svc.cluster.local:26257 (59s: infos 35/169 sent/received, bytes 6170B/74577B sent/received)
gossip server (0/3 cur/max conns, infos 35/169 sent/received, bytes 6264B/74671B sent/received)
I181022 08:34:19.212262 257 server/status/runtime.go:219 [n1] runtime stats: 230 MiB RSS, 203 goroutines, 110 MiB/27 MiB/155 MiB GO alloc/idle/total, 36 MiB/46 MiB CGO alloc/total, 83.70cgo/sec, 0.02/0.01 %(u/s)time, 0.00 %gc (0x)
NODE2:
I181022 08:34:16.310811 241 gossip/gossip.go:488 [n2] gossip status (ok, 3 nodes)
gossip client (0/3 cur/max conns)
gossip server (2/3 cur/max conns, infos 144294/90523 sent/received, bytes 31738419B/23292036B sent/received)
3: cockroachdb-1.cockroachdb.partner.svc.cluster.local:26257 (25h16m44s)
1: cockroachdb-0.cockroachdb.partner.svc.cluster.local:26257 (56s)
NODE3:
I181022 08:34:37.632318 266 gossip/gossip.go:488 [n3] gossip status (ok, 3 nodes)
gossip client (1/3 cur/max conns)
2: cockroachdb-2.cockroachdb.partner.svc.cluster.local:26257 (25h17m6s: infos 43698/18433 sent/received, bytes 9335704B/5127255B sent/received)
gossip server (0/3 cur/max conns, infos 157583/436101 sent/received, bytes 34543018B/68959321B sent/received)
Connection for Node 1 was held, if we look at later 488 messages, you'll see that time increases by a minute each time.
@SpeedyCoder
Thanks for the Debug Zip, I've added my findings for our engineers to look into. As mentioned before this isn't what we originally thought it was, so they will need to look into it further. Please let us know if this happens again.
Thanks,
Ron
@roncrdb awesome thank you, will get in touch in case I see the issue again
Closing due to inactivity.