Add object nodes command #456
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
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#456
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:feature/object-nodes"
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?
Closes #426
Added command to list nodes where the object should be stored and where it is actually stored.
Output example:
@ -0,0 +44,4 @@
var objectNodesCmd = &cobra.Command{
Use: "nodes",
Short: "List of nodes where the object is stored",
Long: `List of nodes where the object should be stored and where it is actually stored.
Command description
@ -0,0 +149,4 @@
netmap, e = getNetMap(egCtx, cli)
return
})
if err := eg.Wait(); err != nil {
Just:
:)
fixed
@ -0,0 +338,4 @@
}
func printPlacement(cmd *cobra.Command, netmap *netmapSDK.NetMap, requiredPlacement map[uint64]netmapSDK.NodeInfo, actualPlacement map[uint64]boolError) {
w := tabwriter.NewWriter(cmd.OutOrStdout(), 0, 0, 1, ' ', tabwriter.AlignRight|tabwriter.Debug)
Nice! Using
tabwriter
is really good practice 👍@ -0,0 +341,4 @@
w := tabwriter.NewWriter(cmd.OutOrStdout(), 0, 0, 1, ' ', tabwriter.AlignRight|tabwriter.Debug)
defer func() {
err := w.Flush()
if err != nil {
The same: we can avoid
err != nil
check if we useExitOnErr
:)fixed
a7239f748a
tod6d191c9c9
@ -0,0 +306,4 @@
}
if cli == nil {
return nil, fmt.Errorf("failed to create client: no available endpoint")
}
How come? Can be
cli
isnil
iflastErr == nil
?fmt.Errorf("failed to create client: no available endpoint")
looks unexpectedly...It could happen if
len(addresses) == 0
. Just fool-proof.Got it, you're right
@ -0,0 +45,4 @@
Use: "nodes",
Short: "List of nodes where the object is stored",
Long: `List of nodes where the object should be stored and where it is actually stored.
Lock objects must exist on all nodes of the container.
There will be a space in the
frostfs-cli
output, is this intentional?I didn't understand what space you were talking about.
@ -0,0 +199,4 @@
for _, relatedObjID := range objInfo.relatedObjectIDs {
placement, err = placementBuilder.BuildPlacement(objInfo.containerID, &relatedObjID, placementPolicy)
if err != nil {
Do we need this check?
Why not?
Because
ExitOnErr
already checks the error?Oh, i see, fixed
@ -0,0 +220,4 @@
var candidates []netmapSDK.NodeInfo
checkAllNodes, _ := cmd.Flags().GetBool(verifyPresenceAllFlag)
if checkAllNodes {
candidates = append(candidates, netmap.Nodes()...)
Why
append
and not just replace. Will we have duplicates?fixed
d6d191c9c9
to54dfa153c6
54dfa153c6
to9d90af801c
9d90af801c
toe0ed3825a2