Actually commit when flushing bloblog pointers
This commit is contained in:
parent
8eeafa7626
commit
a37acf3e74
@ -26,7 +26,7 @@ use std::{fs, thread};
|
||||
|
||||
use anyhow::{bail, Context};
|
||||
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
|
||||
use log::warn;
|
||||
use log::{info, warn};
|
||||
use nix::unistd::sync;
|
||||
use rusqlite::{params, Error, ErrorCode};
|
||||
use rusqlite::{Connection, OptionalExtension};
|
||||
@ -383,7 +383,8 @@ impl SqliteBloblogPile {
|
||||
pointers_buffered: &mut Vec<(ChunkId, BloblogPointer)>,
|
||||
) -> anyhow::Result<()> {
|
||||
let mut inner = this.inner.lock().unwrap();
|
||||
let txn = inner.connection.transaction()?;
|
||||
let mut txn = inner.connection.transaction()?;
|
||||
{
|
||||
let mut stmt = txn.prepare(
|
||||
"INSERT OR FAIL INTO chunks (chunk_id, bloblog, offset) VALUES (?1, ?2, ?3)",
|
||||
)?;
|
||||
@ -406,6 +407,8 @@ impl SqliteBloblogPile {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
txn.commit()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -459,6 +462,7 @@ impl SqliteBloblogPile {
|
||||
self.return_writing_bloblog(bloblog_id, bloglog_mutex)?;
|
||||
}
|
||||
|
||||
info!("Flushing pointers (storage pipeline shutdown).");
|
||||
flush_pointers(self, &mut pointers_buffered)?;
|
||||
|
||||
// we MUST have flushed ALL the pointers by now.
|
||||
|
Loading…
Reference in New Issue
Block a user