Skip to content

Insert-during-iterate deadlock #73

Closed Answered by marvin-j97
dbbnrl asked this question in Q&A
Discussion options

You must be logged in to vote

Writing to a batch should work though... (a transaction would also work)

let mut batch = keyspace.batch();

let iter = db.snapshot().iter();

for kv in iter {
  batch.insert(&db, k, v);
}

batch.commit()?;

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@dbbnrl
Comment options

Answer selected by dbbnrl
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn't working
2 participants