开发者

SqLite3 NFS mount issue with locking - can I use something like CIFS nobrl?

开发者 https://www.devze.com 2023-04-09 07:35 出处:网络
I\'m having a locking problem where an SQLITE3 databse is permanently locked when created on an NFS file system.I have read that an option called nobrl can help this issue when the file system in ques

I'm having a locking problem where an SQLITE3 databse is permanently locked when created on an NFS file system. I have read that an option called nobrl can help this issue when the file system in question is CIFS. (its an option to the mount command).

From: http://linux.die.net/man/8/mount.cifs

nobrl

Do not send byte range lock requests to the server. This is necessary for certain applications that break with cifs style mandato开发者_如何学编程ry byte range locks (and most cifs servers do not yet support requesting advisory byte range locks).

Is there any way to stop byte-range-lock requests in NFS if they occur, or am I running in the wrong direction by even thinking about this? I'm happy to change the mount command as was done for the CIFS solution.


I recommend to open you sqlite db by software with nolock parameter enabled, golang exg.:

sql.Open("sqlite3", "file:/media/R/Databases//your.db?nolock=1")

while /media/R is a mounted windows nfs-network-drive. Be carefull because you have to lock your db interactions by software otherwise you could corrupt your db, when accessing it simultaneously.

You can read more about sqlite parameters here: https://www.sqlite.org/c3ref/open.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号