Commit Graph

5 Commits (019bf5b010caa9b546c17add2ddd68d58c58fc10)

Author SHA1 Message Date
sasha-s 019bf5b010 open read-only databases in read-only mode 2015-05-14 15:43:13 -07:00
Ben Johnson b107b35f19 Add DB.NoGrowSync flag.
This commit adds the DB.NoGrowSync flag to optionally revert mmap()
calls to how they were implemented before the ext3/ext4 fix. When
NoGrowSync is true, remapping the data file will not force the file
system to resize it immediately. This works for non-ext3/4 file
systems.

The default value of NoGrowSync is false so it is still safe for
ext3/ext4 file systems by default.

See also: https://github.com/boltdb/bolt/issues/284
2015-05-06 09:23:32 -06:00
Ben Johnson 6bb25854a1 Add truncate() and sync() on resize.
This commit fixes an issue with ext3/ext4 filesystems where metadata file size is not synced
when resizing a file. It also resizes the entire resize instead of updating the size during
individual page writes.

Thanks to @tv42 for the fix.
2015-01-18 08:24:53 -07:00
Dave Collins 8cdba50ea1 Rework build to support more liberal unix variants.
Rather than having the build setup such that it will only work on the
specifically defined operating systems, this commit modifies it to use
more liberal !windows,!plan9 build tag for the unix specific bits.

This means bolt will compile on more Operating Systems such as OpenBSD,
FreeBSD, and NetBSD.

See boltdb/bolt#257 for discussion.
2014-09-18 14:04:59 -05:00
Ben Johnson 00ee0da528 Add Open() options, flock timeout.
This commit changes Open() to provide an additional Options argument. The options
argument currently only has a Timeout which will cause the Open() to return
ErrTimeout if a file lock cannot be obtained in time.

Fixes #207.
2014-06-21 14:44:28 -06:00