diff options
Diffstat (limited to 'tx.go')
-rw-r--r-- | tx.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -157,6 +157,8 @@ func (tx *Tx) Commit() error { // Free the old root bucket. tx.meta.root.root = tx.root.root + opgid := tx.meta.pgid + // Free the freelist and allocate new pages for it. This will overestimate // the size of the freelist but not underestimate the size (which would be bad). tx.db.freelist.free(tx.meta.txid, tx.db.page(tx.meta.freelist)) @@ -171,6 +173,10 @@ func (tx *Tx) Commit() error { } tx.meta.freelist = p.id + if tx.meta.pgid > opgid { + tx.db.growSize(int(tx.meta.pgid+1) * tx.db.pageSize) + } + // Write dirty pages to disk. startTime = time.Now() if err := tx.write(); err != nil { |