superfly/litefs

Regenerate Node ID on Startup

Closed this issue · 0 comments

LiteFS currently generates a unique node ID and persists it to $LITEFS_DATA_DIR/id so it can be reused in the future. The main goal of the node ID is to prevent a node from accidentally connecting to itself for any reason. However, this doesn't require that the ID actually be persisted.

The downside to persisting the ID is that cloning a data directory for another node will cause both nodes to share the same node ID and they won't be able to connect to one another. @kentcdodds experienced this as mentioned in his Fly.io Community post.