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
6baa7257
Commit
6baa7257
authored
Feb 19, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
5954b705
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
go/neo/storage.go
go/neo/storage.go
+9
-9
No files found.
go/neo/storage.go
View file @
6baa7257
...
...
@@ -78,6 +78,11 @@ func (stor *Storage) Run(ctx context.Context, l xnet.Listener) (err error) {
log
.
Infof
(
ctx
,
"%s: listening on %s ..."
,
stor
.
node
.
MyInfo
.
NID
,
addr
)
stor
.
runCtx
=
ctx
defer
func
()
{
__
:=
stor
.
back
.
Close
()
err
=
xerr
.
First
(
err
,
__
)
}()
// update our serving address in node
naddr
,
err
:=
proto
.
Addr
(
addr
)
if
err
!=
nil
{
...
...
@@ -85,21 +90,16 @@ func (stor *Storage) Run(ctx context.Context, l xnet.Listener) (err error) {
}
stor
.
node
.
MyInfo
.
Addr
=
naddr
// wrap listener with link / identificaton hello checker
// wrap listener with link / identificat
i
on hello checker
stor
.
lli
=
xneo
.
NewListener
(
neonet
.
NewLinkListener
(
l
))
defer
func
()
{
__
:=
stor
.
lli
.
Close
()
err
=
xerr
.
First
(
err
,
__
)
}()
defer
func
()
{
__
:=
stor
.
back
.
Close
()
err
=
xerr
.
First
(
err
,
__
)
}()
// connect to master and let it drive us via commands and updates
return
stor
.
node
.
TalkMaster
(
ctx
,
func
(
ctx
context
.
Context
,
mlink
*
_MasterLink
)
error
{
//
XXX
move -> SetNumReplicas handler
//
TODO
move -> SetNumReplicas handler
// // NumReplicas: neo/py meaning for n(replica) = `n(real-replica) - 1`
// if !(accept.NumPartitions == 1 && accept.NumReplicas == 0) {
// return fmt.Errorf("TODO for 1-storage POC: Npt: %d Nreplica: %d", accept.NumPartitions, accept.NumReplicas)
...
...
@@ -175,7 +175,7 @@ func (stor *Storage) m1initialize1(ctx context.Context, req neonet.Request) erro
RowList
:
stor
.
node
.
State
.
PartTab
.
Dump
()})
case
*
proto
.
LockedTransactions
:
//
XXX
r/o stub
//
FIXME
r/o stub
err
=
req
.
Reply
(
&
proto
.
AnswerLockedTransactions
{})
// TODO AskUnfinishedTransactions
...
...
@@ -363,7 +363,7 @@ func (stor *Storage) serveLink(ctx context.Context, req *neonet.Request, idReq *
// TODO -> do what go-fuse does:
// - serve request in the goroutine that received it (reduces latency)
// - spawn another goroutine to continue accept loop
// - limit number of such accept-loop goroutines by GOMAXPROC
// - limit number of such accept-loop goroutines by GOMAXPROC
S
wg
.
Go
(
func
(
ctx
context
.
Context
)
error
{
return
stor
.
serveClient
(
ctx
,
req
)
})
...
...
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