Comments (5)
I would attempt to change it myself, but I'm not sure what the correct logic should look like.
from bbolt.
// meta retrieves the current meta page reference.
func (db *DB) meta() *meta {
// We have to return the meta with the highest txid which doesn't fail
// validation. Otherwise, we can cause errors when in fact the database is
// in a consistent state. metaA is the one with the higher txid.
fmt.Printf("bolt: db: meta: meta0: %T,%v, meta1: %T,%v, db.meta0.txid: %T,%v, db.meta1.txid: %T,%v\n",
db.meta0,db.meta0,db.meta1,db.meta1,db.meta0.txid,db.meta0.txid,db.meta1.txid,db.meta1.txid)
metaA := db.meta0
metaB := db.meta1
if db.meta1.txid > db.meta0.txid {
metaA = db.meta1
metaB = db.meta0
}
// Use higher meta page if valid. Otherwise fallback to previous, if valid.
if err := metaA.validate(); err == nil {
return metaA
} else if err := metaB.validate(); err == nil {
return metaB
}
// This should never be reached, because both meta1 and meta0 were validated
// on mmap() and we do fsync() on every write.
panic("bolt.DB.meta(): invalid meta pages")
}
from bbolt.
Suggested change in tx.go:
func (tx *Tx) rollback() {
if tx.db == nil {
return
}
if tx.writable {
tx.db.freelist.rollback(tx.meta.txid)
currFreelist := tx.db.meta().freelist
if currFreelist != pgidNoFreelist {
tx.db.freelist.reload(tx.db.page(currFreelist))
}
}
tx.close()
}
The above change fixed my particular issue, but I have no idea if the logic is correct.
from bbolt.
@jeffkayser2 will be fixed, sorry take so long...
from bbolt.
Resolved. Please try with the latest source code.
from bbolt.
Related Issues (20)
- Bbolt weirdly formatted output when listing keys of a bucket when keys are numbers rather than strings HOT 15
- Backport `concurrent_test.go` to `release-1.3` branch HOT 2
- Change the path of the subbucket HOT 10
- Create a workflow template to be shared by both arm64 and non-arm64 workflow tests HOT 3
- Use `GOMEMLIMIT` instead of `GOGC` to limit GitHub test workflow memory HOT 2
- Attempting to insert into bucket crashes on `tx.allocate()` HOT 5
- Possible Runtime Error (Potential Deadlock) and Incorrect Results Under High Concurrency with NoSync Enabled HOT 4
- Limit running arm64 tests GitHub workflow to this repository HOT 2
- Enable GitHub workflows for PRs with the ok-to-test label HOT 1
- Question about Batch vs Update HOT 4
- Nominate @fuweid as a bbolt reviewer HOT 9
- Crash when writing data to database HOT 5
- Definition of random writes HOT 2
- Storing values larger than (1 << 31) - 2 (2 GB) HOT 4
- Introduce qemu to verify all the existing platforms HOT 1
- Recommendation for multiple random read/write structure HOT 2
- A Love Letter HOT 1
- Hash integrity HOT 2
- `bbolt` CLI util panics / shows not-user-friendly errors in certain cases with incorrect (number of) arguments HOT 3
- tx.Commit() - function not implemented HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bbolt.