From 21c58c92a9a83f1d7d5ce7ef2d877d473289d934 Mon Sep 17 00:00:00 2001
From: Pavel Karpy
Date: Wed, 14 Dec 2022 20:23:31 +0300
Subject: [PATCH] [#2145] meta: Do allow force inhuming a locked object
Signed-off-by: Pavel Karpy
---
CHANGELOG.md | 1 +
pkg/local_object_storage/metabase/inhume.go | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d38dc4d9f0..d28c64dfe9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -58,6 +58,7 @@ Changelog for NeoFS Node
- Spawning useless `GETRANGE` with zero length for a big object (#2101)
- Incomplete object put errors do contain the deepest error's message (#2092)
- Prioritize internal addresses for clients (#2156)
+- Force object removal via control service (#2145)
### Removed
- `-g` option from `neofs-cli control ...` and `neofs-cli container create` commands (#2089)
diff --git a/pkg/local_object_storage/metabase/inhume.go b/pkg/local_object_storage/metabase/inhume.go
index f0317a8129..cff88f4fd7 100644
--- a/pkg/local_object_storage/metabase/inhume.go
+++ b/pkg/local_object_storage/metabase/inhume.go
@@ -144,7 +144,7 @@ func (db *DB) Inhume(prm InhumePrm) (res InhumeRes, err error) {
cnr := prm.target[i].Container()
// prevent locked objects to be inhumed
- if objectLocked(tx, cnr, id) {
+ if !prm.forceRemoval && objectLocked(tx, cnr, id) {
return apistatus.ObjectLocked{}
}