diff mbox series

[ovs-dev,v2,5/9] ovsdb-server: Don't update manager status if replay engine is active.

Message ID 20210412220020.2286954-6-i.maximets@ovn.org
State Changes Requested
Headers show
Series Stream Record/Replay. | expand

Commit Message

Ilya Maximets April 12, 2021, 10 p.m. UTC
Current version or replay engine doesn't handle correctly internal
time-based events that ends up in stream events.  For example,
updates of a database status that happens each 2.5 seconds results
in updates on client monitors.  Disable updates for now if replay
engine is active.  The very first update kept to store the initial
information about the server.

The proper solution would be to record time and replay it, probably,
with time warping or in some other way.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 ovsdb/ovsdb-server.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Dumitru Ceara May 10, 2021, 10:13 a.m. UTC | #1
On 4/13/21 12:00 AM, Ilya Maximets wrote:
> Current version or replay engine doesn't handle correctly internal
> time-based events that ends up in stream events.  For example,
> updates of a database status that happens each 2.5 seconds results
> in updates on client monitors.  Disable updates for now if replay
> engine is active.  The very first update kept to store the initial
> information about the server.
> 
> The proper solution would be to record time and replay it, probably,
> with time warping or in some other way.
> 
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---

Acked-by: Dumitru Ceara <dceara@redhat.com>

Regards,
Dumitru
diff mbox series

Patch

diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c
index 564085e77..b09232c65 100644
--- a/ovsdb/ovsdb-server.c
+++ b/ovsdb/ovsdb-server.c
@@ -258,8 +258,10 @@  main_loop(struct server_config *config,
             }
         }
 
-        /* update Manager status(es) every 2.5 seconds */
-        if (time_msec() >= status_timer) {
+        /* update Manager status(es) every 2.5 seconds.  Don't update if we're
+         * recording or performing replay. */
+        if (status_timer == LLONG_MIN ||
+             (!ovs_replay_is_active() && time_msec() >= status_timer)) {
             status_timer = time_msec() + 2500;
             update_remote_status(jsonrpc, remotes, all_dbs);
         }
@@ -285,7 +287,9 @@  main_loop(struct server_config *config,
         if (*exiting) {
             poll_immediate_wake();
         }
-        poll_timer_wait_until(status_timer);
+        if (!ovs_replay_is_active()) {
+            poll_timer_wait_until(status_timer);
+        }
         poll_block();
         if (should_service_stop()) {
             *exiting = true;