From patchwork Fri Apr 12 02:31:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihar Hrachyshka X-Patchwork-Id: 1922812 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=I3zQZ31a; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VG0vY15gJz1yYL for ; Fri, 12 Apr 2024 12:32:09 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 647AB41B76; Fri, 12 Apr 2024 02:32:07 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id xIRxd2ZzIx9t; Fri, 12 Apr 2024 02:32:06 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 33133400FC Authentication-Results: smtp2.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=I3zQZ31a Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id 33133400FC; Fri, 12 Apr 2024 02:32:06 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 06438C0077; Fri, 12 Apr 2024 02:32:06 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 47EE8C0037 for ; Fri, 12 Apr 2024 02:32:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 366EA41EB8 for ; Fri, 12 Apr 2024 02:32:04 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id DBqvXNXa_Ov7 for ; Fri, 12 Apr 2024 02:32:03 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=ihrachys@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org F1B0B41EB6 Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org F1B0B41EB6 Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=I3zQZ31a Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id F1B0B41EB6 for ; Fri, 12 Apr 2024 02:32:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712889121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LAPK8xladwSlygHvHjiSv10w4R1xz/vLrP0JFYPF76M=; b=I3zQZ31a9TbxvmUfa5Kx7hibSKMEahDZE1rIkUjapXEVPmpoJ8BujbpFIp4qlQI93/zuv0 DCErLHk+hTu5K11+eJdn3EidjB2Zy1sPqAmnf7Ho6nxbCvC/scW7YZIckk6ZRn83xYLD0I CCOHer+8bUgLaf5vuU6pwdvBgPX0IBQ= Received: from mail-yw1-f197.google.com (mail-yw1-f197.google.com [209.85.128.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-138-FFoHYOvKOAuMXBUf6ZakFA-1; Thu, 11 Apr 2024 22:32:00 -0400 X-MC-Unique: FFoHYOvKOAuMXBUf6ZakFA-1 Received: by mail-yw1-f197.google.com with SMTP id 00721157ae682-60cd62fa1f9so6801047b3.0 for ; Thu, 11 Apr 2024 19:32:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712889120; x=1713493920; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LAPK8xladwSlygHvHjiSv10w4R1xz/vLrP0JFYPF76M=; b=OTdoVPjfLa29MYMhNwR8nSEAIMj91p+XWmWEyIkCfoLQzzTps0UUSR6BR6R/FLlBsh +TBWPp5IgF/C3V2zLJgZdB3v3acMtgGbRe/S9rXpCgIyd2AM/NjK2vNZyrpNh/5nx/N+ cKCcBp4m1Q7/4YKQ8QnvFETvCB3yK9WOpvnQu5o/J0YDt7zRUNqLrbAvqbZgrHuDen+3 hELyUBtDTineAQvJaYnOF5CZzMNM9SEMromNySVPnNXJFiqrUJs6xvre5hIseiM22zuO rLTMyeAfztWOfTch3ejvBU1C/Dv8TMJP9rZ/IjHIWPlRC8eNOzjVsHcvZaM1LCuZ0s+E nxPg== X-Gm-Message-State: AOJu0Yy6MhE9C91S+RIRFsag0jxu2P0zG312y7AXrdjpXkGz5IFwIp3t LrdggFCxOYdMM6Ms3ZwLQEW3w8cylJMToPWKTHwWY50x9lKtuMsp6hbtJquRVr1e+xWDsFmyC3/ 7+wkAYlcnXe/rv/Fcy+1mITHRkOsk1hF+jPu70f4G/z9s1c0zTYKd8tSG5Ng2/yQ15xfLwSLVsP a/aTViBNqkSIqNRz6SqcPLk+EL4lMjzThjSg== X-Received: by 2002:a25:20d5:0:b0:de0:d32b:52bf with SMTP id g204-20020a2520d5000000b00de0d32b52bfmr1313474ybg.39.1712889119813; Thu, 11 Apr 2024 19:31:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGct6nzF5M8S3PtAJtIVdL7rZZcAnh8++MEVafb7Bnc+ddWJKnagwatZDc/FDMGJk0MX0HDXA== X-Received: by 2002:a25:20d5:0:b0:de0:d32b:52bf with SMTP id g204-20020a2520d5000000b00de0d32b52bfmr1313460ybg.39.1712889119153; Thu, 11 Apr 2024 19:31:59 -0700 (PDT) Received: from fedora38.localdomain (172-073-180-250.res.spectrum.com. [172.73.180.250]) by smtp.gmail.com with ESMTPSA id b12-20020ad4518c000000b0069b27dad8c7sm1703992qvp.101.2024.04.11.19.31.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 19:31:58 -0700 (PDT) From: Ihar Hrachyshka To: dev@openvswitch.org Date: Fri, 12 Apr 2024 02:31:43 +0000 Message-ID: <20240412023143.4157646-1-ihrachys@redhat.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH] docs: Document manual cluster recovery procedure. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Remove the notion of cluster/leave --force since it was never implemented. Instead of these instructions, document how a broken cluster can be re-initialized with the old database contents. Signed-off-by: Ihar Hrachyshka Acked-by: Simon Horman --- Documentation/ref/ovsdb.7.rst | 50 +++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/Documentation/ref/ovsdb.7.rst b/Documentation/ref/ovsdb.7.rst index 46ed13e61..5882643a0 100644 --- a/Documentation/ref/ovsdb.7.rst +++ b/Documentation/ref/ovsdb.7.rst @@ -315,16 +315,11 @@ The above methods for adding and removing servers only work for healthy clusters, that is, for clusters with no more failures than their maximum tolerance. For example, in a 3-server cluster, the failure of 2 servers prevents servers joining or leaving the cluster (as well as database access). + To prevent data loss or inconsistency, the preferred solution to this problem is to bring up enough of the failed servers to make the cluster healthy again, -then if necessary remove any remaining failed servers and add new ones. If -this cannot be done, though, use ``ovs-appctl`` to invoke ``cluster/leave ---force`` on a running server. This command forces the server to which it is -directed to leave its cluster and form a new single-node cluster that contains -only itself. The data in the new cluster may be inconsistent with the former -cluster: transactions not yet replicated to the server will be lost, and -transactions not yet applied to the cluster may be committed. Afterward, any -servers in its former cluster will regard the server to have failed. +then if necessary remove any remaining failed servers and add new ones. If this +is not an option, see the next section for manual recovery procedure. Once a server leaves a cluster, it may never rejoin it. Instead, create a new server and join it to the cluster. @@ -362,6 +357,45 @@ Clustered OVSDB does not support the OVSDB "ephemeral columns" feature. ones when they work with schemas for clustered databases. Future versions of OVSDB might add support for this feature. +Manual cluster recovery +~~~~~~~~~~~~~~~~~~~~~~~ + +If kicking and rejoining failed members to the existing cluster is not +available in your environment, you may consider to recover the cluster +manually, as follows. + +*Important*: The procedure below will result in `cid` and `sid` change. +Afterward, any servers in the former cluster will regard the recovered server +failed. + +If you understand the risks and are still willing to proceed, then: + +1. Stop the old cluster ``ovsdb-server`` instances before proceeding. + +2. Pick one of the old members which will serve as the bootstrap member of the + to-be-recovered cluster. + +3. Convert its database file to standalone format using ``ovsdb-tool + cluster-to-standalone``. + +4. Backup the standalone database file. You will use the file in the next step. + +5. Re-initialize the new cluster with the bootstrap member (``ovsdb-tool + create-cluster``) using the previously saved database file. + +6. Start the bootstrapped cluster with this new member. + +Once you confirmed that the single member cluster is up and running and serves +the restored data, you may proceed with joining the rest of the members to the +newly formed cluster, as usual (``ovsdb-tool join-cluster``). + +Once the cluster is restored, any active clients will have to reconnect to the +new cluster. + +Note: The data in the new cluster may be inconsistent with the former cluster: +transactions not yet replicated to the server will be lost, and transactions +not yet applied to the cluster may be committed. + Upgrading from version 2.14 and earlier to 2.15 and later ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~