superfly / litefs

FUSE-based file system for replicating SQLite databases across a cluster of machines
Apache License 2.0
3.96k stars 95 forks source link

Missing -pos file #300

Closed smashedtoatoms closed 1 year ago

smashedtoatoms commented 1 year ago

I am on version sha-f281fec of litefs. I can not find the pos file next to my db file. Any chance it has moved? I can't cat it or see it using ls -l

smashedtoatoms commented 1 year ago

These are the files in the same directory as my db: dbs id lost+found reel_prod.db reel_prod.db-shm reel_prod.db-wal

dangra commented 1 year ago

Hey @smashedtoatoms, looks like you have your litefs setup mixed because dbs and id are present on LiteFS's internal data dir:

https://github.com/superfly/litefs/blob/f281fecf3573a38785fbd1635ec82d05b1722e45/cmd/litefs/etc/litefs.yml#L25-L27

So, your app shouldn't be opening a sqlite db inside data.dir, instead it should open the db under the path declared by fuse.dir directive:

https://github.com/superfly/litefs/blob/f281fecf3573a38785fbd1635ec82d05b1722e45/cmd/litefs/etc/litefs.yml#L4-L7

smashedtoatoms commented 1 year ago

Oh duh! That makes perfect sense! Sorry to waste your time.