timshannon / badgerhold

BadgerHold is an embeddable NoSQL store for querying Go types built on Badger
MIT License
515 stars 52 forks source link

WIP Support Badger v2 #37

Closed tiero closed 3 years ago

tiero commented 3 years ago

This is not meant to be merged, but rather a PoC for v2 support.

This should closes #21

timshannon commented 3 years ago

Thanks for taking the first steps on this. I'll review and see where we can go next when I get some time.

timshannon commented 3 years ago

I had the same issues with DB close in my PR. I'm going to close this one in favor of the other one, due to all the import path rewrites.

They must have made some concurrency and memory fixes in V2 of badger, because I was able to move back to opening a separate DB for each test as opposed to using one shared global DB.

I believe the Key issue was due to fact that the DropAll call I needed to make between each test didn't lock reads, so I think there were tests trying to read data that had been dropped between tests (https://godoc.org/github.com/dgraph-io/badger#DB.DropAll).

Moving to a separate DB opened and closed between tests prevented any side effects like that from causing issues.