Commit Graph

575 Commits (c69cb102ce8f7609b57f75d0ccb10862167001e7)

Author SHA1 Message Date
Ben Johnson c69cb102ce Merge pull request #377 from benbjohnson/close-race
Wait for pending transactions on close
2015-05-21 09:02:35 -06:00
Ben Johnson e929eba364 Wait for pending tx on close.
This commit fixes the DB.Close() function so that it waits for any
open transactions to finish before closing.
2015-05-20 16:10:07 -06:00
Ben Johnson 55af28c19c Merge pull request #376 from ryanuber/readme-consul
Add Consul to README
2015-05-19 20:17:35 -06:00
Ryan Uber 89ab219630 Add Consul to README 2015-05-19 19:12:40 -07:00
Ben Johnson 957d850b51 README 2015-05-18 13:50:00 -06:00
Ben Johnson d4363a9208 Merge branch 'ro' 2015-05-18 13:45:09 -06:00
Ben Johnson df52bd0803 Add test case inline documentation. 2015-05-18 13:45:02 -06:00
sasha-s aa13f7f94f make ignoring Truncate() explicit
https://github.com/boltdb/bolt/pull/371#issuecomment-103176330
2015-05-18 12:00:40 -07:00
sasha-s fda75748b5 use a shared lock in read-only mode
https://github.com/boltdb/bolt/pull/371#issuecomment-103119486
2015-05-18 11:07:19 -07:00
Ben Johnson c5eb8da413 Merge pull request #375 from benbjohnson/min-mmap-size
Change min mmap size from 1MB to 32KB.
2015-05-18 11:51:49 -06:00
Ben Johnson a450f843ee Change min mmap size from 1MB to 32KB.
This commit adjusts the minimum mmap size from 1MB to 32KB. The
previous limit was arbitrary and causes wasted space for very small
databases.

Thanks to @mcuadros for submitting the original pull request:

  https://github.com/boltdb/bolt/pull/351
2015-05-18 10:37:47 -06:00
Ben Johnson 75e094b84f Merge pull request #374 from oliver006/master
Update README.md - add project
2015-05-18 10:31:09 -06:00
Ben Johnson 2c5801bedd Merge branch 'fix-crash' 2015-05-18 10:15:49 -06:00
Ben Johnson bf5458de2f Add inline documentation for bdc109b.
This commit simply adds some additional comments to the commit provided
by sasha-s that fixes the "slice out of bounds" errors.
2015-05-18 10:14:47 -06:00
Oliver 27f88b367d Update README.md
Adding prometheus annotation server to the list projects using BoltDB.
2015-05-18 09:34:19 -04:00
sasha-s 019bf5b010 open read-only databases in read-only mode 2015-05-14 15:43:13 -07:00
Ben Johnson 2c04100eb9 Merge pull request #366 from benbjohnson/sync
Add DB.Sync()
2015-05-10 09:00:53 -06:00
Ben Johnson e5aaa976ba Add DB.Sync().
This commit adds DB.Sync() for users who set DB.NoSync to true.
2015-05-08 13:11:15 -06:00
Ben Johnson da700e8fdb Add caveat regarding endianness of data files as suggested by Raphael Geronimi. 2015-05-06 09:26:22 -06:00
Ben Johnson fd65d6c954 Merge pull request #363 from benbjohnson/no-truncate
Add DB.NoTruncate flag.
2015-05-06 09:24:37 -06: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 550b8c7cb6 Merge pull request #354 from xiang90/cmd
cmd/bolt: remove duplicate blockProfile flag
2015-04-28 11:12:55 -07:00
Ben Johnson 8a2a9b2eb7 Merge pull request #356 from timshannon/master
Added Freehold to the projects list in README + Transaction Documentation change
2015-04-23 08:41:13 -07:00
Tim Shannon 07590fc00b Added Freehold to the projects list in README.
Added a few lines of documentation to clarify that read-only
transactions need to be rolled back and not committed, as per the
discussion in issue #344
2015-04-23 09:49:55 -05:00
Xiang Li 71f28eaecb cmd/bolt: remove duplicate blockProfile flag 2015-04-22 21:37:22 -07:00
Ben Johnson d647626090 Merge pull request #352 from benbjohnson/cli
Refactor CLI
2015-04-19 20:51:38 -06:00
Ben Johnson 73a3aa1ccc Add 'bolt page' command. 2015-04-17 13:28:32 -06:00
sasha-s bdc109bdc7 fix `slice bounds out of range`/maxAllocSize bugs
when accessing the node data we used to use cast to
*[maxAllocSize]byte, which breaks if we try to go across maxAllocSize boundary.

This leads to occasional panics.
Sample stacktrace:
```
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
github.com/boltdb/bolt.(*node).write(0xc208010f50, 0xc27452a000)
    $GOPATH/src/github.com/boltdb/bolt/node.go:228 +0x5a5
github.com/boltdb/bolt.(*node).spill(0xc208010f50, 0x0, 0x0)
    $GOPATH/src/github.com/boltdb/bolt/node.go:364 +0x506
github.com/boltdb/bolt.(*node).spill(0xc208010700, 0x0, 0x0)
    $GOPATH/src/github.com/boltdb/bolt/node.go:336 +0x12d
github.com/boltdb/bolt.(*node).spill(0xc208010620, 0x0, 0x0)
    $GOPATH/src/github.com/boltdb/bolt/node.go:336 +0x12d
github.com/boltdb/bolt.(*Bucket).spill(0xc22b6ae880, 0x0, 0x0)
    $GOPATH/src/github.com/boltdb/bolt/bucket.go:535 +0x1c4
github.com/boltdb/bolt.(*Bucket).spill(0xc22b6ae840, 0x0, 0x0)
    $GOPATH/src/github.com/boltdb/bolt/bucket.go:502 +0xac2
github.com/boltdb/bolt.(*Bucket).spill(0xc22f4e2018, 0x0, 0x0)
    $GOPATH/src/github.com/boltdb/bolt/bucket.go:502 +0xac2
github.com/boltdb/bolt.(*Tx).Commit(0xc22f4e2000, 0x0, 0x0)
    $GOPATH/src/github.com/boltdb/bolt/tx.go:150 +0x1ee
github.com/boltdb/bolt.(*DB).Update(0xc2080e4000, 0xc24d077508, 0x0, 0x0)
    $GOPATH/src/github.com/boltdb/bolt/db.go:483 +0x169
```
It usually happens when working with large (50M/100M) values.
One way to reproduce it is to change maxAllocSize in bolt_amd64.go to 70000 and run the tests.
TestBucket_Put_Large crashes.
2015-04-16 11:58:02 -07:00
Ben Johnson 3ad30436da Add 'bolt dump' command. 2015-04-16 11:13:34 -06:00
Ben Johnson dd542876fa Add improved CLI documentation. 2015-04-15 15:21:50 -06:00
Ben Johnson d0e8a99e30 Refactor bolt CLI. 2015-04-14 16:32:20 -06:00
Ben Johnson 3b449559cf Add --path to bolt bench. 2015-04-12 09:36:45 -06:00
Ben Johnson 5edfe08f65 Merge pull request #347 from mike-marcacci/patch-1
Added InfluxDB to list of projects using bolt
2015-04-11 19:58:53 -06:00
Mike Marcacci c50df3a891 Added InfluxDB to list of projects using bolt 2015-04-11 18:16:07 -07:00
Ben Johnson ee954308d6 Merge pull request #342 from chrislusf/master
Adding used by Seaweed File System
2015-03-29 14:20:00 -06:00
chrislusf 393eacd1fe Update README.md 2015-03-29 13:05:23 -07:00
chrislusf 4eced79bd1 Update README.md 2015-03-29 13:04:56 -07:00
Ben Johnson 8b138fd106 Merge pull request #340 from DSpeichert/master
Update README.md: fixed type mismatch
2015-03-28 17:06:38 -06:00
Daniel Speichert 597d69fa1e Update README.md: fixed type mismatch 2015-03-28 18:59:17 -04:00
Ben Johnson 73b849dfc2 Merge pull request #336 from boltdb/reclamation-docs
README
2015-03-27 16:14:54 -06:00
Ben Johnson a8ee2caab1 Add link to page reclamation comment. 2015-03-27 16:13:55 -06:00
Ben Johnson 9d1dd87a79 README
Document use of free pages and page reclamation works.
2015-03-27 15:27:32 -06:00
Ben Johnson 63ec32ef32 Merge pull request #334 from funkygao/master
fix doc bug and add comment for db.dataref
2015-03-25 09:32:52 -06:00
funkygao 6d043164a9 add comment: db.dataref is readonly 2015-03-25 22:05:58 +08:00
funkygao 20852b29c4 fix comment bug: minium db mmapSize is 1MB instead of 4MB 2015-03-25 22:04:41 +08:00
Ben Johnson 837170ea29 Merge pull request #333 from benbjohnson/document-key-value-safety
Document key/value safety.
2015-03-24 12:28:40 -06:00
Ben Johnson 112f143631 Document key/value safety.
This commit adds safety documentation to the data accessor functions
in Bolt as well as the README. This was documented once in the package
level godoc but it's important enough that it should be more clear.
2015-03-24 11:06:28 -06:00
Ben Johnson a9651995e1 Merge pull request #330 from benbjohnson/tx-writer-to
Implement io.WriterTo interface on Tx.
2015-03-22 15:26:13 -06:00
Ben Johnson 4d30731e91 Merge pull request #285 from tv42/batch
Add transaction batching
2015-03-18 10:11:07 -06:00
Ben Johnson 8c6af54aec Implement io.WriterTo interface on Tx.
This commit moves the functionality in Tx.Copy() to Tx.WriteTo(). This
allows Tx to be used as an io.WriterTo which makes it easier to mock.

The Tx.Copy() function still exists but it's simply a wrapper around
Tx.WriteTo().
2015-03-18 08:23:55 -06:00