From patchwork Thu Aug 13 11:22:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy Redaelli X-Patchwork-Id: 2285203 X-Patchwork-Delegate: i.maximets@samsung.com 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=S4pKMDi0; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (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 4hLNJ96zlkz1xtr for ; Thu, 13 Aug 2026 21:22:49 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 80A9F60AEF; Thu, 13 Aug 2026 11:22:48 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id GP0TB4uEO2o9; Thu, 13 Aug 2026 11:22:47 +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 smtp3.osuosl.org 91A1F608AE Authentication-Results: smtp3.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=S4pKMDi0 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 91A1F608AE; Thu, 13 Aug 2026 11:22:47 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4DEA9C055C; Thu, 13 Aug 2026 11:22:47 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4C900C040E for ; Thu, 13 Aug 2026 11:22:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3ED82608BF for ; Thu, 13 Aug 2026 11:22:46 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id MSur1DwzRwmd for ; Thu, 13 Aug 2026 11:22:45 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=tredaelli@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 2A05F608AE Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 2A05F608AE Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp3.osuosl.org (Postfix) with ESMTP id 2A05F608AE for ; Thu, 13 Aug 2026 11:22:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786620163; 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=Cd7CNPwQQrAC6swy40U4DK66wP4UZJrocQX8aUcxp2E=; b=S4pKMDi0zMK/xtN2FGzD6mmwM4Nd3/tEk3LtNd8tyVcPsiSPHXMtNsNoVgnbfLjDRrDwC6 e8+CMLOWJopJJHt4GsivVSaOTkhwTfaoDCePu2anNqyrK96aUoVaU/uGs4ENZstdnHHP0a D4Pf64C/vk7EhQltnQ4baqhdHIkTegI= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-589-QEYf2AliN9q2nf9qD7x5ug-1; Thu, 13 Aug 2026 07:22:42 -0400 X-MC-Unique: QEYf2AliN9q2nf9qD7x5ug-1 X-Mimecast-MFC-AGG-ID: QEYf2AliN9q2nf9qD7x5ug_1786620161 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 38DC419560BB for ; Thu, 13 Aug 2026 11:22:41 +0000 (UTC) Received: from aldebaran.redhat.com (unknown [10.44.49.126]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2D0A730001A2 for ; Thu, 13 Aug 2026 11:22:39 +0000 (UTC) To: dev@openvswitch.org Date: Thu, 13 Aug 2026 13:22:36 +0200 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: -3N0Dm34RoI_7lkUWJK8KFe1e7x4tmQeOr8FHtzPMqo_1786620161 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH v2] ovsdb-cluster.at: Fix race in the disruptive server test. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Timothy Redaelli via dev From: Timothy Redaelli Reply-To: Timothy Redaelli Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" The last two transactions of the "disruptive server with the old term and outdated log" test are checked on every server as soon as the leader replied. A successful transaction reply only guarantees that the entry was committed by a majority; a follower may not have learned the new commit index and applied the entry yet. The test then reads stale data with --no-leader-only and fails: ./ovsdb-cluster.at:1104: ovs-vsctl --db=unix:s$i.ovsdb --no-leader-only \ --bare --columns=type list QoS | grep . | sort | tr -d '\n' @@ -1 +1 @@ -lmxyz +lxyz Wait for the data with OVS_WAIT_UNTIL_EQUAL instead of reading it once. Fixes: 5d1fa6e4a4b0 ("ovsdb-cluster.at: Test disruptive server with outdated log and term.") Signed-off-by: Timothy Redaelli --- Changes from v1: - Fixed "Fixes" line to use 12 characters hash. --- tests/ovsdb-cluster.at | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/ovsdb-cluster.at b/tests/ovsdb-cluster.at index 1dd74e3de..323162a1d 100644 --- a/tests/ovsdb-cluster.at +++ b/tests/ovsdb-cluster.at @@ -1098,12 +1098,19 @@ AT_CHECK([ovs-vsctl --db=unix:s1.ovsdb --no-leader-only --no-wait create QoS typ AT_CHECK([ovs-vsctl --db=unix:s1.ovsdb --no-leader-only --no-wait create QoS type=m], [0], [ignore], [ignore]) # Check that all the servers are in the cluster and have all the data. +# A successful transaction reply only guarantees that the entry was committed +# by a majority. A follower may not have learned the new commit index and +# applied it yet, so wait for every server to catch up. for i in $(seq $n); do AT_CHECK([ovs-appctl -t $(pwd)/s$i cluster/status $schema_name \ | grep -qE "Role: (leader|follower)"]) - AT_CHECK([ovs-vsctl --db=unix:s$i.ovsdb --no-leader-only --bare \ - --columns=type list QoS | grep . | sort | tr -d '\n'], - [0], [lmxyz]) + OVS_WAIT_UNTIL_EQUAL([ovs-vsctl --db=unix:s$i.ovsdb --no-leader-only \ + --bare --columns=type list QoS | grep . | sort], [dnl +l +m +x +y +z]) done # Check that s3 never won a pre-vote.