[ovs-git] [openvswitch/ovs] 610ac1: ovs-replay: New library to create and manage repla...

Ilya Maximets noreply at github.com
Mon Jun 7 19:37:45 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 610ac1e82c595a1b55b7fa9c750c673b4fe1b391
      https://github.com/openvswitch/ovs/commit/610ac1e82c595a1b55b7fa9c750c673b4fe1b391
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2021-06-07 (Mon, 07 Jun 2021)

  Changed paths:
    M lib/automake.mk
    A lib/ovs-replay-syn.man
    A lib/ovs-replay.c
    A lib/ovs-replay.h
    A lib/ovs-replay.man
    A lib/ovs-replay.xml

  Log Message:
  -----------
  ovs-replay: New library to create and manage replay files.

This library provides interfaces to open replay files and
read/write records.  Will be used later for stream record/replay
functionality, i.e. to record all the incoming connections and
data and replay it later for debugging and performance analysis
purposes.

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Dumitru Ceara <dceara at redhat.com>


  Commit: fae1ae0434cd530f1487caa22edf093691504278
      https://github.com/openvswitch/ovs/commit/fae1ae0434cd530f1487caa22edf093691504278
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2021-06-07 (Mon, 07 Jun 2021)

  Changed paths:
    M lib/automake.mk
    M lib/stream-provider.h
    A lib/stream-replay.c
    M lib/stream.c
    M lib/stream.h

  Log Message:
  -----------
  stream: Add record/replay functionality.

For debugging purposes it is useful to be able to record all the
incoming transactions and commands and replay them locally under
debugger or with additional logging enabled.  This patch introduces
ability to record all the incoming stream data and replay it via new
stream provider named 'stream-replay'.  During the record phase all
the incoming stream data written to special replay_* files in the
application rundir.  On replay phase instead of opening real streams
application will open replay_* files and read all the incoming data
directly from them.

If enabled for ovsdb-server, for example, this allows to record all
the connections and transactions from the big setup and replay them
locally afterwards to debug the behaviour or test performance.

To start application in recording mode there is a --record cmdline
option. --replay is to replay previously recorded streams.

Current version doesn't work well with time-based stream events like
inactivity probes or any other events generated internally.  This is
a point for further improvement.

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Dumitru Ceara <dceara at redhat.com>


  Commit: 07a07d06a8a14aee238cfd39e5bc530cc4daaa38
      https://github.com/openvswitch/ovs/commit/07a07d06a8a14aee238cfd39e5bc530cc4daaa38
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2021-06-07 (Mon, 07 Jun 2021)

  Changed paths:
    M lib/uuid.c

  Log Message:
  -----------
  uuid: Allow record/replay of generated UUIDs.

This is required for the stream record/replay functionality of
ovsdb-server.  With record/replay of UUIDs we could record all
incoming transactions and replay them later while being sure
that ovsdb-server will generate exactly same UUIDs for all the
data updates.

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Dumitru Ceara <dceara at redhat.com>


  Commit: 182a0b8ad0f226a5463f72aa402b36eec5c2a2d6
      https://github.com/openvswitch/ovs/commit/182a0b8ad0f226a5463f72aa402b36eec5c2a2d6
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2021-06-07 (Mon, 07 Jun 2021)

  Changed paths:
    M ovsdb/ovsdb-server.1.in
    M ovsdb/ovsdb-server.c

  Log Message:
  -----------
  ovsdb-server: Integrate stream replay engine.

This change adds support of stream record/replay functionality to
ovsdb-server.

Since current replay engine doesn't work well with time-based
events generated locally, it will work only with standalone databases
for now (raft heavily depends on time).

To use this functionality run:

  Recording:

    # create a directory for replay files.
    mkdir replay_dir
    # copy current db for later use by replay
    cp my_db ./replay_dir/my_db
    ovsdb-server --record=./replay_dir <OVSDB_ARGS> my_db
    # connect some clients and run some ovsdb transactions
    ovs-appctl -t ovsdb-server exit

  Replay:

    # restore db from the copy
    cp ./replay_dir/my_db my_db.for_replay
    ovsdb-server --replay=./replay_dir <OVSDB_ARGS> my_db.for_replay
    At this point ovsdb-server should execute all the same commands
    and transactions.  Since the last command was 'exit' via unixctl,
    ovsdb-server will exit in the end.

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Dumitru Ceara <dceara at redhat.com>


  Commit: 30ccf2c51b72d3b62350d8591f3fe709e76d98dd
      https://github.com/openvswitch/ovs/commit/30ccf2c51b72d3b62350d8591f3fe709e76d98dd
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2021-06-07 (Mon, 07 Jun 2021)

  Changed paths:
    M ovsdb/ovsdb-server.c

  Log Message:
  -----------
  ovsdb-server: Don't update manager status if replay engine is active.

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 at ovn.org>
Acked-by: Dumitru Ceara <dceara at redhat.com>


  Commit: 964da9a8b7c00f3044c5ad493ecbb75b89e09542
      https://github.com/openvswitch/ovs/commit/964da9a8b7c00f3044c5ad493ecbb75b89e09542
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2021-06-07 (Mon, 07 Jun 2021)

  Changed paths:
    M lib/jsonrpc.c

  Log Message:
  -----------
  jsonrpc: Disable inactivity probes if replay engine is active.

Current version of replay engine doesn't handle time-based internal
events that results in stream send/receive.  Disabling jsonrpc inactivity
probes for now to not block process waiting for probe being sent.

The proper solution would be to implement correct record/replay
of time, probably, by recording time and using the time warping.

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Dumitru Ceara <dceara at redhat.com>


  Commit: 0be15ad76f0f126d18257a8fe1d3753e76e57358
      https://github.com/openvswitch/ovs/commit/0be15ad76f0f126d18257a8fe1d3753e76e57358
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2021-06-07 (Mon, 07 Jun 2021)

  Changed paths:
    M tests/ovsdb-server.at

  Log Message:
  -----------
  ovsdb-server.at: Add unit test for record/replay.

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Dumitru Ceara <dceara at redhat.com>


  Commit: 4275b5b7fbb9437b265470670fa4aafb9acd8e23
      https://github.com/openvswitch/ovs/commit/4275b5b7fbb9437b265470670fa4aafb9acd8e23
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2021-06-07 (Mon, 07 Jun 2021)

  Changed paths:
    M ovsdb/ovsdb-client.1.in
    M ovsdb/ovsdb-client.c
    M tests/ovsdb-client.at

  Log Message:
  -----------
  ovsdb-client: Integrate record/replay functionality.

This is primarily to be able to test recording of client connections.
Unit test added accordingly.

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Dumitru Ceara <dceara at redhat.com>


  Commit: 210c4cba9bc69412473a2fee8e9b6f023150e6e6
      https://github.com/openvswitch/ovs/commit/210c4cba9bc69412473a2fee8e9b6f023150e6e6
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2021-06-07 (Mon, 07 Jun 2021)

  Changed paths:
    M Documentation/automake.mk
    M Documentation/topics/index.rst
    A Documentation/topics/record-replay.rst
    M NEWS

  Log Message:
  -----------
  docs: Add a topic about record/replay with ovsdb-server.

Also added a NEWS entry.

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Dumitru Ceara <dceara at redhat.com>


Compare: https://github.com/openvswitch/ovs/compare/a4b04276ab59...210c4cba9bc6


More information about the git mailing list