-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panicked at 'assertion failed: self.meta.root_page == page_id || self.page_parents.contains_key(&page_id)' #11
Comments
Can you give me any more context to reproduce this reliably? |
I'll work on that. But this was all I currently have from my systemd journal where I didn't have extra stack trace info turned on. |
OK it looks like this error occurs on every write attempt now, so I was able to capture the extra backtrace info.
And my calling code is: fn store_config(&self, config: &Config) -> Result<(), Error> {
trace!("store_config({})", config.id);
let tx = self.db.tx(true)?;
let bucket = match tx.get_bucket(BUCKET_CONFIGS_BY_ID) {
Err(JammdbError::BucketMissing) => tx.create_bucket(BUCKET_CONFIGS_BY_ID)?,
Err(e) => return Err(Error::from(e)),
Ok(b) => b,
};
bucket.put(&config.id, Bytes::from(serialize_config(&config)))?;
tx.commit()?;
Ok(()) |
Hmm, if it's happening on every write now the database file probably got into a bad state somehow. Two things that would be helpful if possible:
|
There's nothing confidential within my DB, so you're welcome to have a copy. This is from a Raspberry Pi so the architecture was I'll need some time but I'll try to dig through the log history to find the initial failure event. |
As for what I was doing when the database became corrupt, a code review reveals that the code shown above is the only thing going on on a regular basis (besides read-only ops which I'm assuming are irrelevant). |
I am also having this problem in my application. Unfortunately I am unable to share my database at the point of the issue, but it occurs consistently with a particular sequence of writes. My code looks like this: fn put(&mut self, key: u64, value: &[u8]) -> std::result::Result<(), Error> {
let tx_result = (|| {
let tx = self.db.tx(true)?;
let bucket = tx.get_or_create_bucket("cache")?;
let r = bucket.put(key.to_be_bytes(), value).map(|_| ());
tx.commit()?;
r
})();
// ... other code
tx_result
} |
Hey @brandonhamilton, I know there is a race condition somewhere in here but I'm not able to reproduce it consistently so I'm having a hard time finding it. Do you have steps that consistently reproduce the error? |
Same issue for me too thread 'actix-rt|system:0|arbiter:0' panicked at 'assertion failed: self.meta.root_page == page_id || self.page_parents.contains_key(&page_id)', /home/admins/.cargo/registry/src/github.com-1ecc6299db9ec823/jammdb-0.5.0/src/bucket.rs:723:17 cargo 1.61.0-nightly (109bfbd 2022-03-17)
|
I'm also reproducing this with 100% reproducibility and a fresh file each time. |
@abc-mikey Can you share your code and your system details? |
I believe |
The text was updated successfully, but these errors were encountered: