releaseReadLock rolls back the long-running read transaction.
()
| 1147 | |
| 1148 | // releaseReadLock rolls back the long-running read transaction. |
| 1149 | func (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. |
| 1165 | func (db *DB) Sync(ctx context.Context) (err error) { |