Skip to content

Conversation

joamaki
Copy link
Contributor

@joamaki joamaki commented Jan 17, 2024

This adds the statedb reconciler, a utility for reconciling a StateDB table with a target system defined by the operations Update/Delete/Prune.

The reconciler performs incremental reconciliation as objects change as well periodic full reconciliation to catch cases where the target may have diverged. Metrics are gathered for errors and the durations of the operations. Module health is reported and marked degraded if operations fail.

@joamaki joamaki requested a review from a team as a code owner January 17, 2024 17:47
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Jan 17, 2024
@joamaki joamaki added the release-note/misc This PR makes changes that have no direct user impact. label Jan 22, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Jan 22, 2024
@joamaki
Copy link
Contributor Author

joamaki commented Jan 22, 2024

/test

Copy link
Member

@dylandreimerink dylandreimerink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find anything wrong with this, very nice. Getting a little fancy in places, but nothing that can't pass in my opinion.

@joamaki joamaki force-pushed the pr/joamaki/generic-reconciler branch from fbde633 to 8b2e974 Compare January 23, 2024 09:07
@joamaki
Copy link
Contributor Author

joamaki commented Jan 23, 2024

/test

Tests that check that a module status is properly updated incur
a 500ms wait. To remedy this, add a Realize() method to Scope that
does immediate synchronous realization of the status.

Signed-off-by: Jussi Maki <jussi@isovalent.com>
@joamaki joamaki force-pushed the pr/joamaki/generic-reconciler branch from 8b2e974 to c0297fc Compare January 23, 2024 10:11
@joamaki
Copy link
Contributor Author

joamaki commented Jan 23, 2024

/test

@joamaki joamaki enabled auto-merge January 23, 2024 10:15
This implements a generic utility for reconciling a StateDB table 
and a target defined as a set of idempotent operations. It implements
incremental reconciliation with per-object retries and a periodic
full reconciliation (forced per-object update and pruning).

A single shared reconciler implementation helps building a
more resilient architecture as it centralizes the decisions
on how to deal with failures and how to report them.

Signed-off-by: Jussi Maki <jussi@isovalent.com>
Example application for showing how to use the reconciler
to reconcile set of files on disk ("memos") created through
an HTTP API.

Signed-off-by: Jussi Maki <jussi@isovalent.com>
A simple benchmark program for the generic reconciler.

Example run:

    benchmark % go build .
    benchmark % ./benchmark -objects=100000 -batchsize=1000
    Inserting batch 100/100 ...
    Waiting for reconciliation to finish ...

    100000 objects reconciled in 0.35 seconds (batch size 1000)
    Throughput 283977.47 objects per second

Signed-off-by: Jussi Maki <jussi@isovalent.com>
@joamaki joamaki force-pushed the pr/joamaki/generic-reconciler branch from c0297fc to 4ae2c7f Compare January 23, 2024 10:40
@joamaki
Copy link
Contributor Author

joamaki commented Jan 23, 2024

/test

@joamaki joamaki added this pull request to the merge queue Jan 23, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jan 23, 2024
Merged via the queue into cilium:main with commit 0b8cebd Jan 23, 2024
@joamaki joamaki deleted the pr/joamaki/generic-reconciler branch January 23, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants