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
547418f2
Commit
547418f2
authored
Aug 11, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b8deac3d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
go/neo/server/master.go
go/neo/server/master.go
+1
-1
go/neo/server/storage.go
go/neo/server/storage.go
+5
-2
No files found.
go/neo/server/master.go
View file @
547418f2
...
@@ -410,7 +410,7 @@ func storCtlRecovery(ctx context.Context, stor *neo.Node, res chan storRecovery)
...
@@ -410,7 +410,7 @@ func storCtlRecovery(ctx context.Context, stor *neo.Node, res chan storRecovery)
// on error provide feedback to storRecovery chan
// on error provide feedback to storRecovery chan
res
<-
storRecovery
{
stor
:
stor
,
err
:
err
}
res
<-
storRecovery
{
stor
:
stor
,
err
:
err
}
}()
}()
defer
runningf
(
&
ctx
,
"%s: stor recovery"
,
stor
.
Link
)(
&
err
)
defer
runningf
(
&
ctx
,
"%s: stor recovery"
,
stor
.
Link
.
RemoteAddr
()
)(
&
err
)
conn
,
err
:=
stor
.
Link
.
NewConn
()
conn
,
err
:=
stor
.
Link
.
NewConn
()
if
err
!=
nil
{
if
err
!=
nil
{
...
...
go/neo/server/storage.go
View file @
547418f2
...
@@ -146,7 +146,6 @@ func (stor *Storage) talkMaster(ctx context.Context) (err error) {
...
@@ -146,7 +146,6 @@ func (stor *Storage) talkMaster(ctx context.Context) (err error) {
defer
runningf
(
&
ctx
,
"talk master(%v)"
,
stor
.
node
.
MasterAddr
)(
&
err
)
defer
runningf
(
&
ctx
,
"talk master(%v)"
,
stor
.
node
.
MasterAddr
)(
&
err
)
for
{
for
{
log
.
Info
(
ctx
,
"connecting ..."
)
err
:=
stor
.
talkMaster1
(
ctx
)
err
:=
stor
.
talkMaster1
(
ctx
)
log
.
Error
(
ctx
,
err
)
log
.
Error
(
ctx
,
err
)
...
@@ -168,11 +167,15 @@ func (stor *Storage) talkMaster(ctx context.Context) (err error) {
...
@@ -168,11 +167,15 @@ func (stor *Storage) talkMaster(ctx context.Context) (err error) {
// it returns error describing why such cycle had to finish
// it returns error describing why such cycle had to finish
// XXX distinguish between temporary problems and non-temporary ones?
// XXX distinguish between temporary problems and non-temporary ones?
func
(
stor
*
Storage
)
talkMaster1
(
ctx
context
.
Context
)
(
err
error
)
{
func
(
stor
*
Storage
)
talkMaster1
(
ctx
context
.
Context
)
(
err
error
)
{
// XXX put logging into Dial?
log
.
Info
(
ctx
,
"connecting ..."
)
Mconn
,
accept
,
err
:=
stor
.
node
.
Dial
(
ctx
,
neo
.
MASTER
,
stor
.
node
.
MasterAddr
)
Mconn
,
accept
,
err
:=
stor
.
node
.
Dial
(
ctx
,
neo
.
MASTER
,
stor
.
node
.
MasterAddr
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Info
(
ctx
,
"rejected"
)
// XXX ok here? (err is logged above)
return
err
return
err
}
}
log
.
Info
(
ctx
,
"accepted"
)
Mlink
:=
Mconn
.
Link
()
Mlink
:=
Mconn
.
Link
()
// close Mlink on return / cancel
// close Mlink on return / cancel
...
@@ -189,7 +192,7 @@ func (stor *Storage) talkMaster1(ctx context.Context) (err error) {
...
@@ -189,7 +192,7 @@ func (stor *Storage) talkMaster1(ctx context.Context) (err error) {
// XXX -> node.Dial ?
// XXX -> node.Dial ?
if
accept
.
YourNodeUUID
!=
stor
.
node
.
MyInfo
.
NodeUUID
{
if
accept
.
YourNodeUUID
!=
stor
.
node
.
MyInfo
.
NodeUUID
{
log
.
Infof
(
ctx
,
"
%v: master told us to have UUID=%v"
,
Mlink
,
accept
.
YourNodeUUID
)
log
.
Infof
(
ctx
,
"
master told us to have UUID=%v"
,
accept
.
YourNodeUUID
)
stor
.
node
.
MyInfo
.
NodeUUID
=
accept
.
YourNodeUUID
stor
.
node
.
MyInfo
.
NodeUUID
=
accept
.
YourNodeUUID
}
}
...
...
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