superfly/litefs

What is the best way to change the static primary node when in blue/green deployment?

Closed this issue · 2 comments

Hi,

I have read the document a few times but can't find the answer, is there a way to change the primary node when with static lease?

The situation is deploy a new version to primary node behind a load balancer, when we deploy a new version, we first create a new instance with new codes, make sure everything is fine and then configure the load balancer to route traffic to new node, and then terminate old node.

In this process, there would be a time window that both new version of node and old version of node are both primary, how to handle such situation?

Thank you very much!

can I use cloud share storage like google cloud filestore as litefs device and let it shared by all primary nodes?

example:

fuse:
  dir: "/litefs/fuse"
data:
  dir: "/litefs/internal"

while /litefs is mounted from shared google cloud filestore

@jasonbigl There's not currently a way to change the primary of a static lease. It's meant to be used for a single node that will always be primary so it makes the implementation simple. For HA, something outside of LiteFS needs to handle the lease so it can notify all nodes of a primary change in a consistent way. Right now, we only have an implementation that uses Consul for lease management.

It might be possible to do lease management using an NFS mount. NFS v4 provides a better locking protocol than previous versions. I added an issue to track it (#371).