Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
39dd4c4d
Commit
39dd4c4d
authored
Feb 03, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
329fc53c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
30 deletions
+10
-30
go/neo/mastered.go
go/neo/mastered.go
+10
-30
No files found.
go/neo/mastered.go
View file @
39dd4c4d
...
@@ -64,11 +64,6 @@ import (
...
@@ -64,11 +64,6 @@ import (
type
_MasteredNode
struct
{
type
_MasteredNode
struct
{
*
xneo
.
Node
*
xneo
.
Node
// myInfo proto.NodeInfo // type, laddr, nid, state, idtime
// ClusterName string
// Net xnet.Networker // network AP we are sending/receiving on
// MasterAddr string // address of current master TODO -> masterRegistry
// operational state is maintained by TalkMaster.
// operational state is maintained by TalkMaster.
// users retrieve it via WithOperational().
// users retrieve it via WithOperational().
//
//
...
@@ -117,24 +112,6 @@ const (
...
@@ -117,24 +112,6 @@ const (
func
newMasteredNode
(
typ
proto
.
NodeType
,
clusterName
string
,
net
xnet
.
Networker
,
masterAddr
string
)
*
_MasteredNode
{
func
newMasteredNode
(
typ
proto
.
NodeType
,
clusterName
string
,
net
xnet
.
Networker
,
masterAddr
string
)
*
_MasteredNode
{
node
:=
&
_MasteredNode
{
node
:=
&
_MasteredNode
{
Node
:
xneo
.
NewNode
(
typ
,
clusterName
,
net
,
masterAddr
),
Node
:
xneo
.
NewNode
(
typ
,
clusterName
,
net
,
masterAddr
),
/*
myInfo: proto.NodeInfo{
Type: typ,
Addr: proto.Address{},
NID: 0,
IdTime: proto.IdTimeNone,
},
ClusterName: clusterName,
Net: net,
MasterAddr: masterAddr,
state: xneo.ClusterState{
NodeTab: &xneo.NodeTable{},
PartTab: &xneo.PartitionTable{},
Code: -1, // invalid
},
*/
opReady
:
make
(
chan
struct
{}),
opReady
:
make
(
chan
struct
{}),
}
}
...
@@ -230,15 +207,18 @@ func (node *_MasteredNode) talkMaster1(ctx, ctxPreTalkM context.Context, f func(
...
@@ -230,15 +207,18 @@ func (node *_MasteredNode) talkMaster1(ctx, ctxPreTalkM context.Context, f func(
return
fmt
.
Errorf
(
"after identification: %w"
,
err
)
return
fmt
.
Errorf
(
"after identification: %w"
,
err
)
}
}
// partTab
XXX not to S and secondary M?
// partTab
(not to S and secondary M(?))
// https://lab.nexedi.com/nexedi/neoppod/blob/v1.12-69-gd98205d0/neo/master/handlers/__init__.py#L60-67
// https://lab.nexedi.com/nexedi/neoppod/blob/v1.12-69-gd98205d0/neo/master/handlers/__init__.py#L60-67
pt
:=
node
.
State
.
PartTab
if
!
(
node
.
MyInfo
.
Type
==
proto
.
STORAGE
)
{
// XXX -> use flag instead?
mpt
:=
proto
.
SendPartitionTable
{}
mpt
:=
proto
.
SendPartitionTable
{}
_
,
err
=
mlink
.
Expect1
(
&
mpt
)
_
,
err
=
mlink
.
Expect1
(
&
mpt
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"after identification: %w"
,
err
)
return
fmt
.
Errorf
(
"after identification: %w"
,
err
)
}
}
pt
:
=
xneo
.
PartTabFromDump
(
mpt
.
PTid
,
mpt
.
RowList
)
// TODO handle mpt.NumReplicas
pt
=
xneo
.
PartTabFromDump
(
mpt
.
PTid
,
mpt
.
RowList
)
// TODO handle mpt.NumReplicas
log
.
Infof
(
ctx
,
"<- parttab:
\n
%s"
,
pt
)
log
.
Infof
(
ctx
,
"<- parttab:
\n
%s"
,
pt
)
}
// update cluster state
// update cluster state
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment