Skip to content

Commit 61f8b88

Browse files
authored
Allow the operator to restart the CC when tester processes are unreachable (#1925)
* Allow the operator to restart the CC when tester processes are unreachable
1 parent 9d6bb7d commit 61f8b88

14 files changed

+5067
-20
lines changed

api/v1beta2/foundationdb_status.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ type FoundationDBStatusMessage struct {
5454
Name string `json:"name,omitempty"`
5555
// Description contains a human friendly description of the message.
5656
Description string `json:"description,omitempty"`
57+
// UnreachableProcesses contains the unreachable processes. This value is only set for unreachable_processes messages.
58+
UnreachableProcesses []FoundationDBUnreachableProcess `json:"unreachable_processes,omitempty"`
59+
}
60+
61+
// FoundationDBUnreachableProcess provides information about an unreachable process
62+
type FoundationDBUnreachableProcess struct {
63+
// Address provides the address of the unreachable process
64+
Address string `json:"address,omitempty"`
5765
}
5866

5967
// FoundationDBStatusCoordinatorInfo contains information about the client's

api/v1beta2/foundationdb_status_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,4 +923,21 @@ var _ = Describe("FoundationDBStatus", func() {
923923
Expect(statusParsed.Cluster).To(Equal(status))
924924
})
925925
})
926+
927+
When("parsing a machine-readable status that contains the unreachable processes message", func() {
928+
It("should parse the cluster messages correct", func() {
929+
statusFile, err := os.OpenFile(filepath.Join("testdata", "unreachable_test_processes.json"), os.O_RDONLY, os.ModePerm)
930+
Expect(err).NotTo(HaveOccurred())
931+
defer statusFile.Close()
932+
statusDecoder := json.NewDecoder(statusFile)
933+
statusParsed := FoundationDBStatus{}
934+
Expect(statusDecoder.Decode(&statusParsed)).NotTo(HaveOccurred())
935+
Expect(statusParsed.Cluster.Messages).To(HaveLen(2))
936+
Expect(statusParsed.Cluster.Messages[0].UnreachableProcesses).To(HaveLen(1))
937+
Expect(statusParsed.Cluster.Messages[0].Name).To(Equal("unreachable_processes"))
938+
Expect(statusParsed.Cluster.Messages[0].UnreachableProcesses[0].Address).To(Equal("100.82.115.41:4500:tls"))
939+
Expect(statusParsed.Cluster.Messages[1].UnreachableProcesses).To(HaveLen(0))
940+
Expect(statusParsed.Cluster.Messages[1].Name).To(Equal("status_incomplete"))
941+
})
942+
})
926943
})

0 commit comments

Comments
 (0)