Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
c354a136
Commit
c354a136
authored
Sep 01, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
7930f2f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
13 deletions
+11
-13
go/neo/client/client.go
go/neo/client/client.go
+6
-7
go/neo/neo.go
go/neo/neo.go
+5
-0
go/neo/server/storage.go
go/neo/server/storage.go
+0
-6
No files found.
go/neo/client/client.go
View file @
c354a136
...
...
@@ -180,19 +180,18 @@ func (c *Client) talkMaster(ctx context.Context) (err error) {
}
func
(
c
*
Client
)
talkMaster1
(
ctx
context
.
Context
)
(
err
error
)
{
// XXX dup from Server.talkMaster1
// XXX put logging into Dial?
log
.
Info
(
ctx
,
"connecting ..."
)
// XXX dup from Server.talkMaster1 ?
mlink
,
accept
,
err
:=
c
.
node
.
Dial
(
ctx
,
neo
.
MASTER
,
c
.
node
.
MasterAddr
)
if
err
!=
nil
{
// FIXME it is not only identification - e.g. ECONNREFUSED
log
.
Info
(
ctx
,
"identification rejected"
)
// XXX ok here? (err is logged above)
return
err
}
_
=
accept
// XXX
log
.
Info
(
ctx
,
"identification accepted"
)
// XXX -> node.Dial ?
if
accept
.
YourUUID
!=
c
.
node
.
MyInfo
.
UUID
{
log
.
Infof
(
ctx
,
"master told us to have uuid=%v"
,
accept
.
YourUUID
)
c
.
node
.
MyInfo
.
UUID
=
accept
.
YourUUID
}
// set c.mlink and notify waiters
c
.
mlinkMu
.
Lock
()
...
...
go/neo/neo.go
View file @
c354a136
...
...
@@ -35,6 +35,8 @@ import (
"lab.nexedi.com/kirr/go123/xerr"
"lab.nexedi.com/kirr/neo/go/xcommon/log"
"lab.nexedi.com/kirr/neo/go/xcommon/task"
//"lab.nexedi.com/kirr/neo/go/xcommon/xio"
"lab.nexedi.com/kirr/neo/go/xcommon/xnet"
"lab.nexedi.com/kirr/neo/go/zodb"
...
...
@@ -100,6 +102,8 @@ func NewNodeApp(net xnet.Networker, typ NodeType, clusterName, masterAddr, serve
// Dial does not update .NodeTab or its node entries in any way.
// For establishing links to peers present in .NodeTab use Node.Dial.
func
(
app
*
NodeApp
)
Dial
(
ctx
context
.
Context
,
peerType
NodeType
,
addr
string
)
(
_
*
NodeLink
,
_
*
AcceptIdentification
,
err
error
)
{
defer
task
.
Runningf
(
&
ctx
,
"dial %v (%v)"
,
addr
,
peerType
)(
&
err
)
link
,
err
:=
DialLink
(
ctx
,
app
.
Net
,
addr
)
if
err
!=
nil
{
return
nil
,
nil
,
err
...
...
@@ -152,6 +156,7 @@ func (app *NodeApp) Dial(ctx context.Context, peerType NodeType, addr string) (_
// XXX accept.YourUUID // XXX M can tell us to change UUID -> take in effect
// XXX accept.NumPartitions, ... wrt app.node.PartTab
log
.
Info
(
ctx
,
"identification accepted"
)
return
link
,
accept
,
nil
}
...
...
go/neo/server/storage.go
View file @
c354a136
...
...
@@ -157,17 +157,11 @@ func (stor *Storage) talkMaster(ctx context.Context) (err error) {
// it returns error describing why such cycle had to finish
// XXX distinguish between temporary problems and non-temporary ones?
func
(
stor
*
Storage
)
talkMaster1
(
ctx
context
.
Context
)
(
err
error
)
{
// XXX dup in Client.talkMaster1
// XXX put logging into Dial?
log
.
Info
(
ctx
,
"connecting ..."
)
mlink
,
accept
,
err
:=
stor
.
node
.
Dial
(
ctx
,
neo
.
MASTER
,
stor
.
node
.
MasterAddr
)
if
err
!=
nil
{
// FIXME it is not only identification - e.g. ECONNREFUSED
log
.
Info
(
ctx
,
"identification rejected"
)
// XXX ok here? (err is logged above)
return
err
}
log
.
Info
(
ctx
,
"identification accepted"
)
defer
xio
.
CloseWhenDone
(
ctx
,
mlink
)()
// XXX add master UUID -> nodeTab ? or master will notify us with it himself ?
...
...
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