Why I need to lock ipfs repo

Hi,

I’m trying creating IPFS Node. I wondered why I need to lock the repo of the IPFS Node. What happens when multiple nodes access the repo at the same time?

There are data races, basically both nodes write different data at the same place and override each other corrupting everything.
If the repo is locked there are never unsafe concurrent read or writes.

1 Like

By the way it raises a flag to the os’ file system saying this file is locked and there’s literally a file in the repo folder that they locks so you know the entire repo is locked

1 Like

I understand. Thank you for your answer.