MCPcopy
hub / github.com/benbjohnson/litestream / releaseReadLock

Method releaseReadLock

db.go:1149–1162  ·  view source on GitHub ↗

releaseReadLock rolls back the long-running read transaction.

()

Source from the content-addressed store, hash-verified

1147
1148// releaseReadLock rolls back the long-running read transaction.
1149func (db *DB) releaseReadLock() error {
1150 // Ignore if we do not have a read lock.
1151 if db.rtx == nil {
1152 return nil
1153 }
1154
1155 // Rollback & clear read transaction.
1156 // Use rollback() helper to suppress "already rolled back" errors that can
1157 // occur during shutdown when concurrent checkpoint and close operations
1158 // both attempt to release the read lock. See issue #934.
1159 err := rollback(db.rtx)
1160 db.rtx = nil
1161 return err
1162}
1163
1164// Sync copies pending data from the WAL to the shadow WAL.
1165func (db *DB) Sync(ctx context.Context) (err error) {

Callers 4

CloseMethod · 0.95
initMethod · 0.95
execCheckpointMethod · 0.95

Calls 1

rollbackFunction · 0.85

Tested by 1