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
31f4e061
Commit
31f4e061
authored
3 years ago
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b84a150b
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
go/neo/master.go
go/neo/master.go
+17
-9
No files found.
go/neo/master.go
View file @
31f4e061
...
...
@@ -418,8 +418,9 @@ func (m *Master) recovery(ctx context.Context) (err error) {
// goStorCtlRecovery spawns recovery task on a storage peer.
goStorCtlRecovery
:=
func
(
stor
*
_MasteredPeer
)
{
inprogress
++
// XXX wg.Add(1) + defer wg.Done() ?
wg
.
Add
(
1
)
stor
.
wg
.
Go
(
func
(
peerCtx
context
.
Context
)
error
{
defer
wg
.
Done
()
ctx
,
cancel
:=
xxcontext
.
Merge
/*Cancel*/
(
ctx
,
peerCtx
)
defer
cancel
()
...
...
@@ -655,20 +656,27 @@ func (m *Master) verify(ctx context.Context) (err error) {
// NOTE we don't reset m.lastOid / m.lastTid to 0 in the beginning of verification
// XXX (= py), rationale=?
// goStorCtlVerify spawns verify task on a storage peer.
goStorCtlVerify
:=
func
(
stor
*
_MasteredPeer
)
{
// XXX rework
inprogress
++
wg
.
Add
(
1
)
go
func
()
{
stor
.
wg
.
Go
(
func
(
peerCtx
context
.
Context
)
error
{
defer
wg
.
Done
()
err
:=
m
.
accept
(
node
,
state0
,
n
.
req
,
resp
)
if
err
!=
nil
{
verifyq
<-
storVerify
{
stor
:
node
,
err
:
err
}
return
}
var
...
err
:=
stor
.
run
(
ctx
,
func
()
error
{
...
=
storCtlVerify
(
ctx
,
stor
,
m
.
node
.
State
.
PartTab
)
})
ack
:=
make
(
chan
struct
{})
verifyq
<-
storVerify
{
stor
:
stor
,
...
}
<-
ack
storCtlVerify
(
ctx
,
node
,
m
.
node
.
State
.
PartTab
,
verifyq
)
// canceled verify does not mean we should down the storage node
if
xcontext
.
Canceled
(
err
)
{
err
=
nil
}
return
err
}()
}
...
...
This diff is collapsed.
Click to expand it.
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