google / seesaw

Seesaw v2 is a Linux Virtual Server (LVS) based load balancing platform.
Apache License 2.0
5.63k stars 511 forks source link

Replace HAState with a proto enum #84

Closed DrJosh9000 closed 4 years ago

DrJosh9000 commented 4 years ago

This makes it easier to integrate with Seesaw from other languages, e.g. a Python script that checks HA state would be able to use the proto enum instead of duplicating values manually.

The integer values remain the same, but "Master" is renamed to "LEADER" to be consistent with internal changes (admittedly the terminology change is a Google-internal decision, but I think a good and reasonable one).

liuyuan10 commented 4 years ago

Curious what interface are you using to check hastate from python?

DrJosh9000 commented 4 years ago

We're scraping HA state as a monitoring variable (exposed via the ECU monitoring server - I'd be interested in making this bit of the GitHub version more complete with something like the Prometheus libraries). The monitoring system is then read by a Python program that implements common operational tasks (failover, drain, undrain, restart) and makes decisions based on the monitoring info (e.g. which server of the pair to tell to fail over).

liuyuan10 commented 4 years ago

It may not be the right use of monitoring metrics. IMO the right way is to have a GRPC interface that replaces the existing rpc one.

On Thu, May 28, 2020 at 6:35 PM Josh Deprez notifications@github.com wrote:

We're scraping HA state as a monitoring variable (exposed via the ECU monitoring server - I'd be interested in making this bit of the GitHub version more complete with something like the Prometheus libraries). The monitoring system is then read by a Python program that implements common operational tasks (failover, drain, undrain, restart) and makes decisions based on the monitoring info (e.g. which server of the pair to tell to fail over).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google/seesaw/pull/84#issuecomment-635705968, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCV6URQ2IADY5GRSWF2DHDRT4GPBANCNFSM4NJ6IFWQ .