From 2ce4052300b78c9831d5333112b91d0059b57bb1 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Mon, 18 Jan 2021 07:05:27 -0700 Subject: [PATCH] Remove write lock during db checksum --- db.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/db.go b/db.go index c4fe8e1..4c155f7 100644 --- a/db.go +++ b/db.go @@ -1522,17 +1522,6 @@ func (db *DB) CRC64() (uint64, Pos, error) { return 0, Pos{}, err } - // Start a transaction to obtain a write lock on the database. - tx, err := db.db.Begin() - if err != nil { - return 0, Pos{}, fmt.Errorf("begin: %w", err) - } - defer tx.Rollback() - - if _, err := tx.ExecContext(db.ctx, `INSERT INTO _litestream_lock (id) VALUES (1);`); err != nil { - return 0, Pos{}, fmt.Errorf("_litestream_lock: %w", err) - } - // Obtain current position. Clear the offset since we are only reading the // DB and not applying the current WAL. pos, err := db.Pos()