Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement test server referential integrity #375

Merged
merged 13 commits into from
Jan 25, 2024
Merged

Commits on Jan 9, 2024

  1. updates: fix merge resulting in empty optional values

    An optional atomic value is cleared with an empty set instead of a nil
    set. Thus use an empty set as an original empty value so that when an op
    that sets a value is merged with an op that clears the value, the
    comparison with an empty orignal value results in a noop.
    
    Signed-off-by: Jaime Caamaño Ruiz <[email protected]>
    jcaamano committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    e2463ab View commit details
    Browse the repository at this point in the history
  2. updates: clean up when merging results in noop

    Signed-off-by: Jaime Caamaño Ruiz <[email protected]>
    jcaamano committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    d03747f View commit details
    Browse the repository at this point in the history
  3. transaction: fix results on error

    The number of results of a transaction should always have a minimum
    length of the number of operations passed to it even if there is an
    error. The recent introduction of the named UUID expansion in the
    transaction broke this requirement. Changed the error handling approach
    so that this is less likely to happen in the future.
    
    Also removed the panic when initializing the transaction cache.
    
    Signed-off-by: Jaime Caamaño Ruiz <[email protected]>
    jcaamano committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    f6870ab View commit details
    Browse the repository at this point in the history
  4. Split database package

    The main purpose of this change is to have a package for common database
    types and interfaces that can be used throughout the project without
    incurring in circular dependencies.
    
    To that end, the in-memory database implementation is moved to its own
    subpackage.
    
    The transaction implementation is also moved to its own subpackage given
    that it can work with any database implementing the Database interface.
    
    At the interface level though it should be expected that a transaction
    implementation could have a more tighter underlying coupling with a
    database implementation. So it makes sense to introduce a transaction
    interface, and for transactions to be provided by database
    implementations rather than being built directly by the server.
    
    Signed-off-by: Jaime Caamaño Ruiz <[email protected]>
    jcaamano committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    f3b4525 View commit details
    Browse the repository at this point in the history
  5. Remove references from test schema

    Once we introduce referential integrity, existing tests would start to
    fail as they are not accounting for it. So its better to remove the
    references from the test schema which is something that current tests
    are not leveraging, and then expand the schema with other references
    that the referenctial integrity tests would leverage.
    
    Signed-off-by: Jaime Caamaño Ruiz <[email protected]>
    jcaamano committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    68876d1 View commit details
    Browse the repository at this point in the history
  6. schema: add isRoot flag

    Add the isRoot flag to the schema which will be used for referential
    integrity
    
    Signed-off-by: Jaime Caamaño Ruiz <[email protected]>
    jcaamano committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    a6812b2 View commit details
    Browse the repository at this point in the history
  7. server: implement referential integrity

    Implement referential integrity and garbage collection as described in
    RFC7047.
    
    This is achieved keeping track of inverse references. A reference
    tracker is used in the transaction to keep these references updated, to
    check for referential integrity related violations and to add additional
    updates to the transaction resulting from reference garbage collection.
    
    The inverse references are stored in the database on commit.
    
    The updates resulting from reference garbage collection are also sent to
    any monitoring clients as expected.
    
    Signed-off-by: Jaime Caamaño Ruiz <[email protected]>
    jcaamano committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    e1d2cd1 View commit details
    Browse the repository at this point in the history
  8. Add referential integrity transaction tests

    Provides coverage for the interaction of reference garbage collection
    with index constraint checks.
    
    Signed-off-by: Jaime Caamaño Ruiz <[email protected]>
    jcaamano committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    1c3007d View commit details
    Browse the repository at this point in the history
  9. Add referential integrity integration tests

    While these tests could have been purely server tests, setting them up
    as integration tests against both the test server and the real OVSDB
    server allows us to contrast the implemented behavior.
    
    Also provides coverage for how the references are updated in the
    database as well as for how referential integrity updates are sent back
    to the client.
    
    Signed-off-by: Jaime Caamaño Ruiz <[email protected]>
    jcaamano committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    09997db View commit details
    Browse the repository at this point in the history

Commits on Jan 15, 2024

  1. Add more reference tests

    Signed-off-by: Jaime Caamaño Ruiz <[email protected]>
    jcaamano committed Jan 15, 2024
    Configuration menu
    Copy the full SHA
    f5a6d80 View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2024

  1. Improve schema isRoot compat check

    Signed-off-by: Jaime Caamaño Ruiz <[email protected]>
    jcaamano committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    7432056 View commit details
    Browse the repository at this point in the history
  2. Fix reference test schema indentation

    Signed-off-by: Jaime Caamaño Ruiz <[email protected]>
    jcaamano committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    bb2f6df View commit details
    Browse the repository at this point in the history
  3. references: avoid using reflect when comparing GoUUID

    Signed-off-by: Jaime Caamaño Ruiz <[email protected]>
    jcaamano committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    690361f View commit details
    Browse the repository at this point in the history