aboutsummaryrefslogtreecommitdiff
path: root/syscall_linux.go (unfollow)
Commit message (Expand)AuthorFilesLines
2014-04-04Add Tx.OnCommit() handler.•••This commit adds the ability to execute a function after a transaction has successfully committed. Ben Johnson2-12/+58
2014-04-03README•••Add 'Scuttlebutt' to list of projects that use Bolt.Ben Johnson1-0/+1
2014-04-02Add meta page checksums.•••This commit adds checksums to the meta pages on every write. When the database loads, it verifies the checksums on the meta pages and returns an error if either one is corrupt. In the future, it should fallback to the previous meta page but for right now it just hard fails. This is at least preferable to opening the database and getting a random error or further corruption. Fixes #25. Ben Johnson3-10/+55
2014-04-02Add performance counters.•••This commit adds performance counters for each transaction which are rolled up to the database level on each commit/rollback. Counters are meant to be a very fast way to track what is going on in the database. A few timers are also added in areas where the time.Now() overhead is not noticible. The DB.Stat() function is now deprecated since the `bolt` CLI now performs similar functions. Fixes #108. Ben Johnson8-100/+160
2014-04-02Add advisory file locking.•••This commit adds advisory locking via flock() to the database file. This ensures that two separate processes cannot both open the same data file which would cause corruption. Fixes #110. Ben Johnson1-0/+12
2014-04-02Consolidate file and metafile descriptors.•••Previously, a two file descriptors were used for the database: file & metafile. The "file" file descriptor was used for async writes while the "metafile" file descriptor was used with O_SYNC writes. This commit changes that so that there's only one file descriptor and it uses fdatasync() to synchronize writes. Ben Johnson2-18/+10
2014-04-02README•••Remove the 'Internals' section since it is half-assed right now.Ben Johnson1-30/+1
2014-04-02Remove count and overflow columns for free pages on 'bolt pages'.•••The count and overflow columns are meaningless for freed pages since there could be random overflow data in there. This commit removes those columns for free pages. Ben Johnson1-4/+12
2014-03-31Add DVID to projects using Bolt•••DVID added Bolt as an optional storage engine.Bill Katz1-0/+1
2014-03-31Remove DB.Open() and only allow bolt.Open().•••Per @tv42's suggestion, this commit removes the ability to reopen an instance of DB. All open calls go through bolt.Open(). Fixes #103. Ben Johnson4-124/+79
2014-03-31Write freelist after each commit.•••Well, this is embarassing. Somehow the freelist was never getting written after each commit. This commit fixes that and fixes a small reporting issue with "bolt pages". Ben Johnson6-10/+51
2014-03-29Add DB.Check().Ben Johnson7-1/+140
2014-03-27Refactor bolt commands into individual files.Ben Johnson11-316/+395
2014-03-26Fix DB.Copy() meta lock and partial write checks.Ben Johnson1-1/+12
2014-03-25Fix quickcheck test for duplicate keys.Ben Johnson1-4/+15
2014-03-25Fix bucket reclamation.•••The bucket page is allocated separately from the rest of the pages but the old bucket pages were not being added to the freelist. This change fixes that and adds a simple check for database consistency. More advanced consistency checks can be added in the future. Fixes #82. Ben Johnson3-9/+52
2014-03-24README•••Add a list of "Other Projects Using Bolt".Ben Johnson1-0/+7
2014-03-24Make DB/Tx API more consistent.•••I consolidated the DB.Tx() and DB.RWTx() calls into a single DB.Begin(writable bool) call. This is more consistent with the database/sql library. I also changed the DB.Do() and DB.With() call to DB.Update() and DB.View(), respectively. This is more intuitive and more inline with other database verbiage. Ben Johnson8-149/+157
2014-03-24Error refactoring.•••Fixed up a few error issues and refactored out the Error type. Ben Johnson8-106/+94
2014-03-24Re-add tests for write failures•••Commit d2173f5f0ecbf4ed93c768e975435b04df3186ec removed the complete os & syscall mocking layer as overly complex. This commit adds back the simplest possible thing: hooks to control the database file writes. Missing tests: TestDBOpenMetaFileError, TestDBMmapStatError. These are harder to test without more extensive mocking. Conflicts: db_test.go Tommi Virtanen3-3/+78
2014-03-24Resolve remaining errcheck warnings.Ben Johnson2-11/+29
2014-03-23Check errors from file close in DB.CopyFile•••Write errors are often delayed and reported only by the close. The extra close in defer on success is harmless, (*os.File).Close protects itself against multiple closes, and this way it's immediately obvious there is no code path that would leak open files. Tommi Virtanen1-1/+5
2014-03-23Check spill error in CommitTommi Virtanen1-1/+3
2014-03-23Check meta page write error in CommitTommi Virtanen1-1/+3
2014-03-23Add ErrTxClosed error.•••Commit/Rollback and mutable calls on Tx and Bucket now return ErrTxClosed if the transaction has already been committed or rolled back. Non-mutable calls have added an assertion to check if the transaction is closed which will cause a panic. I don't want to introduce an error return for accessor methods that are being used improperly so I think the panic is appropriate. Ben Johnson5-17/+89
2014-03-23Mark Do()/With() transaction as managed.•••Transaction created from Do() and With() are now considered "managed". Managed transactions cannot be manually committed or rolled back since the Do() and With() functions provide that functionally automatically. Previously, a Tx could be manually committed and then any changes after that would be lost. Ben Johnson3-5/+43
2014-03-23Consolidate syscall files.Ben Johnson2-1/+0
2014-03-23fix 32bit build fails: bucket.go#67binz1-1/+1
2014-03-22Call fdatasync/fsync after writing out non-meta pages•••This avoids a case where writes can be reordered so meta page is written before a page it refers to, potentially causing a corrupt database after a power loss or kernel crash. Tommi Virtanen3-0/+23
2014-03-21Fix print.Ben Johnson1-6/+31
2014-03-21Add 'bolt buckets'.Ben Johnson2-0/+54
2014-03-21Add 'bolt set'.Ben Johnson2-3/+69
2014-03-21Add 'bolt pages'.Ben Johnson4-0/+97
2014-03-21Add 'bolt keys'.Ben Johnson2-3/+75
2014-03-21Add 'bolt get'.Ben Johnson2-0/+190
2014-03-21Fix db.munmap() to return an error.•••Changes munmap to return an error and the DB now implements io.Closer. I also removed all the OS and Syscall mocking because it's causing issues. Corrupt file tests need to be recreated but directly using the file system instead. Ben Johnson9-347/+36
2014-03-21Remove ease-of-use functions from the DB type.•••Functions such as DB.Put(), DB.Get(), and DB.Delete() were originally added to be easy to use, however, after implementing Bolt in multiple projects I have found these ease-of-use functions useless. Nearly every use case requires multiple calls in a single transaction. Using the DB ease of use functions turned out to be an antipattern. Ben Johnson6-500/+472
2014-03-15Fix Bucket.ForEach() comment.Ben Johnson1-1/+2
2014-03-13Skip long-running tests with go test -shortTommi Virtanen3-0/+28
2014-03-13Fix Tx.Buckets() sort order.•••@tv42 reported an issue with bucket names returning incorrectly. Not sure if this fixes the issue but it is necessary anyway. Ben Johnson2-0/+7
2014-03-13Fix Cursor.Last() on empty buckets.•••@tv42 reported that creating a cursor on an empty bucket and then calling Cursor.Last() causes an index out of range error and panics. This commit adds a check for the page's item count being greater than zero. Fixes #63. Ben Johnson2-7/+22
2014-03-10READMEBen Johnson1-2/+2
2014-03-08Consolidate Tx and RWTx.Ben Johnson16-718/+718
2014-03-08Rename Transaction to Tx.•••I changed the Transaction/RWTransaction types to Tx/RWTx, respectively. This makes the naming more consistent with other packages such as database/sql. The txnid is changed to txid as well. Ben Johnson17-273/+259
2014-03-04Add benchmarks.Ben Johnson5-1/+106
2014-03-01Ignore multiple transaction commit/rollback/close.Ben Johnson3-5/+16
2014-03-01Allow reads of unflushed nodes.•••This commit allows cursors to read updated values from within the RWTransaction. Ben Johnson7-62/+172
2014-02-28Minor refactor.Ben Johnson6-32/+26
2014-02-27Fix the mmap resize to use the correct size.•••Fixes #54. Previously the DB was calculating a minimum mmap size but using the wrong variable after it calculated the size. This commit changes the DB to use the correct variable. Ben Johnson1-1/+1
2014-02-27Add bucket reclamation.•••After RWTransaction.DeleteBucket() is called, all pages related to the bucket are moved to the freelist for that transaction. Ben Johnson2-2/+12