[#1974] shard: Do not panic in degraded mode

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
Evgenii Stratonikov 2022-10-26 09:12:09 +03:00 committed by fyrchik
parent 7395ab8ef7
commit 1e6588e761
8 changed files with 56 additions and 4 deletions

View file

@ -92,6 +92,10 @@ func (db *DB) Inhume(prm InhumePrm) (res InhumeRes, err error) {
db.modeMtx.RLock()
defer db.modeMtx.RUnlock()
if db.mode.NoMetabase() {
return InhumeRes{}, ErrDegradedMode
}
currEpoch := db.epochState.CurrentEpoch()
var inhumed uint64