aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-12-30 15:43:58 -0300
committerEuAndreh <eu@euandre.org>2024-12-30 15:43:58 -0300
commitaf94cb2dfc7b784ac306cede95bed79ff8bf9bdc (patch)
treefb7d231b6c57a803a4b63fc5ae4c979555478276 /src
parentsrc/dedo.go: Remove DB.NoSync option (diff)
downloaddedo-af94cb2dfc7b784ac306cede95bed79ff8bf9bdc.tar.gz
dedo-af94cb2dfc7b784ac306cede95bed79ff8bf9bdc.tar.xz
src/dedo.go: Remove DB.NoGrowSync option
Diffstat (limited to 'src')
-rw-r--r--src/dedo.go15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/dedo.go b/src/dedo.go
index 437d04f..73b6604 100644
--- a/src/dedo.go
+++ b/src/dedo.go
@@ -1314,14 +1314,6 @@ type DB struct {
// debugging purposes.
StrictMode bool
- // When true, skips the truncate call when growing the database.
- // Setting this to true is only safe on non-ext3/ext4 systems.
- // Skipping truncation avoids preallocation of hard drive space and
- // bypasses a truncate() and fsync() syscall on remapping.
- //
- // https://github.com/boltdb/bolt/issues/284
- NoGrowSync bool
-
// If you want to read the entire database fast, you can set MmapFlag to
// syscall.MAP_POPULATE on Linux 2.6.23+ for sequential read-ahead.
MmapFlags int
@@ -1407,7 +1399,6 @@ func Open(path string, mode os.FileMode, options *Options) (*DB, error) {
if options == nil {
options = DefaultOptions
}
- db.NoGrowSync = options.NoGrowSync
db.MmapFlags = options.MmapFlags
// Set default values for later DB operations.
@@ -2119,7 +2110,7 @@ func (db *DB) grow(sz int) error {
// Truncate and fsync to ensure file size metadata is flushed.
// https://github.com/boltdb/bolt/issues/284
- if !db.NoGrowSync && !db.readOnly {
+ if !db.readOnly {
if runtime.GOOS != "windows" {
if err := db.file.Truncate(int64(sz)); err != nil {
return fmt.Errorf("file resize error: %s", err)
@@ -2145,9 +2136,6 @@ type Options struct {
// available on Darwin and Linux.
Timeout time.Duration
- // Sets the DB.NoGrowSync flag before memory mapping the file.
- NoGrowSync bool
-
// Open database in read-only mode. Uses flock(..., LOCK_SH |LOCK_NB) to
// grab a shared lock (UNIX).
ReadOnly bool
@@ -2170,7 +2158,6 @@ type Options struct {
// No timeout is used which will cause Bolt to wait indefinitely for a lock.
var DefaultOptions = &Options{
Timeout: 0,
- NoGrowSync: false,
}
// Stats represents statistics about the database.