get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2224039,
    "url": "http://patchwork.ozlabs.org/api/patches/2224039/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/dc64e2a04059517dddf77cafdea969ebc0050076.1776354379.git.lorenzo.bianconi@redhat.com/",
    "project": {
        "id": 47,
        "url": "http://patchwork.ozlabs.org/api/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",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<dc64e2a04059517dddf77cafdea969ebc0050076.1776354379.git.lorenzo.bianconi@redhat.com>",
    "list_archive_url": null,
    "date": "2026-04-16T15:53:42",
    "name": "[ovs-dev,v4] ovsdb: Add support for filtering monitor requests in the IDL layer.",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "10782761766ef595d419028127f298cb11ef84e4",
    "submitter": {
        "id": 73083,
        "url": "http://patchwork.ozlabs.org/api/people/73083/?format=api",
        "name": "Lorenzo Bianconi",
        "email": "lorenzo.bianconi@redhat.com"
    },
    "delegate": {
        "id": 57772,
        "url": "http://patchwork.ozlabs.org/api/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/dc64e2a04059517dddf77cafdea969ebc0050076.1776354379.git.lorenzo.bianconi@redhat.com/mbox/",
    "series": [
        {
            "id": 500182,
            "url": "http://patchwork.ozlabs.org/api/series/500182/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=500182",
            "date": "2026-04-16T15:53:42",
            "name": "[ovs-dev,v4] ovsdb: Add support for filtering monitor requests in the IDL layer.",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/500182/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2224039/comments/",
    "check": "fail",
    "checks": "http://patchwork.ozlabs.org/api/patches/2224039/checks/",
    "tags": {},
    "related": [],
    "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=CE/ZsF41;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=140.211.166.138; helo=smtp1.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org)",
            "smtp1.osuosl.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=CE/ZsF41",
            "smtp3.osuosl.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com",
            "smtp3.osuosl.org;\n dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com\n header.a=rsa-sha256 header.s=mimecast20190719 header.b=CE/ZsF41"
        ],
        "Received": [
            "from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138])\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 4fxMy02Fjvz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 01:54:00 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id DBB2180DF6;\n\tThu, 16 Apr 2026 15:53:57 +0000 (UTC)",
            "from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id cuxIWhvQVeRC; Thu, 16 Apr 2026 15:53:56 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org\n [IPv6:2605:bc80:3010:104::8cd3:938])\n\tby smtp1.osuosl.org (Postfix) with ESMTPS id 7D40380DDB;\n\tThu, 16 Apr 2026 15:53:56 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 6260EC054A;\n\tThu, 16 Apr 2026 15:53:56 +0000 (UTC)",
            "from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 4450DC0549\n for <ovs-dev@openvswitch.org>; Thu, 16 Apr 2026 15:53:55 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp3.osuosl.org (Postfix) with ESMTP id 2436F60794\n for <ovs-dev@openvswitch.org>; Thu, 16 Apr 2026 15:53:55 +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 nrJzlFt6FMbF for <ovs-dev@openvswitch.org>;\n Thu, 16 Apr 2026 15:53:54 +0000 (UTC)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by smtp3.osuosl.org (Postfix) with ESMTPS id AD43560653\n for <ovs-dev@openvswitch.org>; Thu, 16 Apr 2026 15:53:53 +0000 (UTC)",
            "from mail-wm1-f71.google.com (mail-wm1-f71.google.com\n [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-567-Lk_DSkFBPGKPdwvhin0uFA-1; Thu, 16 Apr 2026 11:53:50 -0400",
            "by mail-wm1-f71.google.com with SMTP id\n 5b1f17b1804b1-4837bfcfe0dso74621495e9.1\n for <ovs-dev@openvswitch.org>; Thu, 16 Apr 2026 08:53:50 -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 ffacd0b85a97d-43ead3dfff3sm13761242f8f.26.2026.04.16.08.53.45\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 16 Apr 2026 08:53:46 -0700 (PDT)"
        ],
        "X-Virus-Scanned": [
            "amavis at osuosl.org",
            "amavis at osuosl.org"
        ],
        "X-Comment": "SPF check N/A for local connections -\n client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN> ",
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 smtp1.osuosl.org 7D40380DDB",
            "OpenDKIM Filter v2.11.0 smtp3.osuosl.org AD43560653"
        ],
        "Received-SPF": "Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.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 smtp3.osuosl.org AD43560653",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776354831;\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=9VOruOo6Q9MzfQydpsYBqFDRraCZsQM/ZM/CwAgJ5QE=;\n b=CE/ZsF414Wfyjezpsi9eVjXegAsTf5UlmgwzHGSkV5iLR/ZKKrdeHfsylBd4NsBf7lUQ3L\n nUFMmiMdTVeN7NriAMRlUr8L+zUDdJB8bJCKkil743V+aX2HbWFFH3+OHq1tvOtN/E+cpR\n NktXMP21WZN3GdAcmJdFaqvc2IsyiEo=",
        "X-MC-Unique": "Lk_DSkFBPGKPdwvhin0uFA-1",
        "X-Mimecast-MFC-AGG-ID": "Lk_DSkFBPGKPdwvhin0uFA_1776354829",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776354828; x=1776959628;\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=9VOruOo6Q9MzfQydpsYBqFDRraCZsQM/ZM/CwAgJ5QE=;\n b=IbFx1qLuvGbm/CkeBCRUvoUk+AcXCIxf7v9cgOTrEUO0LLel8gDaswIkLgZdd5fJHF\n BlNSVpGTKpeunbZvZ4PCS6aT1Trh53XL5Is8IMOnCWzuKOVtVFZlFyzNZ1//l2usiQdW\n 3FdSwFYdqvK/fb85J0RbIpvzoXtISs1wF1KYJYIA9NJvzP8VoFbfQU7DTyE0X2HBELww\n dhceRPrPTvQrpYoL5oryD5haivTsvkutua8dEhgLoMq4kJ6ljrC8vuegApE80xEpzm/Z\n +Q+6mXHNkajp/YOw4QR+0r5jWSqXQ2jsC/NOaKSXygHqWLpkEjx68EbPnU6hgoH/X6DX\n o0AA==",
        "X-Gm-Message-State": "AOJu0YwOJDJn0QJeo2+4TUDvJUnVz6N2eJPx0l9Oxvwb60bX3LD56qrq\n BqfmQfdOv2+8rKSQw05YCVd+Dmv7/4jJfWLKO613hsCeArqrmTXGulAoSajC57J5T/J3ZWKHMaU\n bgMvowDSac9DiFyrecXb0be1+2AZVAb4+fl0ql0h00a5bI8yNo5Xj0ObV+MfOkw49DsmnTESD/w\n DbymLgTappburOk1rgHM+yyc9IyHnh4yT3xXwWSKchLRuSQsXErkKYWw==",
        "X-Gm-Gg": "AeBDiesLPd7kQFpYRhn3v5cSFWex2KKlVTmXxphjJ5Gd5oHjm7yMGWNPb0Il/sCHeMu\n 4+tjYz+FcR+kHmnB0Uzg+cL38Tx0E1jMW/09SEHIwLwirzW9mkitnePUH7FLedsHWVXK0XELK1t\n mSqQOaqewYxZrR7Z1ShZgdv7LNqQapjuUjHp2PH5Xa7gp1H1Waxox7RagWO8UMIw8ggke/uCs7a\n oRozkLhX7CK+sKyyFKQ9apehbaE9UqGeLdLW+piOzA5/7vUSgIrrrLYBZ6U2pCC9OX2hfaGkDaw\n Bg5Iu6HR9hasX1C8YjurlMnQP6kPeMzmc+202D3GclAc/wOFqP2Qzup37caP3sMicTI9js2WibC\n 6a0iDPi+hAg9/AF44yFc0IoGr7ZJAD0N6XWrHRKTqtX6rHpKw9YaHetXQ/g0siR0WlJ/G4LtPj9\n Sygab1",
        "X-Received": [
            "by 2002:a05:600c:8b2f:b0:485:3423:727d with SMTP id\n 5b1f17b1804b1-488d688d46cmr339368055e9.26.1776354827982;\n Thu, 16 Apr 2026 08:53:47 -0700 (PDT)",
            "by 2002:a05:600c:8b2f:b0:485:3423:727d with SMTP id\n 5b1f17b1804b1-488d688d46cmr339367575e9.26.1776354827337;\n Thu, 16 Apr 2026 08:53:47 -0700 (PDT)"
        ],
        "To": "ovs-dev@openvswitch.org",
        "Cc": "i.maximets@ovn.org,\n\tdceara@redhat.com",
        "Date": "Thu, 16 Apr 2026 17:53:42 +0200",
        "Message-ID": "\n <dc64e2a04059517dddf77cafdea969ebc0050076.1776354379.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": "OKBfxMiosPATqL1Fi-fV3yOQUwdyZtdKxuN0CtHNcV4_1776354829",
        "X-Mimecast-Originator": "redhat.com",
        "Subject": "[ovs-dev] [PATCH v4] ovsdb: Add support for filtering monitor\n requests in the IDL layer.",
        "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": "Filter outgoing monitor requests in the IDL layer based on the\ndb-schema received from the server, skipping tables and columns not\navailable in the schema.\nTo support this, store the user-provided monitor condition in pre-JSON\nformat in ovsdb_idl_table when ovsdb_idl_set_condition() is called,\nallowing ovsdb_idl_compose_monitor_request() to build monitor\nconditional requests that only include tables and columns present in\nthe db-schema.\n\nReported-at: https://issues.redhat.com/browse/FDP-3114\nSigned-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>\n---\nChanges in v4:\n- Filter monitor requests in ovsdb_idl_set_condition__()\n- Cosmetics\n- Move ovsdb_cs_db_sync_condition() in ovsdb_cs_send_monitor_request() to\n  properly update ack_cond json struct\n- Store original user monitor request in req_cond in ovsdb_idl_set_condition()\n- Add more uni-tests\n- Add more comments\nChanges in v3:\n- Fix seqno reporting when the filtered condition is empty.\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           |  44 +++++++++++-----\n lib/ovsdb-cs.h           |   1 +\n lib/ovsdb-idl-provider.h |   3 ++\n lib/ovsdb-idl.c          | 109 +++++++++++++++++++++++++++++++++++++--\n tests/ovsdb-idl.at       |  19 ++++++-\n tests/test-ovsdb.c       |  19 ++++++-\n 6 files changed, 176 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/lib/ovsdb-cs.c b/lib/ovsdb-cs.c\nindex df33a835d..a88eedb77 100644\n--- a/lib/ovsdb-cs.c\n+++ b/lib/ovsdb-cs.c\n@@ -412,12 +412,6 @@ ovsdb_cs_retry_at(struct ovsdb_cs *cs, const char *where)\n static void\n ovsdb_cs_restart_fsm(struct ovsdb_cs *cs)\n {\n-    /* Resync data DB table conditions to avoid missing updates due to\n-     * conditions that were in flight or changed locally while the connection\n-     * was down.\n-     */\n-    ovsdb_cs_db_sync_condition(&cs->data);\n-\n     ovsdb_cs_send_schema_request(cs, &cs->server);\n     ovsdb_cs_transition(cs, CS_S_SERVER_SCHEMA_REQUESTED);\n     cs->data.monitor_version = 0;\n@@ -912,17 +906,41 @@ 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+            db->last_id = UUID_ZERO;\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 }\n@@ -1511,6 +1529,8 @@ ovsdb_cs_send_monitor_request(struct ovsdb_cs *cs, struct ovsdb_cs_db *db,\n     /* XXX handle failure */\n     ovs_assert(mrs->type == JSON_OBJECT);\n \n+    ovsdb_cs_db_sync_condition(db);\n+\n     if (version > 1) {\n         struct ovsdb_cs_db_table *table;\n         HMAP_FOR_EACH (table, hmap_node, &db->tables) {\ndiff --git a/lib/ovsdb-cs.h b/lib/ovsdb-cs.h\nindex bcc3dcd71..0ac691352 100644\n--- a/lib/ovsdb-cs.h\n+++ b/lib/ovsdb-cs.h\n@@ -144,6 +144,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..bc242f054 100644\n--- a/lib/ovsdb-idl.c\n+++ b/lib/ovsdb-idl.c\n@@ -99,6 +99,8 @@ 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; /* Set to true when the IDL has received\n+                                  * the DB schema from the servers. */\n };\n \n static struct ovsdb_cs_ops ovsdb_idl_cs_ops;\n@@ -205,6 +207,18 @@ 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 ovsdb_idl_condition_clone(struct ovsdb_idl_condition *dest,\n+                                      const struct ovsdb_idl_condition *);\n+static void ovsdb_idl_create_req_condition(\n+        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 ovsdb_idl_set_condition__(\n+        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@@ -372,6 +388,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@@ -467,6 +484,7 @@ ovsdb_idl_run(struct ovsdb_idl *idl)\n     LIST_FOR_EACH_POP (event, list_node, &events) {\n         switch (event->type) {\n         case OVSDB_CS_EVENT_TYPE_RECONNECT:\n+            idl->server_schema_received = false;\n             ovsdb_idl_txn_abort_all(idl);\n             break;\n \n@@ -788,6 +806,7 @@ ovsdb_idl_compose_monitor_request(const struct json *schema_json, void *idl_)\n     struct shash *schema = ovsdb_cs_parse_schema(schema_json);\n     struct json *monitor_requests = json_object_create();\n \n+    idl->server_schema_received = true;\n     for (size_t i = 0; i < idl->class_->n_tables; i++) {\n         struct ovsdb_idl_table *table = &idl->tables[i];\n         const struct ovsdb_idl_table_class *tc = table->class_;\n@@ -842,6 +861,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 +872,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 +1184,44 @@ 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+        ovsdb_idl_condition_add_clause__(dest, clause, clause->hmap_node.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 +1300,43 @@ 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 ovsdb_idl_condition filter_cond =\n+        OVSDB_IDL_CONDITION_INIT(&filter_cond);\n+    struct json *cond_json;\n+    unsigned int seqno;\n+\n+    if (!idl->server_schema_received || hmap_is_empty(&condition->clauses)) {\n+        goto out;\n+    }\n+\n+    struct ovsdb_idl_table *t = ovsdb_idl_table_from_class(idl, tc);\n+    if (!t || !t->in_server_schema) {\n+        return ovsdb_idl_get_condition_seqno(idl);\n+    }\n+\n+    struct ovsdb_idl_clause *clause;\n+    HMAP_FOR_EACH (clause, hmap_node, &condition->clauses) {\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+out:\n+    cond_json = ovsdb_idl_condition_to_json(condition);\n+    seqno = ovsdb_cs_set_condition(idl->cs, tc->name, cond_json);\n+    json_destroy(cond_json);\n+\n+    ovsdb_idl_condition_destroy(&filter_cond);\n+\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,10 +1348,8 @@ 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+    ovsdb_idl_create_req_condition(idl, tc, condition);\n+    return ovsdb_idl_set_condition__(idl, tc, condition);\n }\n \n /* Turns off OVSDB_IDL_ALERT and OVSDB_IDL_TRACK for 'column' in 'idl'.\ndiff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at\nindex 728d761d4..af682aabf 100644\n--- a/tests/ovsdb-idl.at\n+++ b/tests/ovsdb-idl.at\n@@ -2701,7 +2701,7 @@ dnl idltest2.ovsschema and outputs the presence of tables and columns.\n dnl And then it connectes to the server with the schema idltest.ovsschema\n dnl and does the same.\n AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 dnl\n-                 idl-table-column-check unix:socket unix:socket2], [0], [dnl\n+                 idl-table-column-check unix:socket unix:socket2 unix:socket], [0], [dnl\n unix:socket remote has table simple\n unix:socket remote has table link1\n unix:socket remote doesn't have table link2\n@@ -2720,8 +2720,25 @@ unix:socket2 remote has col l2 in table link1, type: set of up to 1 uuids\n unix:socket2 remote has col i in table link1, type: integer\n unix:socket2 remote has col id in table simple7, type: string\n --- remote unix:socket2 done ---\n+unix:socket remote has table simple\n+unix:socket remote has table link1\n+unix:socket remote doesn't have table link2\n+unix:socket remote doesn't have table simple5\n+unix:socket remote doesn't have col irefmap in table simple5\n+unix:socket remote doesn't have col l2 in table link1\n+unix:socket remote has col i in table link1, type: integer\n+unix:socket remote doesn't have col id in table simple7\n+--- remote unix:socket 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 column l2 in table link1.\\\"\" stderr], [1])\n+AT_CHECK([grep -q \"received error, error={\\\"details\\\":\\\"no table named link2\\\"\" stderr], [1])\n+\n+# Check the monitor_cond_since request has properly formatted conditions connecting to the idltest2 server.\n+AT_CHECK([grep monitor_cond_since stderr | grep -qF '\"l2\",\"==\",@<:@\"uuid\",\"00000000-0000-0000-0000-000000000000\"@:>@'])\n+AT_CHECK([grep monitor_cond_since stderr | grep -qF '\"i\",\"==\",1'])\n+\n OVSDB_SERVER_SHUTDOWN\n AT_CLEANUP\n \ndiff --git a/tests/test-ovsdb.c b/tests/test-ovsdb.c\nindex 95290ae78..71c28cf25 100644\n--- a/tests/test-ovsdb.c\n+++ b/tests/test-ovsdb.c\n@@ -3583,6 +3583,18 @@ do_idl_table_column_check(struct ovs_cmdl_context *ctx)\n     ovsdb_idl_omit(idl, &idltest_link1_col_i);\n     ovsdb_idl_omit(idl, &idltest_simple7_col_id);\n     ovsdb_idl_set_leader_only(idl, false);\n+\n+    struct ovsdb_idl_condition cond_link1 =\n+        OVSDB_IDL_CONDITION_INIT(&cond_link1);\n+    struct uuid uuid = UUID_ZERO;\n+    idltest_link1_add_clause_l2(&cond_link1, OVSDB_F_EQ, &uuid);\n+    idltest_link1_set_condition(idl, &cond_link1);\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+    idltest_link2_set_condition(idl, &cond_link2);\n+\n     struct stream *stream;\n \n     error = stream_open_block(jsonrpc_stream_open(ctx->argv[1], &stream,\n@@ -3592,7 +3604,7 @@ do_idl_table_column_check(struct ovs_cmdl_context *ctx)\n     }\n     rpc = jsonrpc_open(stream);\n \n-    for (int r = 1; r <= 2; r++) {\n+    for (int r = 1; r <= 3; r++) {\n         ovsdb_idl_set_remote(idl, ctx->argv[r], true);\n         ovsdb_idl_force_reconnect(idl);\n \n@@ -3664,6 +3676,9 @@ do_idl_table_column_check(struct ovs_cmdl_context *ctx)\n         printf(\"--- remote %s done ---\\n\", ctx->argv[r]);\n     }\n \n+    ovsdb_idl_condition_destroy(&cond_link1);\n+    ovsdb_idl_condition_destroy(&cond_link2);\n+\n     jsonrpc_close(rpc);\n     ovsdb_idl_destroy(idl);\n }\n@@ -3706,7 +3721,7 @@ static struct ovs_cmdl_command all_commands[] = {\n         do_idl_partial_update_map_column, OVS_RO },\n     { \"idl-partial-update-set-column\", NULL, 1, INT_MAX,\n         do_idl_partial_update_set_column, OVS_RO },\n-    { \"idl-table-column-check\", NULL, 2, 2,\n+    { \"idl-table-column-check\", NULL, 3, 3,\n         do_idl_table_column_check, OVS_RO },\n     { \"help\", NULL, 0, INT_MAX, do_help, OVS_RO },\n     { NULL, NULL, 0, 0, NULL, OVS_RO },\n",
    "prefixes": [
        "ovs-dev",
        "v4"
    ]
}