node: Set mode to shard's components when open it #967
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#967
Loading…
Reference in a new issue
No description provided.
Delete branch "acid-ant/frostfs-node:bugfix/959-init-with-mode"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Close #959
Avoid opening database for
metabase
andcache
inDegraded
mode.Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com
@ -267,6 +271,7 @@ func TestConcurrentDelete(t *testing.T) {
const smallSizeLimit = 512
blobStor := New(
mode.ReadWrite,
It is necessary to put this in
New()
? It doesn't accepts such things by design, becausethey are provided in
Open
(wherero bool
parameter can be replaced withm mode.Mode
I guess)No, it is not necessary. But in this case, we need to store
mode
insideOpen
, except whenOpen
executed fromSetMode
.Updated, now
mode
propagated viaOpen
.@ -36,6 +37,7 @@ func init() {
func openMeta(cmd *cobra.Command) *meta.DB {
db := meta.New(
mode.ReadWrite,
Here metabase must be open read-only, see lines below.
Another reason to provide mode in
Open
-- this avoids duplication and inconsistence.Thanks, fixed.
e5dd857474
to5164ec6f67
node: Set mode to shard's components when createdto node: Set mode to shard's components when open it@ -38,2 +36,2 @@
} else {
metabaseOpened = true
m := s.GetMode()
if !m.NoMetabase() {
No when the mode is provided to Open(), do we still need this if? It seems metabase knows to do nothing in Degraded mode.
Thanks, simplified this part.
Some unit test required
5164ec6f67
to29812f6683
Thanks, added.