From d279ea44cedc355c5dc574d2fd6edfb5e2088410 Mon Sep 17 00:00:00 2001 From: Martin Kobetic Date: Fri, 9 May 2014 13:35:00 +0000 Subject: add asserts for detecting pgid high watermark overflow --- db.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'db.go') diff --git a/db.go b/db.go index d96a161..0b74621 100644 --- a/db.go +++ b/db.go @@ -705,6 +705,10 @@ func (m *meta) copy(dest *meta) { // write writes the meta onto a page. func (m *meta) write(p *page) { + + _assert(m.root.root < m.pgid, "root bucket pgid (%d) above high water mark (%d)", m.root.root, m.pgid) + _assert(m.freelist < m.pgid, "freelist pgid (%d) above high water mark (%d)", m.freelist, m.pgid) + // Page id is either going to be 0 or 1 which we can determine by the transaction ID. p.id = pgid(m.txid % 2) p.flags |= metaPageFlag -- cgit v1.2.3