Backup: do not write the index cache inside the read-only dump transaction
A database dump that fills a whole pack (32 MiB) uploads that pack while the dump transaction is still open, and the pack's index cache row was inserted on the same connection. PostgreSQL refuses that (25006, read-only transaction) and the run failed; on other databases the row was rolled back with the dump transaction. The index now holds those cache writes back until the transaction is over.
This commit is contained in:
@@ -262,6 +262,15 @@ final class Repository {
|
||||
});
|
||||
}
|
||||
|
||||
/** See BlobIndex::holdCache(): no database writes until releaseIndexCache(). */
|
||||
public function holdIndexCache(): void {
|
||||
$this->index->holdCache();
|
||||
}
|
||||
|
||||
public function releaseIndexCache(): void {
|
||||
$this->index->releaseCache();
|
||||
}
|
||||
|
||||
public function flushPacks(): void {
|
||||
$this->runPacks?->flush();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user