Skip to content

Commit

Permalink
Merge pull request #712 from bhandras/db-durability
Browse files Browse the repository at this point in the history
loopdb: make sqlite sync for extra durability
  • Loading branch information
bhandras authored Mar 4, 2024
2 parents 010b63d + 7fe4ee2 commit 1cd4207
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions loopdb/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ func NewSqliteStore(cfg *SqliteConfig, network *chaincfg.Params) (*SqliteSwapSto
name: "busy_timeout",
value: "5000",
},
{
// With the WAL mode, this ensures that we also do an
// extra WAL sync after each transaction. The normal
// sync mode skips this and gives better performance,
// but risks durability.
name: "synchronous",
value: "full",
},
{
// This is used to ensure proper durability for users
// running on Mac OS. It uses the correct fsync system
// call to ensure items are fully flushed to disk.
name: "fullfsync",
value: "true",
},
}
sqliteOptions := make(url.Values)
for _, option := range pragmaOptions {
Expand Down

0 comments on commit 1cd4207

Please sign in to comment.