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
3d31d3c1
Commit
3d31d3c1
authored
Jun 09, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0e4fc602
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
8 deletions
+25
-8
go/neo/cluster_test.go
go/neo/cluster_test.go
+16
-6
go/neo/connection_test.go
go/neo/connection_test.go
+1
-1
go/neo/nodetab.go
go/neo/nodetab.go
+2
-0
go/neo/server/master.go
go/neo/server/master.go
+6
-1
No files found.
go/neo/cluster_test.go
View file @
3d31d3c1
...
@@ -60,17 +60,27 @@ func TestMasterStorage(t *testing.T) {
...
@@ -60,17 +60,27 @@ func TestMasterStorage(t *testing.T) {
Mctx
,
Mcancel
:=
context
.
WithCancel
(
context
.
Background
())
Mctx
,
Mcancel
:=
context
.
WithCancel
(
context
.
Background
())
Sctx
,
Scancel
:=
context
.
WithCancel
(
context
.
Background
())
Sctx
,
Scancel
:=
context
.
WithCancel
(
context
.
Background
())
_
=
Scancel
;
_
=
Scancel
;
_
=
Mcancel
;
//Mev := M.subscribe(...)
err
:=
M
.
Run
(
Mctx
)
// XXX go
wg
:=
WorkGroup
()
err
=
S
.
Run
(
Sctx
)
// XXX go
wg
.
Gox
(
func
()
{
err
:=
M
.
Run
(
Mctx
)
_
=
err
// XXX
})
//ev <- Mev
//assert ev == ClusterInformation{State: RECOVERY}
// XXX temp
if
false
{
if
err
!=
nil
{
err
:=
S
.
Run
(
Sctx
)
// XXX go
panic
(
err
)
_
=
err
}
}
xwait
(
wg
)
Mcancel
()
// XXX temp
}
}
// basic interaction between Client -- Storage
// basic interaction between Client -- Storage
...
...
go/neo/connection_test.go
View file @
3d31d3c1
...
@@ -173,7 +173,7 @@ func nodeLinkPipe() (nl1, nl2 *NodeLink) {
...
@@ -173,7 +173,7 @@ func nodeLinkPipe() (nl1, nl2 *NodeLink) {
return
_nodeLinkPipe
(
0
,
0
)
return
_nodeLinkPipe
(
0
,
0
)
}
}
// XXX temp for cluster_test.
f
o
// XXX temp for cluster_test.
g
o
var
NodeLinkPipe
=
nodeLinkPipe
var
NodeLinkPipe
=
nodeLinkPipe
func
TestNodeLink
(
t
*
testing
.
T
)
{
func
TestNodeLink
(
t
*
testing
.
T
)
{
...
...
go/neo/nodetab.go
View file @
3d31d3c1
...
@@ -86,6 +86,8 @@ type Node struct {
...
@@ -86,6 +86,8 @@ type Node struct {
Link
*
NodeLink
// link to this node; =nil if not connected XXX do we need it here ?
Link
*
NodeLink
// link to this node; =nil if not connected XXX do we need it here ?
// XXX identified or not ?
// XXX identified or not ?
// XXX -> not needed - we only add something to nodetab after identification
// XXX -> not needed - we only add something to nodetab after identification
// XXX ^^^ is about master. How about e.g. Client that received nodetab
// entry and wants to talk to that node?
}
}
...
...
go/neo/server/master.go
View file @
3d31d3c1
...
@@ -635,7 +635,7 @@ func (m *Master) accept(n nodeCome) (node *neo.Node, ok bool) {
...
@@ -635,7 +635,7 @@ func (m *Master) accept(n nodeCome) (node *neo.Node, ok bool) {
IdTimestamp
:
monotime
(),
IdTimestamp
:
monotime
(),
}
}
node
=
m
.
nodeTab
.
Update
(
nodeInfo
,
n
.
link
)
// NOTE this notifies al nodeTab subscribers
node
=
m
.
nodeTab
.
Update
(
nodeInfo
,
n
.
link
)
// NOTE this notifies al
l
nodeTab subscribers
return
node
,
true
return
node
,
true
}
}
...
@@ -730,6 +730,11 @@ func (m *Master) ServeLink(ctx context.Context, link *neo.NodeLink) {
...
@@ -730,6 +730,11 @@ func (m *Master) ServeLink(ctx context.Context, link *neo.NodeLink) {
logf
(
"identify: accepted"
)
logf
(
"identify: accepted"
)
// XXX on successful identification master should also give us:
// - full snapshots of nodeTab, partTab and clusterState
// - buffered notification channel subscribed to changes of ^^^
// - unsubscribe func XXX needed? -> nodeLeave is enough
// ----------------------------------------
// ----------------------------------------
// XXX recheck vvv
// XXX recheck vvv
...
...
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