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
eeb1f958
Commit
eeb1f958
authored
Sep 01, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c354a136
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
5 deletions
+41
-5
go/neo/client/client.go
go/neo/client/client.go
+2
-1
go/neo/server/cluster_test.go
go/neo/server/cluster_test.go
+38
-4
go/neo/server/storage.go
go/neo/server/storage.go
+1
-0
No files found.
go/neo/client/client.go
View file @
eeb1f958
...
...
@@ -180,13 +180,14 @@ func (c *Client) talkMaster(ctx context.Context) (err error) {
}
func
(
c
*
Client
)
talkMaster1
(
ctx
context
.
Context
)
(
err
error
)
{
// XXX dup from Server.talkMaster1 ?
mlink
,
accept
,
err
:=
c
.
node
.
Dial
(
ctx
,
neo
.
MASTER
,
c
.
node
.
MasterAddr
)
if
err
!=
nil
{
// FIXME it is not only identification - e.g. ECONNREFUSED
return
err
}
// XXX vvv dup from Server.talkMaster1 ?
// XXX -> node.Dial ?
if
accept
.
YourUUID
!=
c
.
node
.
MyInfo
.
UUID
{
log
.
Infof
(
ctx
,
"master told us to have uuid=%v"
,
accept
.
YourUUID
)
...
...
go/neo/server/cluster_test.go
View file @
eeb1f958
...
...
@@ -24,7 +24,7 @@ package server
//go:generate sh -c "go run ../../xcommon/tracing/cmd/gotrace/{gotrace,util}.go ."
import
(
//
"bytes"
"bytes"
"context"
//"io"
"math"
...
...
@@ -33,6 +33,8 @@ import (
"testing"
"unsafe"
"github.com/kylelemons/godebug/pretty"
"lab.nexedi.com/kirr/neo/go/neo"
"lab.nexedi.com/kirr/neo/go/neo/client"
...
...
@@ -375,6 +377,7 @@ func TestMasterStorage(t *testing.T) {
}))
// C asks M about PT
// FIXME this might come in parallel with vvv "C <- M NotifyNodeInformation C1,M1,S1"
tc
.
Expect
(
conntx
(
"c:1"
,
"m:3"
,
3
,
&
neo
.
AskPartitionTable
{}))
tc
.
Expect
(
conntx
(
"m:3"
,
"c:1"
,
3
,
&
neo
.
AnswerPartitionTable
{
PTid
:
1
,
...
...
@@ -418,10 +421,41 @@ func TestMasterStorage(t *testing.T) {
xwait
(
wg
)
println
(
"000"
)
// C starts loading first object -> connects to S
data
,
serial
,
err
:=
C
.
Load
(
bg
,
zodb
.
Xid
{
Oid
:
1
,
XTid
:
zodb
.
XTid
{
Tid
:
zodb
.
TidMax
,
TidBefore
:
true
}})
_
,
_
,
_
=
data
,
serial
,
err
wg
=
&
xsync
.
WorkGroup
{}
xid1
:=
zodb
.
Xid
{
Oid
:
1
,
XTid
:
zodb
.
XTid
{
Tid
:
zodb
.
TidMax
,
TidBefore
:
true
}}
data1
,
serial1
,
err
:=
zstor
.
Load
(
bg
,
xid1
)
exc
.
Raiseif
(
err
)
wg
.
Gox
(
func
()
{
data
,
serial
,
err
:=
C
.
Load
(
bg
,
xid1
)
exc
.
Raiseif
(
err
)
if
!
(
bytes
.
Equal
(
data
,
data1
)
&&
serial
==
serial1
)
{
exc
.
Raisef
(
"C.Load(%v) ->
\n
data:
\n
%s
\n
serial:
\n
%s
\n
"
,
xid1
,
pretty
.
Compare
(
data1
,
data
),
pretty
.
Compare
(
serial1
,
serial
))
}
})
tc
.
Expect
(
netconnect
(
"c:2"
,
"s:3"
,
"s:1"
))
tc
.
Expect
(
conntx
(
"c:2"
,
"s:3"
,
1
,
&
neo
.
RequestIdentification
{
NodeType
:
neo
.
CLIENT
,
UUID
:
neo
.
UUID
(
neo
.
CLIENT
,
1
),
Address
:
xnaddr
(
""
),
ClusterName
:
"abc1"
,
IdTimestamp
:
0
,
// XXX ?
}))
println
(
"222"
)
tc
.
Expect
(
conntx
(
"s:3"
,
"c:2"
,
1
,
&
neo
.
AcceptIdentification
{
NodeType
:
neo
.
STORAGE
,
MyUUID
:
neo
.
UUID
(
neo
.
STORAGE
,
1
),
NumPartitions
:
1
,
NumReplicas
:
1
,
YourUUID
:
neo
.
UUID
(
neo
.
CLIENT
,
1
),
}))
println
(
"333"
)
...
...
go/neo/server/storage.go
View file @
eeb1f958
...
...
@@ -157,6 +157,7 @@ func (stor *Storage) talkMaster(ctx context.Context) (err error) {
// it returns error describing why such cycle had to finish
// XXX distinguish between temporary problems and non-temporary ones?
func
(
stor
*
Storage
)
talkMaster1
(
ctx
context
.
Context
)
(
err
error
)
{
// XXX dup in Client.talkMaster1 ?
mlink
,
accept
,
err
:=
stor
.
node
.
Dial
(
ctx
,
neo
.
MASTER
,
stor
.
node
.
MasterAddr
)
if
err
!=
nil
{
return
err
...
...
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