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

Add support for coming up with a persist policy #563

Merged
merged 1 commit into from
May 28, 2024
Merged

Add support for coming up with a persist policy #563

merged 1 commit into from
May 28, 2024

Conversation

tbachman
Copy link
Contributor

"opflex": {
   "startup": {
        "policy-file": "/home/mchalla/thomas/pol.json",
        "policy-duration": 0,
        "resolve-aft-conn": false
   },
  • opflex.startup.policy-file contains pol.json to use at startup
  • opflex.startup.policy-duration tells how long in seconds to keep resolving policy from the above pol.json
  • opflex.startup.resolve-aft-conn wait till conn before using startup db use in combination with duration > 0
  • opflex.startup.resolve-once placeholder for resolving only first time from startup db
  • opflex.startup.full-proxy placeholder use startup db for life of opflex meaning startup db will be updated at run time to keep both in sync

If policy-file exists we create a startupdb thats used for intermediate resolves until the leaf connection succeeds based on the above startup-policy-duration

On every local resolve we lookup startupdb and recursively resolve children and put those in the running modb and generating notifications as needed.

On a connect to leaf depending on the above timer and the fact that these threads can run in parallel we will continue to resolve from startupdb while also sending all the resolves to the leaf.

Once the curtime is beyond the set duration functionality reverts to current behavior of only resolving from the leaf.

On stop we write current running policy into pol.json from the config if present.

If the file is missing functionality is same as before.

Change isOrphan to skip check when using startup db since the timing of the sync resolve is causing some valid mos to be deleted as orphans (still investigating an async approach similar to how it would work
with a mock server or leaf)

Signed-off-by: Madhu Challa challa@gmail.com
(cherry picked from commit a1e4e3c)

    "opflex": {
       "startup": {
            "policy-file": "/home/mchalla/thomas/pol.json",
            "policy-duration": 0,
            "resolve-aft-conn": false
       },

- opflex.startup.policy-file contains pol.json to use at startup
- opflex.startup.policy-duration tells how long in
  seconds to keep resolving policy from the above pol.json
- opflex.startup.resolve-aft-conn wait till conn before using startup db
  use in combination with duration > 0
- opflex.startup.resolve-once placeholder for resolving only first time from startup db
- opflex.startup.full-proxy placeholder use startup db for life of opflex
  meaning startup db will be updated at run time to keep both in sync

If policy-file exists we create a startupdb thats used for
intermediate resolves until the leaf connection succeeds based
on the above startup-policy-duration

On every local resolve we lookup startupdb and recursively
resolve children and put those in the running modb and
generating notifications as needed.

On a connect to leaf depending on the above timer and the fact
that these threads can run in parallel we will continue to resolve
from startupdb while also sending all the resolves to the leaf.

Once the curtime is beyond the set duration functionality reverts
to current behavior of only resolving from the leaf.

On stop we write current running policy into pol.json from the config
if present.

If the file is missing functionality is same as before.

Change isOrphan to skip check when using startup db since the timing
of the sync resolve is causing some valid mos to be deleted as orphans
(still investigating an async approach similar to how it would work
 with a mock server or leaf)

Signed-off-by: Madhu Challa <challa@gmail.com>
(cherry picked from commit a1e4e3c)
@tbachman tbachman merged commit 77c06a5 into lmr May 28, 2024
4 checks passed
@tbachman tbachman deleted the persist branch May 28, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants