struct ovsdb_monitor_aux {
const struct ovsdb_monitor *monitor;
struct ovsdb_monitor_table *mt;
+ enum ovsdb_monitor_changes_efficacy efficacy;
};
static void
{
aux->monitor = m;
aux->mt = NULL;
+ aux->efficacy = OVSDB_CHANGES_NO_EFFECT;
}
static void
if (efficacy > OVSDB_CHANGES_NO_EFFECT) {
ovsdb_monitor_changes_update(old, new, mt, changes);
}
+
+ if (aux->efficacy < efficacy) {
+ aux->efficacy = efficacy;
+ }
}
return true;
struct ovsdb_monitor *m = ovsdb_monitor_cast(replica);
struct ovsdb_monitor_aux aux;
- ovsdb_monitor_json_cache_flush(m);
ovsdb_monitor_init_aux(&aux, m);
ovsdb_txn_for_each_change(txn, ovsdb_monitor_change_cb, &aux);
- m->n_transactions++;
+
+ if (aux.efficacy == OVSDB_CHANGES_REQUIRE_EXTERNAL_UPDATE) {
+ ovsdb_monitor_json_cache_flush(m);
+ m->n_transactions++;
+ }
return NULL;
}