HomePhabricator
Diffusion Comm 432041206b16

[keyserver] stall secondary nodes until database version is equal to or greater…

Description

[keyserver] stall secondary nodes until database version is equal to or greater than latest wrapped in transaction request blocking migration version.

Summary:
This blocks the secondary nodes from accepting any other traffic other than health checks while the current dbVersion is less than the latest migration specifying wrap_in_transaction_and_block_requests.

Depends on D13212

Test Plan:
I created two migrations and a new keyserver docker image.

Both migrations included await sleep. The first migration specified wrap_in_transaction_and_block_requests and the second migration specified run_simultaneously_with_requests.

While the first migration was running (and the primary node was unavailable due to running the migration), only health checks were available on the load balancer, meaning that the secondary nodes were only accepting health check traffic.

I also console logged to ensure the loop was running. On the second migration however, all endpoints were available for secondary nodes.

Reviewers: ashoat

Reviewed By: ashoat

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D13213