Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLITE_CONSTRAINT_CHECK error and rollback stops syncing with other nodes #428

Open
rkrdeano opened this issue Feb 11, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@rkrdeano
Copy link

rkrdeano commented Feb 11, 2024

I had a bug in my app which resulted in a number of SQLITE_CONSTRAINT_CHECK errors.

I was inserting thousands of records across a number of tables all in a named transaction, when the constraint check failed it rolled the transaction back.

When a number of these happen close together the data stopped being sent to the non primary node.

When you restarted the primary server it got an error like this

cannot open store: open databases: open database("sqlite.db"): verify database file: database checksum (f6b0461071c271bd) does not match latest LTX checksum

The only way to get the primary back up again was to delete the /litefs/dbs/<database.sqlite> folder and restart the machine.

There were no errors reported by litefs when this issue occured, it was only that i noticed the filesize had stopped growing on the secondary node.

@benbjohnson
Copy link
Collaborator

@rkrdeano I'm sorry to hear about the issue. What version of LiteFS were you running when you hit the bug?

@benbjohnson benbjohnson added the bug Something isn't working label Feb 12, 2024
@rkrdeano
Copy link
Author

@benbjohnson Thats ok these things happen. Just took me a while to work out what was going on.

I was using 0.5.11.

I saw found another issue mentioning FTS5, I am using that in my application too, so not sure if that contributes to the issue? I have some triggers that add and remove records from the virtual table, and this would have happened during the transaction too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants