You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The badger blockstore has a state field to record whether or not the badger database is closed. Unfortunately, either:
There's no way the blockstore will be closed concurrently with other operations. In this case, there's no need for the field to be atomic.
The blockstore can be concurrently closed with other operations. In this case, the atomic is insufficient as we may:
Thread A: See that the database is open.
Thread B: Close the database.
Thread A: Use the database. Badger likes to panic in this case.
Unless we have a really good reason not to, we should just use a RWMutex (like we do in go-ds-badger). If we do have a really good reason, we should figure out what we actually need here.
The text was updated successfully, but these errors were encountered:
Hello,i want to check with you guys whether we have a fix of this concurrent blockstore writing problem, i think our lotus client met this problem when we synced data, like below:
2023-04-09T06:56:58.022+0800 ERROR chainstore store/coalescer.go:213 error dispatching coalesced head change notification: 5 errors occurred:
* failed to get messages for apply block bafy2bzaceao7v562xmw3bwott6mol4tkyl64zgk7ebgqqzfjiaeoogovgfq6o(height 2756273) (msgroot = bafy2bzaceckjcg2a6pkxrd4imr4f4tlglze7stuxgeqi7h3sdhgu3xxj3d6hi): loading bls messages for block: failed to get message: (bafy2bzacecbux57urk4ee27u7qmz4a4cvbmq565ivdecposjy7q62r2x7gdxs):0: badger blockstore closed
* failed to get messages for apply block bafy2bzaced6ikf7j265zwshfcgyrcg3xcfdlgzxedk7ctwhvp7ahx5sqp5yda(height 2756273) (msgroot = bafy2bzacedpinp5puthe6ni52oigpwl6rd5s6ma4xq7626do4imx7d7dqfbly): loading bls messages for block: failed to get message: (bafy2bzacecbux57urk4ee27u7qmz4a4cvbmq565ivdecposjy7q62r2x7gdxs):0: badger blockstore closed
* failed to get messages for apply block bafy2bzacedmlgxxpkjlvpaoaieqrfspluzoxgacsplv3z6opr5s3v23c2haty(height 2756273) (msgroot = bafy2bzacebh4ztqxyemqualqk23zppjp6h5zptkzm7ipir3kvvmw7boiaxsxu): loading bls messages for block: failed to get message: (bafy2bzacecbux57urk4ee27u7qmz4a4cvbmq565ivdecposjy7q62r2x7gdxs):0: badger blockstore closed
* failed to get messages for apply block bafy2bzacediznucqqmb6o3lizk5tia27hwa5zvdeggnv7w5lwlsgfj4tl2abk(height 2756273) (msgroot = bafy2bzaceaccq5t7zzy5wqeddgfrdkshf45yvsndonkc7n2jhcrrnsa7iezkw): loading bls messages for block: failed to get message: (bafy2bzacea4jakq4s5v4iaqlrvvp5rxmnd6bt2v5lrjmm76jy5dblwmlcezv2):0: badger blockstore closed
* failed to get messages for apply block bafy2bzacecjpu5cb3iocwmvd3r44r3jihzotd67f4gnrjyhvkkzbtilvkzseo(height 2756273) (msgroot = bafy2bzacebo6ujqxnrorakn5g6hiag6mdpgbjhe2mbqv323gs7re632hznsou): loading bls messages for block: failed to get message: (bafy2bzaceakgbe3o6in3sqzqoxikza3ylgixkii5o3ws47y4ktpbmlb6b6g7s):0: badger blockstore closed
The badger blockstore has a
state
field to record whether or not the badger database is closed. Unfortunately, either:Unless we have a really good reason not to, we should just use a RWMutex (like we do in go-ds-badger). If we do have a really good reason, we should figure out what we actually need here.
The text was updated successfully, but these errors were encountered: