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
edb2fec5
Commit
edb2fec5
authored
Feb 18, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
22a44b94
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
14 deletions
+15
-14
go/neo/master.go
go/neo/master.go
+11
-10
go/neo/storage.go
go/neo/storage.go
+4
-4
No files found.
go/neo/master.go
View file @
edb2fec5
...
...
@@ -22,7 +22,8 @@ package neo
// Master organization
//
// Master is organized as follows:
// Master is the node tha oversees how whole cluster works, ... XXX
// It is organized as follows:
//
// - main task that controls whole logic of master working. It spawns
// subtasks to implement that logic and communicate with the subtask via channels. XXX
...
...
@@ -46,7 +47,7 @@ import (
"fmt"
"time"
xxcontext
"lab.nexedi.com/kirr/go123/xcontext"
"lab.nexedi.com/kirr/go123/xcontext"
"lab.nexedi.com/kirr/go123/xnet"
"lab.nexedi.com/kirr/go123/xsync"
...
...
@@ -57,7 +58,7 @@ import (
"lab.nexedi.com/kirr/neo/go/zodb"
"lab.nexedi.com/kirr/neo/go/internal/log"
"lab.nexedi.com/kirr/neo/go/internal/task"
"lab.nexedi.com/kirr/neo/go/internal/xcontext"
xxcontext
"lab.nexedi.com/kirr/neo/go/internal/xcontext"
"lab.nexedi.com/kirr/neo/go/internal/xio"
)
...
...
@@ -258,7 +259,7 @@ func (m *Master) Run(ctx context.Context, l xnet.Listener) (err error) {
req
,
idReq
,
err
:=
lli
.
Accept
(
ctx
)
if
err
!=
nil
{
if
!
xcontext
.
Canceled
(
err
)
{
if
!
x
x
context
.
Canceled
(
err
)
{
log
.
Error
(
ctx
,
err
)
// XXX throttle?
}
continue
...
...
@@ -449,7 +450,7 @@ func (m *Master) recovery(ctx context.Context) (err error) {
goStorCtlRecovery
:=
func
(
stor
*
_MasteredPeer
)
{
inprogress
++
stor
.
wg
.
Go
(
func
(
peerCtx
context
.
Context
)
error
{
ctx
,
cancel
:=
x
x
context
.
Merge
/*Cancel*/
(
ctx
,
peerCtx
)
ctx
,
cancel
:=
xcontext
.
Merge
/*Cancel*/
(
ctx
,
peerCtx
)
defer
cancel
()
var
pt
*
xneo
.
PartitionTable
...
...
@@ -464,7 +465,7 @@ func (m *Master) recovery(ctx context.Context) (err error) {
<-
ack
// canceled recovery does not mean we should down the storage node
if
xcontext
.
Canceled
(
err
)
{
if
x
x
context
.
Canceled
(
err
)
{
err
=
nil
}
return
err
...
...
@@ -675,7 +676,7 @@ func (m *Master) verify(ctx context.Context) (err error) {
<-
ack
// canceled verify does not mean we should down the storage node
if
xcontext
.
Canceled
(
err
)
{
if
x
x
context
.
Canceled
(
err
)
{
err
=
nil
}
return
err
...
...
@@ -866,7 +867,7 @@ func (m *Master) serve(ctx context.Context) (err error) {
goServe
:=
func
(
peer
*
_MasteredPeer
)
{
inprogress
++
peer
.
wg
.
Go
(
func
(
peerCtx
context
.
Context
)
error
{
ctx
,
cancel
:=
x
x
context
.
Merge
/*Cancel*/
(
ctx
,
peerCtx
)
ctx
,
cancel
:=
xcontext
.
Merge
/*Cancel*/
(
ctx
,
peerCtx
)
defer
cancel
()
switch
peer
.
node
.
Type
{
...
...
@@ -884,7 +885,7 @@ func (m *Master) serve(ctx context.Context) (err error) {
<-
ack
// canceled serve does not necessarily mean we should down the peer
if
xcontext
.
Canceled
(
err
)
{
if
x
x
context
.
Canceled
(
err
)
{
err
=
nil
}
return
err
...
...
@@ -1293,7 +1294,7 @@ func (p *_MasteredPeer) notify(ctx context.Context) (err error) {
stateCode
:=
p
.
state0
.
Code
// XXX vvv right?
return
xcontext
.
WithCloseOnErrCancel
(
ctx
,
p
.
node
.
Link
(),
func
()
error
{
return
x
x
context
.
WithCloseOnErrCancel
(
ctx
,
p
.
node
.
Link
(),
func
()
error
{
for
{
var
δstate
_ΔClusterState
...
...
go/neo/storage.go
View file @
edb2fec5
...
...
@@ -27,6 +27,10 @@ import (
"github.com/pkg/errors"
"lab.nexedi.com/kirr/go123/xcontext"
"lab.nexedi.com/kirr/go123/xerr"
"lab.nexedi.com/kirr/go123/xnet"
"lab.nexedi.com/kirr/neo/go/neo/neonet"
"lab.nexedi.com/kirr/neo/go/neo/proto"
"lab.nexedi.com/kirr/neo/go/neo/storage"
...
...
@@ -38,10 +42,6 @@ import (
taskctx
"lab.nexedi.com/kirr/neo/go/internal/xcontext/task"
"lab.nexedi.com/kirr/neo/go/internal/xio"
"lab.nexedi.com/kirr/neo/go/internal/xzodb"
"lab.nexedi.com/kirr/go123/xcontext"
"lab.nexedi.com/kirr/go123/xerr"
"lab.nexedi.com/kirr/go123/xnet"
)
// Storage is NEO node that keeps data and provides read/write access to it via network.
...
...
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