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
df1df655
Commit
df1df655
authored
Feb 23, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
1e55d36b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
go/neo/mastered.go
go/neo/mastered.go
+6
-4
No files found.
go/neo/mastered.go
View file @
df1df655
...
@@ -156,7 +156,7 @@ func (node *_MasteredNode) talkMaster1(ctx, ctxPreTalkM context.Context, f func(
...
@@ -156,7 +156,7 @@ func (node *_MasteredNode) talkMaster1(ctx, ctxPreTalkM context.Context, f func(
return
xio
.
WithCloseOnRetCancel
(
ctx
,
mlink
,
func
()
(
err
error
)
{
return
xio
.
WithCloseOnRetCancel
(
ctx
,
mlink
,
func
()
(
err
error
)
{
if
accept
.
YourNID
!=
s
.
MyNID
{
if
accept
.
YourNID
!=
s
.
MyNID
{
log
.
Infof
(
ctx
,
"master %s told us to be %s"
,
accept
.
MyNID
,
accept
.
YourNID
)
log
.
Infof
(
ctx
,
"master %s told us to be %s"
,
accept
.
MyNID
,
accept
.
YourNID
)
node
.
Update
State
(
func
(
s
*
xneo
.
State
)
{
node
.
modify
State
(
func
(
s
*
xneo
.
State
)
{
s
.
MyNID
=
accept
.
YourNID
s
.
MyNID
=
accept
.
YourNID
})
})
}
}
...
@@ -179,7 +179,7 @@ func (node *_MasteredNode) talkMaster1(ctx, ctxPreTalkM context.Context, f func(
...
@@ -179,7 +179,7 @@ func (node *_MasteredNode) talkMaster1(ctx, ctxPreTalkM context.Context, f func(
// partTab (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
var
pt
*
xneo
.
PartitionTable
if
!
(
node
.
Type
==
proto
.
STORAGE
)
{
if
!
(
node
.
Type
==
proto
.
STORAGE
)
{
mpt
:=
proto
.
SendPartitionTable
{}
mpt
:=
proto
.
SendPartitionTable
{}
_
,
err
=
mlink
.
Expect1
(
&
mpt
)
_
,
err
=
mlink
.
Expect1
(
&
mpt
)
...
@@ -193,7 +193,9 @@ func (node *_MasteredNode) talkMaster1(ctx, ctxPreTalkM context.Context, f func(
...
@@ -193,7 +193,9 @@ func (node *_MasteredNode) talkMaster1(ctx, ctxPreTalkM context.Context, f func(
// update cluster state
// update cluster state
node
.
updateState
(
func
(
s
*
xneo
.
State
)
{
node
.
updateState
(
func
(
s
*
xneo
.
State
)
{
err
=
s
.
updateNodeTab
(
ctx
,
&
mnt
)
// the only err is cmdShutdown
err
=
s
.
updateNodeTab
(
ctx
,
&
mnt
)
// the only err is cmdShutdown
if
pt
!=
nil
{
node
.
State
.
PartTab
=
pt
node
.
State
.
PartTab
=
pt
}
if
err
==
nil
{
if
err
==
nil
{
// keep mlink=nil on shutdown so that
// keep mlink=nil on shutdown so that
// .operational does not change to y.
// .operational does not change to y.
...
@@ -309,7 +311,7 @@ func (node *_MasteredNode) recvδstate(ctx context.Context, msg proto.Msg) (δpt
...
@@ -309,7 +311,7 @@ func (node *_MasteredNode) recvδstate(ctx context.Context, msg proto.Msg) (δpt
// updateOperational calls δf under .opMu and updates .operational from current state.
// updateOperational calls δf under .opMu and updates .operational from current state.
// After .opMu unlock it also notifies those who was waiting for .operational to become y.
// After .opMu unlock it also notifies those who was waiting for .operational to become y.
func
(
node
*
_MasteredNode
)
updateOperational
(
δf
func
(
))
{
func
(
node
*
_MasteredNode
)
modifyState
(
δf
func
(
s
*
/*_Mastered*/
State
))
{
var
opready
chan
struct
{}
var
opready
chan
struct
{}
node
.
opMu
.
Lock
()
node
.
opMu
.
Lock
()
...
...
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