From patchwork Tue Jun 8 02:14:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 1489061 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: 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=GYXBrPRC; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FzYj70l50z9sSn for ; Tue, 8 Jun 2021 12:14:51 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 6CBF360883; Tue, 8 Jun 2021 02:14:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xpLzvhdj7Ndy; Tue, 8 Jun 2021 02:14:44 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTP id 77EE8605DD; Tue, 8 Jun 2021 02:14:43 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 49948C000B; Tue, 8 Jun 2021 02:14:43 +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 9614BC0001 for ; Tue, 8 Jun 2021 02:14:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 846F24041E for ; Tue, 8 Jun 2021 02:14:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Jo-HdJZEbEhw for ; Tue, 8 Jun 2021 02:14:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id 0951440410 for ; Tue, 8 Jun 2021 02:14:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623118476; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=59mZYGG64n35Ls98ok7Zj4Sz4Wnv6ft3FG7XDZS/42g=; b=GYXBrPRCqaEfB+W60zM48KS2Xv3HJsk0RxiwYw3Yosg/hiFRYZ/Qjw6wmASSkEEgXGhltT SN6xOc4DcObLR85WVUujm1ENPOnzDIC6YSCTUx7fLPnXwKujVpA9GRskCsn5D2B8iCArhB xXXIJQ+w4FFQLe4OkwJMxvLb8tucFzQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-427-VaVQp1pqNTiqykSSfKs6CQ-1; Mon, 07 Jun 2021 22:14:35 -0400 X-MC-Unique: VaVQp1pqNTiqykSSfKs6CQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 57266180FD70 for ; Tue, 8 Jun 2021 02:14:34 +0000 (UTC) Received: from localhost.localdomain (unknown [10.10.110.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id E1E6A5B826 for ; Tue, 8 Jun 2021 02:14:33 +0000 (UTC) Message-ID: From: Dan Williams To: dev@openvswitch.org Date: Mon, 07 Jun 2021 21:14:32 -0500 User-Agent: Evolution 3.40.1 (3.40.1-1.fc34) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dcbw@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH v2] ovs-lib: pass optional --election-timer arg to ovsdb-tool 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" Signed-off-by: Dan Williams --- v2: put --election-timer arg before create-cluster per Ilya  utilities/ovs-lib.in | 10 ++++++++--  1 file changed, 8 insertions(+), 2 deletions(-) -               ovsdb_tool create-cluster "$DB_FILE" "$backup" "$LOCAL_ADDR" +               ovsdb_tool "$election_timer_arg" create-cluster "$DB_FILE" "$backup" "$LOCAL_ADDR"      fi  } diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in index ab38ece458b7b..61a062fa992da 100644 --- a/utilities/ovs-lib.in +++ b/utilities/ovs-lib.in @@ -495,15 +495,21 @@ create_cluster () {      DB_FILE="$1"      DB_SCHEMA="$2"      LOCAL_ADDR="$3" +    ELECTION_TIMER_MS="$4" + +    election_timer_arg= +    if [ -n "$ELECTION_TIMER_MS" ]; then +      election_timer_arg="--election-timer=$ELECTION_TIMER_MS" +    fi        if test ! -e "$DB_FILE"; then -        action "Creating cluster database $DB_FILE" ovsdb_tool create- cluster "$DB_FILE" "$DB_SCHEMA" "$LOCAL_ADDR" +        action "Creating cluster database $DB_FILE" ovsdb_tool "$election_timer_arg" create-cluster "$DB_FILE" "$DB_SCHEMA" "$LOCAL_ADDR"      elif ovsdb_tool db-is-standalone "$DB_FILE"; then          # Convert standalone database to clustered.          backup_db || return 1          rm -f "$DB_FILE"          action "Creating cluster database $DB_FILE from existing one" \