natesales / pathvector

Declarative routing platform that automates BGP route optimization and control plane configuration with secure and repeatable routing policy.
https://pathvector.io
MIT License
206 stars 26 forks source link

Optimizer has the bug (it cannot modify config file in /var/run/pathvector/cache/) #235

Open atlanteg opened 2 months ago

atlanteg commented 2 months ago

Describe the bug When running pathvector -v optimizer , got FATAL error when it tries to change policy/config file. FATA[0012] reading peer file: open /var/run/pathvector/cache/ASNNNNN_IX.conf: no such file or directory (While pathvector itself working perfectly, generating configs in /var/run/pathvector/cache/ OK, then deleting them.) I recognized that "pathvector -v optimizer" clears/removes all generated pathvector's files /var/run/pathvector/cache/* just before trying to read one of them.

Environment Output from pathvector version Pathvector 6.3.2 Built https://github.com/natesales/pathvector/commit/c35220bf121f366ff05a51d93c6236e8c324d682 on 2023-06-11T07:03:14Z No plugins BIRD: ready. OS version DISTRIB_ID=Ubuntu DISTRIB_RELEASE=20.04 DISTRIB_CODENAME=focal DISTRIB_DESCRIPTION="Ubuntu 20.04.6 LTS" Minimum reproducible example of your Pathvector config file formatted with triple backticks with yaml language identifier

optimizer:
  targets: [ "<A.B.C.D>" ]
  modifier: 80
  probe-interval: 30
  latency-threshold: 13

  routeserver:
    ...
    local-pref: 179
    probe-sources: [ "<L.O.I.P>" ]
    optimize-inbound: true

To Reproduce Steps to reproduce the behavior:

  1. Copy this config to pathvector.yml...
  2. Run pathvector -v generate
  3. Run pathvector -v optimizer
  4. See error

Expected behavior I expect optimizer to work normally.

And have one more important question - it seems to be logical to have "latency-threshold" as separate parameter for each probe "target". To optimize really well - it would be per-prefix local-preference change. Could it be noted as feature request as well please?