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 #516

Merged
merged 1 commit into from
May 9, 2024
Merged

Add support for coming up with a persist policy #516

merged 1 commit into from
May 9, 2024

Commits on May 1, 2024

  1. Add support for coming up with a persist policy

        "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>
    mchalla committed May 1, 2024
    Configuration menu
    Copy the full SHA
    a1e4e3c View commit details
    Browse the repository at this point in the history