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
373ef31b
Commit
373ef31b
authored
Jan 29, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0dd84253
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
go/neo/client.go
go/neo/client.go
+5
-7
go/neo/mastered.go
go/neo/mastered.go
+1
-1
No files found.
go/neo/client.go
View file @
373ef31b
...
...
@@ -114,8 +114,6 @@ func NewClient(clusterName, masterAddr string, net xnet.Networker) *Client {
// Run starts client node and runs it until either ctx is canceled or master
// commands it to shutdown. (TODO verify M->shutdown)
func
(
c
*
Client
)
Run
(
ctx
context
.
Context
)
(
err
error
)
{
// defer task.Running(&ctx, "client")(&err)
// run process which performs master talk
ctx
,
cancel
:=
context
.
WithCancel
(
ctx
)
c
.
runCancel
=
cancel
...
...
@@ -137,11 +135,11 @@ func (c *Client) Run(ctx context.Context) (err error) {
return
c
.
recvMaster
(
ctx
)
})
//
init lastTid from
master
//
sync lastTid with
master
// TODO better change protocol for master to send us head via notify
// channel right after identification.
wg
.
Go
(
func
(
ctx
context
.
Context
)
error
{
return
c
.
initFrom
Master
(
ctx
,
mlink
)
return
c
.
sync
Master
(
ctx
,
mlink
)
})
return
wg
.
Wait
()
...
...
@@ -344,9 +342,9 @@ func (c *Client) talkMaster1(ctx context.Context) (err error) {
}
*/
//
initFrom
Master asks M for DB head right after identification.
func
(
c
*
Client
)
initFrom
Master
(
ctx
context
.
Context
,
mlink
*
neonet
.
NodeLink
)
(
err
error
)
{
defer
task
.
Running
(
&
ctx
,
"
init
"
)(
&
err
)
//
sync
Master asks M for DB head right after identification.
func
(
c
*
Client
)
sync
Master
(
ctx
context
.
Context
,
mlink
*
neonet
.
NodeLink
)
(
err
error
)
{
defer
task
.
Running
(
&
ctx
,
"
sync
"
)(
&
err
)
// query last_tid
lastTxn
:=
proto
.
AnswerLastTransaction
{}
...
...
go/neo/mastered.go
View file @
373ef31b
...
...
@@ -244,7 +244,7 @@ func (node *_MasteredNode) talkMaster1(ctx, ctxPreTalkM context.Context, f func(
wg
:=
xsync
.
NewWorkGroup
(
ctx
)
// receive and handle notifications from master
wg
.
Go
(
func
(
ctx
context
.
Context
)
error
{
defer
task
.
Running
(
&
ctx
,
"rx"
)(
&
err
)
defer
task
.
Running
(
&
ctx
,
"rx
prefilter
"
)(
&
err
)
for
{
req
,
err
:=
mlink
.
Recv1
()
if
err
!=
nil
{
...
...
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