get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2221253/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2221253,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2221253/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/195d108bcfc9b2337eeb0b7f5fa789804e7c86d0.1775679683.git.lorenzo.bianconi@redhat.com/",
    "project": {
        "id": 47,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/47/?format=api",
        "name": "Open vSwitch",
        "link_name": "openvswitch",
        "list_id": "ovs-dev.openvswitch.org",
        "list_email": "ovs-dev@openvswitch.org",
        "web_url": "http://openvswitch.org/",
        "scm_url": "git@github.com:openvswitch/ovs.git",
        "webscm_url": "https://github.com/openvswitch/ovs"
    },
    "msgid": "<195d108bcfc9b2337eeb0b7f5fa789804e7c86d0.1775679683.git.lorenzo.bianconi@redhat.com>",
    "date": "2026-04-08T20:23:54",
    "name": "[ovs-dev,v3] ovsdb: Save user monitor condition request in ovsdb_idl_table struct.",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "c761f72ccbbcc28b6df211503b68e3d0ac572050",
    "submitter": {
        "id": 73083,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/73083/?format=api",
        "name": "Lorenzo Bianconi",
        "email": "lorenzo.bianconi@redhat.com"
    },
    "delegate": {
        "id": 57772,
        "url": "http://patchwork.ozlabs.org/api/1.1/users/57772/?format=api",
        "username": "imaximets",
        "first_name": "Ilya",
        "last_name": "Maximets",
        "email": "i.maximets@samsung.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/openvswitch/patch/195d108bcfc9b2337eeb0b7f5fa789804e7c86d0.1775679683.git.lorenzo.bianconi@redhat.com/mbox/",
    "series": [
        {
            "id": 499226,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/499226/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=499226",
            "date": "2026-04-08T20:23:54",
            "name": "[ovs-dev,v3] ovsdb: Save user monitor condition request in ovsdb_idl_table struct.",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/499226/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2221253/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/2221253/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<ovs-dev-bounces@openvswitch.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "ovs-dev@openvswitch.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "ovs-dev@lists.linuxfoundation.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=G89IK5mb;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=140.211.166.136; helo=smtp3.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org)",
            "smtp3.osuosl.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=G89IK5mb",
            "smtp2.osuosl.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com",
            "smtp2.osuosl.org;\n dkim=fail reason=\"signature verification failed\" (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=G89IK5mb"
        ],
        "Received": [
            "from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4frdk75CHXz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 08:57:19 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id E0EC260A5F;\n\tWed,  8 Apr 2026 22:57:16 +0000 (UTC)",
            "from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id Qld5FNqKtGm1; Wed,  8 Apr 2026 22:57:15 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp3.osuosl.org (Postfix) with ESMTPS id 7A74760828;\n\tWed,  8 Apr 2026 22:57:15 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 54540C054A;\n\tWed,  8 Apr 2026 22:57:15 +0000 (UTC)",
            "from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133])\n by lists.linuxfoundation.org (Postfix) with ESMTP id D3E11C0549\n for <ovs-dev@openvswitch.org>; Wed,  8 Apr 2026 22:57:13 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp2.osuosl.org (Postfix) with ESMTP id CEF6240028\n for <ovs-dev@openvswitch.org>; Wed,  8 Apr 2026 22:57:13 +0000 (UTC)",
            "from smtp2.osuosl.org ([127.0.0.1])\n by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id 2J2RmZ3wo-K0 for <ovs-dev@openvswitch.org>;\n Wed,  8 Apr 2026 22:57:12 +0000 (UTC)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by smtp2.osuosl.org (Postfix) with ESMTPS id 5EC5A40056\n for <ovs-dev@openvswitch.org>; Wed,  8 Apr 2026 22:57:11 +0000 (UTC)",
            "from mail-wm1-f69.google.com (mail-wm1-f69.google.com\n [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-246-Ib6ecRG1PEmjTxQswsTp5w-1; Wed, 08 Apr 2026 16:24:04 -0400",
            "by mail-wm1-f69.google.com with SMTP id\n 5b1f17b1804b1-4836abfc742so686945e9.0\n for <ovs-dev@openvswitch.org>; Wed, 08 Apr 2026 13:24:03 -0700 (PDT)",
            "from localhost (net-37-119-153-93.cust.vodafonedsl.it.\n [37.119.153.93]) by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-488cd19a98fsm15961835e9.2.2026.04.08.13.24.00\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 08 Apr 2026 13:24:00 -0700 (PDT)"
        ],
        "X-Virus-Scanned": [
            "amavis at osuosl.org",
            "amavis at osuosl.org"
        ],
        "X-Comment": "SPF check N/A for local connections - client-ip=140.211.9.56;\n helo=lists.linuxfoundation.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN> ",
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 smtp3.osuosl.org 7A74760828",
            "OpenDKIM Filter v2.11.0 smtp2.osuosl.org 5EC5A40056"
        ],
        "Received-SPF": "Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124;\n helo=us-smtp-delivery-124.mimecast.com;\n envelope-from=lorenzo.bianconi@redhat.com; receiver=<UNKNOWN>",
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 smtp2.osuosl.org 5EC5A40056",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1775689030;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=sSYnWN2OC/Z+aczhNVOIbiH3c1hqdKu+FkBQV4KFv+Q=;\n b=G89IK5mbyek7eKLFu5IYXeI1Yce9L5LId+8bg65C+vskzlsUhouaHlA20l6oYeKe6DbZrl\n 67tFoq9mCDODXniyFEXDjlfECEZ5N+9P5iLSc+q4GanxygNoZuebW/eLsq06D+uWvR89lK\n hhTGcASlASbYk4NP38rZCK7qI1c4Xq4=",
        "X-MC-Unique": "Ib6ecRG1PEmjTxQswsTp5w-1",
        "X-Mimecast-MFC-AGG-ID": "Ib6ecRG1PEmjTxQswsTp5w_1775679843",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775679842; x=1776284642;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=Yg+oex3jSDFjsp02q4XBceJYQAaV3T7a8xbBTiKR+Ss=;\n b=ABwVP4zKPYr1k6CeGiHgbJdPFbH1Fyua59C3M5Ir5oG8Q3VLGdr9av7OuoWgKnyTHM\n Ewya+l7m8/EoMTefG3U9wNmSJdulxuXCvIUGOWWVQ6rfHT6fqf6iEXDfTRr2VbIG45qf\n wuVZmqFlpaXL6w+xnz/LCM78EI/D4brNJubv17PDBfnunSdWH+IZB2bnitcZXphK3FFZ\n 11oR0dbmeQ00rM/LOSMIJ70ZZfoZafolHJc1MPz2nzNYQ4776/pn/wmMWxOyTmiHS3kB\n zkRcOzkDC370qa31bmXR7hbjWTZgAzKaqbsWtdOGblG9D7/em3yA5ya8BXMO3rLoP27v\n swkA==",
        "X-Gm-Message-State": "AOJu0YzWVHOOthgWZWkZywOa1x9rVv4LcaJAIAoMyhGMwn+BrB6KrCSV\n izZJKfwsWgcRubhsZJGJHqR2LgAfq4RFCtPRrznnodXENvhuU+iqEX55klF86n/6QSwcag2qkLU\n Lq6NxXwn4Hvitn2UOwkAqWVeLTECeFKLxeDqCRtmm2ApNNFWUA9dNSN5ZEgvNXno4EDG7Ac6vXX\n nNReiWaJX+BaDMNS3GpFoTlGymQIHPeBKaZK40UaamKrGKM766e0qS4w==",
        "X-Gm-Gg": "AeBDietWaBDoguVxUXPduu5D/XqrtMReMH04rhG9IvE/I8kigBWoGICWRGPr452W0Lv\n bmOSgUUnFV6w82P/YMUmiJZVicdn7l8Dq/2Td3qdjpwdsUTvY8hNRA0ll82rqH0dmXOB+Zi3bOU\n EZq1AG6MnvAb8zKEsGgUvRdJJet4TK8s4A9m0HwJdjbwzgx1oyix0rv8xxwf4bSOMB1AGLr5GE4\n RvVQDYxF0H4ZQAlI1D/0CKWdiUZWUEXoWErm4YD4oEPnq3CNoqdTq0EsNebHj14Qqqle8BYgNPX\n wnb662g6yJo2s8Rb6ISNKcSGXWHhotvo4wfikIghunspWKbyV+eunWV63IGGvOc8It+XmX0knfr\n 4EGzKQ2c+nJU/6O8yakK1CJjIK0pV3hkXFOjbt9/IZ1vJ/9gz4V2+dGNjJtWXIpRQazPhUA==",
        "X-Received": [
            "by 2002:a05:600c:8884:b0:488:aa3d:faca with SMTP id\n 5b1f17b1804b1-488ccfdcf7bmr10885745e9.18.1775679841744;\n Wed, 08 Apr 2026 13:24:01 -0700 (PDT)",
            "by 2002:a05:600c:8884:b0:488:aa3d:faca with SMTP id\n 5b1f17b1804b1-488ccfdcf7bmr10885395e9.18.1775679841117;\n Wed, 08 Apr 2026 13:24:01 -0700 (PDT)"
        ],
        "To": "ovs-dev@openvswitch.org",
        "Cc": "i.maximets@ovn.org,\n\tdceara@redhat.com",
        "Date": "Wed,  8 Apr 2026 22:23:54 +0200",
        "Message-ID": "\n <195d108bcfc9b2337eeb0b7f5fa789804e7c86d0.1775679683.git.lorenzo.bianconi@redhat.com>",
        "X-Mailer": "git-send-email 2.53.0",
        "MIME-Version": "1.0",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "0FUQsq4z8FcbD6k1QCfeWwkUMuJ8Vd57J6-fSLJ8Y9U_1775679843",
        "X-Mimecast-Originator": "redhat.com",
        "Subject": "[ovs-dev] [PATCH v3] ovsdb: Save user monitor condition request in\n ovsdb_idl_table struct.",
        "X-BeenThere": "ovs-dev@openvswitch.org",
        "X-Mailman-Version": "2.1.30",
        "Precedence": "list",
        "List-Id": "<ovs-dev.openvswitch.org>",
        "List-Unsubscribe": "<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>",
        "List-Archive": "<http://mail.openvswitch.org/pipermail/ovs-dev/>",
        "List-Post": "<mailto:ovs-dev@openvswitch.org>",
        "List-Help": "<mailto:ovs-dev-request@openvswitch.org?subject=help>",
        "List-Subscribe": "<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=subscribe>",
        "From": "Lorenzo Bianconi via dev <ovs-dev@openvswitch.org>",
        "Reply-To": "Lorenzo Bianconi <lorenzo.bianconi@redhat.com>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "ovs-dev-bounces@openvswitch.org",
        "Sender": "\"dev\" <ovs-dev-bounces@openvswitch.org>"
    },
    "content": "Store the user monitor condition request in pre-json format in\novsdb_idl_table in order to use it in ovsdb_idl_compose_monitor_request\nroutine and create a monitor condition request based on the\ntables/columns available in db-schema.\n\nReported-at: https://issues.redhat.com/browse/FDP-3114\nSigned-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>\n---\nChanges in v3:\n- Fix seqno reporting when the filtered condition is empty.\n\nChanges in v2:\n- Add missing unit-test.\n- squash with patch 'ovsdb: Add ovsdb_cs_clear_condition routine to remove\n  stable ovsdb_cs_db_table entries.'.\n- fix the error condition reported by Ilya.\n- Remove unnecessary ovsdb_cs_db_sync_condition() in\n  ovsdb_cs_send_monitor_request().\n- cosmetics.\n---\n lib/ovsdb-cs.c           |  51 ++++++++++++++----\n lib/ovsdb-cs.h           |   2 +\n lib/ovsdb-idl-provider.h |   3 ++\n lib/ovsdb-idl.c          | 110 +++++++++++++++++++++++++++++++++++++--\n tests/ovsdb-idl.at       |   3 ++\n tests/test-ovsdb.c       |   8 +++\n 6 files changed, 165 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/lib/ovsdb-cs.c b/lib/ovsdb-cs.c\nindex df33a835d..93f59492e 100644\n--- a/lib/ovsdb-cs.c\n+++ b/lib/ovsdb-cs.c\n@@ -663,6 +663,18 @@ ovsdb_cs_wait(struct ovsdb_cs *cs)\n \f\n /* Network connection. */\n \n+bool\n+ovsdb_cs_is_remote_changed(struct ovsdb_cs *cs, const char *remote)\n+{\n+    if (cs &&\n+        ((remote != NULL) != (cs->remote != NULL) ||\n+         (remote && cs->remote && strcmp(remote, cs->remote)))) {\n+        return true;\n+    }\n+\n+    return false;\n+}\n+\n /* Changes the remote and creates a new session.  Keeps existing connection\n  * if current remote is still valid.\n  *\n@@ -671,9 +683,7 @@ ovsdb_cs_wait(struct ovsdb_cs *cs)\n void\n ovsdb_cs_set_remote(struct ovsdb_cs *cs, const char *remote, bool retry)\n {\n-    if (cs\n-        && ((remote != NULL) != (cs->remote != NULL)\n-            || (remote && cs->remote && strcmp(remote, cs->remote)))) {\n+    if (ovsdb_cs_is_remote_changed(cs, remote)) {\n         struct jsonrpc *rpc = NULL;\n \n         /* Close the old session, if any. */\n@@ -912,17 +922,40 @@ ovsdb_cs_db_get_table(struct ovsdb_cs_db *db, const char *table)\n     return t;\n }\n \n+static void\n+ovsdb_cs_db_destroy_table(struct ovsdb_cs_db_table *table,\n+                          struct ovsdb_cs_db *db)\n+{\n+    json_destroy(table->ack_cond);\n+    json_destroy(table->req_cond);\n+    json_destroy(table->new_cond);\n+    hmap_remove(&db->tables, &table->hmap_node);\n+    free(table->name);\n+    free(table);\n+}\n+\n+/* Destroy a given ovsdb_cs_db_table according to the table name. */\n+void\n+ovsdb_cs_clear_condition(struct ovsdb_cs *cs, const char *table)\n+{\n+    uint32_t hash = hash_string(table, 0);\n+    struct ovsdb_cs_db *db = &cs->data;\n+\n+    struct ovsdb_cs_db_table *t;\n+    HMAP_FOR_EACH_WITH_HASH (t, hmap_node, hash, &db->tables) {\n+        if (!strcmp(t->name, table)) {\n+            ovsdb_cs_db_destroy_table(t, db);\n+            return;\n+        }\n+    }\n+}\n+\n static void\n ovsdb_cs_db_destroy_tables(struct ovsdb_cs_db *db)\n {\n     struct ovsdb_cs_db_table *table;\n     HMAP_FOR_EACH_SAFE (table, hmap_node, &db->tables) {\n-        json_destroy(table->ack_cond);\n-        json_destroy(table->req_cond);\n-        json_destroy(table->new_cond);\n-        hmap_remove(&db->tables, &table->hmap_node);\n-        free(table->name);\n-        free(table);\n+        ovsdb_cs_db_destroy_table(table, db);\n     }\n     hmap_destroy(&db->tables);\n }\ndiff --git a/lib/ovsdb-cs.h b/lib/ovsdb-cs.h\nindex bcc3dcd71..a46b806c0 100644\n--- a/lib/ovsdb-cs.h\n+++ b/lib/ovsdb-cs.h\n@@ -122,6 +122,7 @@ void ovsdb_cs_run(struct ovsdb_cs *, struct ovs_list *events);\n void ovsdb_cs_wait(struct ovsdb_cs *);\n \n /* Network connection. */\n+bool ovsdb_cs_is_remote_changed(struct ovsdb_cs *, const char *remote);\n void ovsdb_cs_set_remote(struct ovsdb_cs *, const char *remote, bool retry);\n \n void ovsdb_cs_enable_reconnect(struct ovsdb_cs *);\n@@ -144,6 +145,7 @@ void ovsdb_cs_set_probe_interval(const struct ovsdb_cs *, int probe_interval);\n unsigned int ovsdb_cs_set_condition(struct ovsdb_cs *, const char *table,\n                                     const struct json *condition);\n unsigned int ovsdb_cs_get_condition_seqno(const struct ovsdb_cs *);\n+void ovsdb_cs_clear_condition(struct ovsdb_cs *, const char *table);\n \n /* Database change awareness. */\n void ovsdb_cs_set_db_change_aware(struct ovsdb_cs *, bool set_db_change_aware);\ndiff --git a/lib/ovsdb-idl-provider.h b/lib/ovsdb-idl-provider.h\nindex 6cf32fb50..9244bbcd5 100644\n--- a/lib/ovsdb-idl-provider.h\n+++ b/lib/ovsdb-idl-provider.h\n@@ -130,6 +130,9 @@ struct ovsdb_idl_table {\n                               * or not. */\n     struct ovs_list indexes;    /* Contains \"struct ovsdb_idl_index\"s */\n     struct ovs_list track_list; /* Tracked rows (ovsdb_idl_row.track_node). */\n+\n+    struct ovsdb_idl_condition req_cond; /* User requested monitor\n+                                          * condition. */\n };\n \n struct ovsdb_idl_class {\ndiff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c\nindex fe90deda7..6ad0eb36d 100644\n--- a/lib/ovsdb-idl.c\n+++ b/lib/ovsdb-idl.c\n@@ -99,6 +99,7 @@ struct ovsdb_idl {\n     struct ovs_list rows_to_reparse; /* Stores rows that might need to be\n                                       * re-parsed due to insertion of a\n                                       * referenced row. */\n+    bool server_schema_received;\n };\n \n static struct ovsdb_cs_ops ovsdb_idl_cs_ops;\n@@ -205,6 +206,19 @@ static void ovsdb_idl_add_to_indexes(const struct ovsdb_idl_row *);\n static void ovsdb_idl_remove_from_indexes(const struct ovsdb_idl_row *);\n static int ovsdb_idl_try_commit_loop_txn(struct ovsdb_idl_loop *loop,\n                                          bool *may_need_wakeup);\n+static void\n+ovsdb_idl_condition_clone(struct ovsdb_idl_condition *dest,\n+                          const struct ovsdb_idl_condition *source);\n+static void\n+ovsdb_idl_create_req_condition(struct ovsdb_idl *,\n+                               const struct ovsdb_idl_table_class *,\n+                               const struct ovsdb_idl_condition *);\n+static void ovsdb_idl_destroy_req_condition(struct ovsdb_idl_table *);\n+static bool ovsdb_idl_condition_is_set(struct ovsdb_idl_condition *);\n+static unsigned int\n+ovsdb_idl_set_condition__(struct ovsdb_idl *,\n+                          const struct ovsdb_idl_table_class *,\n+                          const struct ovsdb_idl_condition *);\n \n static void add_tracked_change_for_references(struct ovsdb_idl_row *);\n \n@@ -266,6 +280,7 @@ ovsdb_idl_create_unconnected(const struct ovsdb_idl_class *class,\n         .txn = NULL,\n         .outstanding_txns = HMAP_INITIALIZER(&idl->outstanding_txns),\n         .verify_write_only = false,\n+        .server_schema_received = false,\n         .deleted_untracked_rows\n             = OVS_LIST_INITIALIZER(&idl->deleted_untracked_rows),\n         .rows_to_reparse\n@@ -298,6 +313,7 @@ ovsdb_idl_create_unconnected(const struct ovsdb_idl_class *class,\n             = table->change_seqno[OVSDB_IDL_CHANGE_DELETE] = 0;\n         table->idl = idl;\n         table->in_server_schema = false;\n+        ovsdb_idl_condition_init(&table->req_cond);\n         shash_init(&table->schema_columns);\n     }\n \n@@ -311,6 +327,9 @@ ovsdb_idl_create_unconnected(const struct ovsdb_idl_class *class,\n void\n ovsdb_idl_set_remote(struct ovsdb_idl *idl, const char *remote, bool retry)\n {\n+    if (ovsdb_cs_is_remote_changed(idl->cs, remote)) {\n+        idl->server_schema_received = false;\n+    }\n     ovsdb_cs_set_remote(idl->cs, remote, retry);\n }\n \n@@ -372,6 +391,7 @@ ovsdb_idl_destroy(struct ovsdb_idl *idl)\n \n             ovsdb_idl_schema_columns_clear(&table->schema_columns);\n             shash_destroy(&table->schema_columns);\n+            ovsdb_idl_destroy_req_condition(table);\n \n             hmap_destroy(&table->rows);\n             free(table->modes);\n@@ -784,6 +804,7 @@ static struct json *\n ovsdb_idl_compose_monitor_request(const struct json *schema_json, void *idl_)\n {\n     struct ovsdb_idl *idl = idl_;\n+    idl->server_schema_received = true;\n \n     struct shash *schema = ovsdb_cs_parse_schema(schema_json);\n     struct json *monitor_requests = json_object_create();\n@@ -842,6 +863,7 @@ ovsdb_idl_compose_monitor_request(const struct json *schema_json, void *idl_)\n                           idl->class_->database, table->class_->name);\n                 json_destroy(columns);\n                 table->in_server_schema = false;\n+                ovsdb_cs_clear_condition(idl->cs, table->class_->name);\n                 continue;\n             } else if (schema && table_schema) {\n                 table->in_server_schema = true;\n@@ -852,6 +874,14 @@ ovsdb_idl_compose_monitor_request(const struct json *schema_json, void *idl_)\n             json_object_put(monitor_requests, tc->name,\n                             json_array_create_1(monitor_request));\n         }\n+\n+        if (!table->in_server_schema) {\n+            ovsdb_cs_clear_condition(idl->cs, table->class_->name);\n+        } else if (ovsdb_idl_condition_is_set(&table->req_cond)) {\n+            /* Update the monitor condition request according to the\n+             * db schema. */\n+            ovsdb_idl_set_condition__(idl, tc, &table->req_cond);\n+        }\n     }\n     ovsdb_cs_free_schema(schema);\n \n@@ -1156,6 +1186,45 @@ ovsdb_idl_condition_add_clause__(struct ovsdb_idl_condition *condition,\n     hmap_insert(&condition->clauses, &clause->hmap_node, hash);\n }\n \n+static void\n+ovsdb_idl_destroy_req_condition(struct ovsdb_idl_table *table)\n+{\n+    ovsdb_idl_condition_destroy(&table->req_cond);\n+}\n+\n+static bool\n+ovsdb_idl_condition_is_set(struct ovsdb_idl_condition *condition)\n+{\n+    return !hmap_is_empty(&condition->clauses) || condition->is_true;\n+}\n+\n+static void\n+ovsdb_idl_condition_clone(struct ovsdb_idl_condition *dest,\n+                          const struct ovsdb_idl_condition *source)\n+{\n+    ovsdb_idl_condition_init(dest);\n+\n+    struct ovsdb_idl_clause *clause;\n+    HMAP_FOR_EACH (clause, hmap_node, &source->clauses) {\n+        uint32_t hash = ovsdb_idl_clause_hash(clause);\n+        ovsdb_idl_condition_add_clause__(dest, clause, hash);\n+    }\n+    dest->is_true = source->is_true;\n+}\n+\n+static void\n+ovsdb_idl_create_req_condition(struct ovsdb_idl *idl,\n+                               const struct ovsdb_idl_table_class *tc,\n+                               const struct ovsdb_idl_condition *condition)\n+{\n+    struct ovsdb_idl_table *table = shash_find_data(&idl->table_by_name,\n+                                                    tc->name);\n+    if (table) {\n+        ovsdb_idl_destroy_req_condition(table);\n+        ovsdb_idl_condition_clone(&table->req_cond, condition);\n+    }\n+}\n+\n /* Adds a clause to the condition for replicating the table with class 'tc' in\n  * 'idl'.\n  *\n@@ -1234,6 +1303,17 @@ ovsdb_idl_condition_to_json(const struct ovsdb_idl_condition *cnd)\n     return json_array_create(clauses, n);\n }\n \n+static unsigned int\n+ovsdb_idl_set_condition__(struct ovsdb_idl *idl,\n+                          const struct ovsdb_idl_table_class *tc,\n+                          const struct ovsdb_idl_condition *condition)\n+{\n+    struct json *cond_json = ovsdb_idl_condition_to_json(condition);\n+    unsigned int seqno = ovsdb_cs_set_condition(idl->cs, tc->name, cond_json);\n+    json_destroy(cond_json);\n+    return seqno;\n+}\n+\n /* Sets the replication condition for 'tc' in 'idl' to 'condition' and\n  * arranges to send the new condition to the database server.\n  *\n@@ -1245,9 +1325,33 @@ ovsdb_idl_set_condition(struct ovsdb_idl *idl,\n                         const struct ovsdb_idl_table_class *tc,\n                         const struct ovsdb_idl_condition *condition)\n {\n-    struct json *cond_json = ovsdb_idl_condition_to_json(condition);\n-    unsigned int seqno = ovsdb_cs_set_condition(idl->cs, tc->name, cond_json);\n-    json_destroy(cond_json);\n+    struct ovsdb_idl_condition filter_cond =\n+        OVSDB_IDL_CONDITION_INIT(&filter_cond);\n+\n+    if (idl->server_schema_received && hmap_count(&condition->clauses)) {\n+        struct ovsdb_idl_clause *clause;\n+        HMAP_FOR_EACH (clause, hmap_node, &condition->clauses) {\n+            struct ovsdb_idl_table *t =\n+                ovsdb_idl_table_from_column(idl, clause->column);\n+            if (!t || !t->in_server_schema) {\n+                return ovsdb_idl_get_condition_seqno(idl);\n+            }\n+\n+            if (ovsdb_idl_server_has_column(idl, clause->column)) {\n+                uint32_t hash = ovsdb_idl_clause_hash(clause);\n+                ovsdb_idl_condition_add_clause__(&filter_cond, clause, hash);\n+            }\n+        }\n+        condition = &filter_cond;\n+    }\n+\n+    unsigned int seqno = ovsdb_idl_set_condition__(idl, tc, condition);\n+    ovsdb_idl_create_req_condition(idl, tc, &filter_cond);\n+\n+    if (hmap_count(&filter_cond.clauses)) {\n+        ovsdb_idl_condition_destroy(&filter_cond);\n+    }\n+\n     return seqno;\n }\n \ndiff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at\nindex 728d761d4..194afef13 100644\n--- a/tests/ovsdb-idl.at\n+++ b/tests/ovsdb-idl.at\n@@ -2722,6 +2722,9 @@ unix:socket2 remote has col id in table simple7, type: string\n --- remote unix:socket2 done ---\n ], [stderr])\n \n+# Check we do not have any errors related to conditional monitoring.\n+AT_CHECK([grep -q \"received error, error={\\\"details\\\":\\\"no table named link2\\\",\\\"error\\\":\\\"syntax error\\\"}\" stderr], [1])\n+\n OVSDB_SERVER_SHUTDOWN\n AT_CLEANUP\n \ndiff --git a/tests/test-ovsdb.c b/tests/test-ovsdb.c\nindex 95290ae78..037a78743 100644\n--- a/tests/test-ovsdb.c\n+++ b/tests/test-ovsdb.c\n@@ -3596,6 +3596,12 @@ do_idl_table_column_check(struct ovs_cmdl_context *ctx)\n         ovsdb_idl_set_remote(idl, ctx->argv[r], true);\n         ovsdb_idl_force_reconnect(idl);\n \n+        struct ovsdb_idl_condition cond_link2 =\n+            OVSDB_IDL_CONDITION_INIT(&cond_link2);\n+        idltest_link2_add_clause_i(&cond_link2, OVSDB_F_EQ, 1);\n+\n+        idltest_link2_set_condition(idl, &cond_link2);\n+\n         /* Wait for update. */\n         for (;;) {\n             ovsdb_idl_run(idl);\n@@ -3661,6 +3667,8 @@ do_idl_table_column_check(struct ovs_cmdl_context *ctx)\n                type ? \", type: \" : \"\", type ? type_s : \"\");\n         free(type_s);\n \n+        ovsdb_idl_condition_destroy(&cond_link2);\n+\n         printf(\"--- remote %s done ---\\n\", ctx->argv[r]);\n     }\n \n",
    "prefixes": [
        "ovs-dev",
        "v3"
    ]
}