Commit 9bd894f0 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent e0fff1ea
...@@ -49,22 +49,19 @@ func TestMasterStorage(t *testing.T) { ...@@ -49,22 +49,19 @@ func TestMasterStorage(t *testing.T) {
func tracetestMasterStorage(t0 *tracetest.T) { func tracetestMasterStorage(t0 *tracetest.T) {
X := exc.Raiseif X := exc.Raiseif
zstor := xfs1stor("../zodb/storage/fs1/testdata/1.fs")
zback := xfs1back("../zodb/storage/fs1/testdata/1.fs") zback := xfs1back("../zodb/storage/fs1/testdata/1.fs")
zstor := xfs1stor("../zodb/storage/fs1/testdata/1.fs")
lastTid, err := zstor.Sync(bg); X(err)
// create the cluster
t := tNewCluster_MS(t0, "abc1", zback) t := tNewCluster_MS(t0, "abc1", zback)
defer t.Stop() defer t.Stop()
M := t.Master("m")
C := t.NewClient("c", "m:1") C := t.NewClient("c", "m:1")
lastTid, err := zstor.Sync(bg); X(err)
tM := t.Checker("m") tM := t.Checker("m")
// tS := t.Checker("s")
tC := t.Checker("c") tC := t.Checker("c")
tMS := t.Checker("m-s") tMS := t.Checker("m-s")
// tSM := t.Checker("s-m")
tCM := t.Checker("c-m") tCM := t.Checker("c-m")
tMC := t.Checker("m-c") tMC := t.Checker("m-c")
tCS := t.Checker("c-s") tCS := t.Checker("c-s")
...@@ -74,64 +71,8 @@ func tracetestMasterStorage(t0 *tracetest.T) { ...@@ -74,64 +71,8 @@ func tracetestMasterStorage(t0 *tracetest.T) {
// TODO create C; C tries connect to master - rejected ("not yet operational") // TODO create C; C tries connect to master - rejected ("not yet operational")
// TODO test ID rejects (uuid already registered, ...) // TODO test ID rejects (uuid already registered, ...)
// XXX convert prologue to tNewCluster_MS
/*
// M starts listening
tM.Expect(netlisten("m:1"))
tM.Expect(δnode("m", "m:1", proto.MASTER, 1, proto.RUNNING, proto.IdTimeNone))
tM.Expect(clusterState("m", proto.ClusterRecovering))
// S starts listening
tS.Expect(netlisten("s:1"))
// S connects M
tSM.Expect(netdial("s", "m:1"))
tSM.Expect(netconnect("s:2", "m:2", "m:1"))
tSM.Expect(conntx("s:2", "m:2", 1, &proto.RequestIdentification{
NodeType: proto.STORAGE,
UUID: 0,
Address: xnaddr("s:1"),
ClusterName: "abc1",
IdTime: proto.IdTimeNone,
DevPath: nil,
NewNID: nil,
}))
tM.Expect(δnode("m", "s:1", proto.STORAGE, 1, proto.PENDING, 0.01))
tSM.Expect(conntx("m:2", "s:2", 1, &proto.AcceptIdentification{
NodeType: proto.MASTER,
MyUUID: proto.UUID(proto.MASTER, 1),
YourUUID: proto.UUID(proto.STORAGE, 1),
}))
// M starts recovery on S
tMS.Expect(conntx("m:2", "s:2", 0, &proto.Recovery{}))
tMS.Expect(conntx("s:2", "m:2", 0, &proto.AnswerRecovery{
// empty new node
PTid: 0,
BackupTid: proto.INVALID_TID,
TruncateTid: proto.INVALID_TID,
}))
tMS.Expect(conntx("m:2", "s:2", 2, &proto.AskPartitionTable{}))
tMS.Expect(conntx("s:2", "m:2", 2, &proto.AnswerPartitionTable{
PTid: 0,
NumReplicas: 0,
RowList: []proto.RowInfo{},
}))
// M ready to start: new cluster, no in-progress S recovery
tM.Expect(masterStartReady("m", true))
// ----------------------------------------
*/
// M <- start cmd // M <- start cmd
M := t.Master("m")
wg := xsync.NewWorkGroup(bg) wg := xsync.NewWorkGroup(bg)
gox(wg, func(ctx context.Context) { gox(wg, func(ctx context.Context) {
err := M.Start(); X(err) err := M.Start(); X(err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment