Skip to content

Commit

Permalink
Sync from server repo (2818ae277ae)
Browse files Browse the repository at this point in the history
  • Loading branch information
cchen-vertica committed Jul 31, 2024
1 parent 8cb9230 commit 2ad21f1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rfc7807/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,9 @@ var (
"Message queue is full",
http.StatusInternalServerError,
)
FetchDownDatabase = newProblemID(
path.Join(errorEndpointsPrefix, "fetch-down-database"),
"Fetch information from a down database",
http.StatusInternalServerError,
)
)
10 changes: 10 additions & 0 deletions vclusterops/fetch_node_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ type VFetchNodeStateOptions struct {
// operations: NMAHealth and NMA readCatalogEditor. This is useful
// when we cannot get the version for down nodes from a running database
GetVersion bool

SkipDownDatabase bool
}

func VFetchNodeStateOptionsFactory() VFetchNodeStateOptions {
Expand Down Expand Up @@ -82,6 +84,10 @@ func (vcc VClusterCommands) VFetchNodeState(options *VFetchNodeStateOptions) ([]
}
}

if options.SkipDownDatabase {
return []NodeInfo{}, rfc7807.New(rfc7807.FetchDownDatabase)
}

return vcc.fetchNodeStateFromDownDB(options)
}

Expand Down Expand Up @@ -130,6 +136,10 @@ func (vcc VClusterCommands) VFetchNodeState(options *VFetchNodeStateOptions) ([]
}

if upNodeCount == 0 {
if options.SkipDownDatabase {
return []NodeInfo{}, rfc7807.New(rfc7807.FetchDownDatabase)
}

return vcc.fetchNodeStateFromDownDB(options)
}

Expand Down

0 comments on commit 2ad21f1

Please sign in to comment.