-
Notifications
You must be signed in to change notification settings - Fork 60
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
After read/write too many data, one key-value lost. #41
Comments
what is "a lot"? 10? 100? 1000? |
exceed 100k |
made a copy backup for database, i found at one point, a lot of |
thank you, I will try to reproduce it when I find some time! |
I test it, not happen, how do you test it ? test code use rusty_leveldb::{Options, DB};
fn main() {
let mut db = DB::open("test.db", Options::default()).unwrap();
let rs = db.put("hello".as_bytes(), "world".as_bytes());
println!("put result: {:?}", rs);
let rs = db.get("hello".as_bytes());
println!("get result: {}", String::from_utf8(rs.unwrap()).unwrap());
let mut db = insert_too_many_data(db);
let rs = db.get("hello".as_bytes());
println!("get result: {}", String::from_utf8(rs.unwrap()).unwrap());
}
fn insert_too_many_data(mut db: DB) -> DB {
for i in 0..3_000_000 {
let _ = db.put(i.to_string().as_bytes(), format!("val{}", i).as_bytes());
let get_rs = db.get((i - 1).to_string().as_bytes());
match get_rs {
Some(val) => {
let rs = String::from_utf8(val).unwrap();
let expect = format!("val{}", i - 1);
assert_eq!(rs, expect, "expect {} get result: {}", expect, rs);
}
None => {
println!("key {} get result: None", i - 1);
}
}
}
db
} but @dermesser is it possible to modify Read opertion condition? I agree with @0xEclair , it shouldn't need |
Fundamentally, So if |
I don't know why this error happened. Is it possible?
Also i don't know whether other key-values lost.
The scenario:
I guess this error happened with creating new ldb file.
The text was updated successfully, but these errors were encountered: