Hosted onhoraciohdev.dev.hyper.mediavia theHypermedia Protocol

What is SQLITE Rollback?

On /debug/sqlite, rollback means: a write transaction/savepoint started, but did not commit. SQLite undid the changes made inside that transaction.

In code terms:

BEGIN IMMEDIATE do some SQL error happens ROLLBACK

or for savepoints:

SAVEPOINT do some SQL error/panic/context cancel happens ROLLBACK TO SAVEPOINT RELEASE

Current page rollback counts

From http://localhost:58001/debug/sqlite:

syncing.(*Service).DiscoverObjectWithProgress rollbacks: 33 syncing.(*Server).loadStore rollbacks: 2

No current busy failures:

busy: 0 for visible callers

What rollback usually means here

Rollback is not necessarily a SQLite lock problem.

It usually means the operation was interrupted or failed after starting a transaction/savepoint. Common causes:

    context canceled

    deadline exceeded

    peer sync/discovery failed midway

    function returned an error

    panic/error inside the transaction

    savepoint used for temp-table work got unwound

For DiscoverObjectWithProgress, rollbacks can be normal if discovery attempts get canceled, time out, or stop early.

Difference from busy

    busy means it could not start BEGIN IMMEDIATE because writer lock was unavailable for ~10s.

    rollback means it did start, but later the work was undone.

Recap

rollback on /debug/sqlite means SQLite undid a transaction/savepoint instead of committing it.

    Current rollbacks: mostly syncing.(*Service).DiscoverObjectWithProgress with 33.

    This does not automatically mean lock contention.

    The busy column is the direct SQLite lock-timeout signal; currently visible busy is 0 on port 58001.

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime