cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

Rolling Upgrade / Replacement of nodes leaves Under-Replicated / Unavailable ranges

Open Timbo000002 opened this issue 7 years ago • 11 comments

I refreshed our 4 node x 2 region AWS EC2 cluster to upgrade to 2.1.3 using a rolling replace UI showing 19 Under-Replicated / Unavailable ranges. Related: 11 dead and 14 decommed nodes.

FYI: During the previous refresh changed the default port from 26257 to 5432 due to corporate firewall rules so we can access the cluster with DBeaver. The port change did not cause any Under/Unavailable and before the rolling upgrade was zero.

How I did the rolling replace/upgrade of each node: $> /usr/local/bin/cockroach quit --decommission --host=${COCKROACH_INSTANCE_IP} $> systemctl stop securecockroachdb.service

Then call AWS to drop the node:

If created without stack:

$> /bin/aws ec2 terminate-instances --region=$region --instance-ids ${COCKROACH_INSTANCE_ID}

If created with stack:

$> /bin/aws cloudformation delete-stack --region=$region --stack-name ${STACK_NAME}

When the script runs I observe that it is draining and then exits out and allows the stop and drop to occur.

I don't have any logs from the dropped instances, but before you ask let's agree on next steps. We can reproduce the above by rolling upgrade to 2.1.5.

Timothy

Timbo000002 avatar Feb 26 '19 22:02 Timbo000002

cc @tim-o could you gather some intel here? Logs will be helpful as well as the range status of some of the unavailable/underreplicated ranges.

@Timbo000002 when decommissioning these nodes, you're waiting for the decommissioning process to finish before proceeding, right?

tbg avatar Feb 27 '19 13:02 tbg

Yes, code waits for quit command to return before stopping service and dropping node.

On Wed, Feb 27, 2019, 8:40 AM Tobias Grieger [email protected] wrote:

cc @tim-o https://github.com/tim-o could you gather some intel here? Logs will be helpful as well as the range status of some of the unavailable/underreplicated ranges.

@Timbo000002 https://github.com/Timbo000002 when decommissioning these nodes, you're waiting for the decommissioning process to finish before proceeding, right?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cockroachdb/cockroach/issues/35220#issuecomment-467865331, or mute the thread https://github.com/notifications/unsubscribe-auth/AHf7LPd5-b4rd4fGtVoFjYy9t70c2P_Hks5vRorhgaJpZM4bTRQK .

Timbo000002 avatar Feb 27 '19 20:02 Timbo000002

I see: unable to look up descriptor for

Node Unavailable No Raft Leader Invalid Lease Raft Leader but not Lease Holder Underreplicated (or slow) Quiescent equals ticking Raft log too large Total Error
n9 0 0 0 0 0 0 0 0 unable to look up descriptor for n9
n10 0 0 0 0 0 0 0 0 unable to look up descriptor for n10
n17 0 0 0 0 0 0 0 0 unable to look up descriptor for n17
n18 0 0 0 0 0 0 0 0 unable to look up descriptor for n18
n19 0 0 0 0 0 0 0 0 unable to look up descriptor for n19
n20 0 0 0 0 0 0 0 0 unable to look up descriptor for n20
n21 0 0 0 0 0 0 0 0 unable to look up descriptor for n21
n22 0 0 0 0 0 0 0 0 unable to look up descriptor for n22
n23 0 0 0 0 0 0 0 0 unable to look up descriptor for n23
n24 0 0 0 0 0 0 0 0 unable to look up descriptor for n24
n25 0 0 0 0 0 0 0 0 unable to look up descriptor for n25
n26 8 8 0 0 8 0 0 24  
n27 5 5 0 0 5 0 0 15  
n28 8 7 0 0 8 0 0 23  
n29 6 6 0 0 6 0 0 18  
n30 0 0 0 0 0 0 0 0  
n31 0 0 0 0 0 0 0 0  
n32 0 0 0 0 0 0 0 0 unable to look up descriptor for n32
n33 0 0 0 0 0 0 0 0  
n34 0 0 0 0 0 0 0 0 unable to look up descriptor for n34
n35 0 0 0 0 0 0 0 0 unable to look up descriptor for n35
n36 0 0 0 0 0 0 0 0

Note that for the nodes with errors there is no value in the Error column. Live nodes are: n26, n27, n28, n29, n30, n31, n33, n36. Related to my posts of decommed and dead nodes not clearing from the interface, I suspect there is something related to non clean node decomms, probably obvious to you, but wanted to let you know no dead or decommed nodes every clear the UI. Which is probably why I get a note that the cluster is running on mixed versions but in fact all the live nodes are v2.1.3, because without those clean exits I assume your system tables appear to have nodes in the cluster with ranges no accessible.

cc @tim-o

Timothy

Timbo000002 avatar Mar 08 '19 13:03 Timbo000002

Possibly related to the "unable's" in the report above: https://github.com/cockroachdb/cockroach/issues/31696

Timbo000002 avatar Mar 08 '19 13:03 Timbo000002

@Timbo000002 - it'd be helpful to get logs from the live nodes from a cockroach debug zip. Let me know your email address if you need a private store to send them.

tim-o avatar Mar 08 '19 19:03 tim-o

@tim-o : How can I send my email address without it being public here?

Timbo000002 avatar Mar 11 '19 12:03 Timbo000002

You can't unfortunately. Github doesn't let us see contact information. You can create a private issue on support.cockroachlabs.com if you'd prefer.

tim-o avatar Mar 11 '19 14:03 tim-o

ok, going to get you the logs, are you asking for the logs visible in UI, or when you say debug, is that a logging level setting I need to set 1st and then wait for enough log to generate before packing up the logs? @tim-o

Timbo000002 avatar Mar 18 '19 17:03 Timbo000002

@Timbo000002 I'm referring to the output of a cockroach debug zip. This will collect the logs and DDL from each node currently on the cluster and package them into a single file.

tim-o avatar Mar 18 '19 20:03 tim-o

Well this is interesting, I rehydrated the 8 EC2 instances and now have zero under replicated / unavailable ranges, using the same Jenkins code and CRDB version as before: 2.1.3. The logs are now gone since old servers are decommed, anything of value in these new logs?

If not, I will wait for the issue to happen again, collect the logs and open a private issue.

Thanks @tim-o, Timothy

Timbo000002 avatar Mar 20 '19 18:03 Timbo000002

We have performed the following improvements over v19.2 and v20.1:

  • there is now a "problem range report" and "constraint conformance report" produced every 10 seconds, which collects information about range health and rebalancing. We now recommend to monitor this report when performing a rolling upgrade / replacement and only switch off node when the cluster has become stable after a previous restart.

  • the quit command is now more effective at preventing unavailability, by waiting longer until range leases are transferred.

We believe that the main point that motivated this issue have been addressed. I will now close this; if there is anything else you'd like us to handle, please let us know.

knz avatar May 07 '20 12:05 knz