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
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
cd63c735
Commit
cd63c735
authored
Sep 03, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
82e11a32
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
95 deletions
+23
-95
go/neo/proto.go
go/neo/proto.go
+23
-0
go/neo/server/cluster_test.go
go/neo/server/cluster_test.go
+0
-95
No files found.
go/neo/proto.go
View file @
cd63c735
// Copyright (C) 2006-2017 Nexedi SA and Contributors.
//
// This program is free software: you can Use, Study, Modify and Redistribute
// it under the terms of the GNU General Public License version 3, or (at your
// option) any later version, as published by the Free Software Foundation.
//
// You can also Link and Combine this program with other software covered by
// the terms of any of the Free Software licenses or any of the Open Source
// Initiative approved licenses and Convey the resulting work. Corresponding
// source of such a combination shall include the source code for all other
// software used.
//
// This program is distributed WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// See COPYING file for full licensing terms.
// See https://www.nexedi.com/licensing for rationale and options.
//go:generate sh -c "go run protogen.go >zproto-marshal.go"
package
neo
// protocol definition
// This file defines everything that relates to messages on the wire.
// In particular every type that is included in a message is defined here as well.
// XXX neo:proto justtype
// XXX neo:proto answerto x? (btw just needs "answer" flag)
// TODO regroup messages definitions to stay more close to 1 communication topic
// TODO document protocol itself better (who sends who what with which semantic)
...
...
go/neo/server/cluster_test.go
View file @
cd63c735
...
...
@@ -549,98 +549,3 @@ func TestMasterStorage(t *testing.T) {
Scancel
()
// ---- // ----
xwait
(
gwg
)
}
// basic interaction between Client -- Storage
func
_TestClientStorage
(
t
*
testing
.
T
)
{
// XXX temp disabled
return
/*
Cnl, Snl := NodeLinkPipe()
wg := &xsync.WorkGroup{}
Sctx, Scancel := context.WithCancel(bg)
net := pipenet.New("") // XXX here? (or a bit above?)
zstor := xfs1stor("../../zodb/storage/fs1/testdata/1.fs") // XXX +readonly
S := NewStorage("cluster", "Maddr", "Saddr", net, zstor)
wg.Gox(func() {
S.ServeLink(Sctx, Snl)
// XXX + test error return
})
C, err := client.NewClient(Cnl)
if err != nil {
t.Fatalf("creating/identifying client: %v", err)
}
// verify LastTid
lastTidOk, err := zstor.LastTid()
if err != nil {
t.Fatalf("zstor: lastTid: %v", err)
}
lastTid, err := C.LastTid()
if !(lastTid == lastTidOk && err == nil) {
t.Fatalf("C.LastTid -> %v, %v ; want %v, nil", lastTid, err, lastTidOk)
}
// verify Load for all {<,=}serial:oid
ziter := zstor.Iterate(zodb.Tid(0), zodb.TidMax)
for {
_, dataIter, err := ziter.NextTxn()
if err == io.EOF {
break
}
if err != nil {
t.Fatalf("ziter.NextTxn: %v", err)
}
for {
datai, err := dataIter.NextData()
if err == io.EOF {
break
}
if err != nil {
t.Fatalf("ziter.NextData: %v", err)
}
for _, tidBefore := range []bool{false, true} {
xid := zodb.Xid{Oid: datai.Oid} // {=,<}tid:oid
xid.Tid = datai.Tid
xid.TidBefore = tidBefore
if tidBefore {
xid.Tid++
}
data, tid, err := C.Load(xid)
if datai.Data != nil {
if !(bytes.Equal(data, datai.Data) && tid == datai.Tid && err == nil) {
t.Fatalf("load: %v:\nhave: %v %v %q\nwant: %v nil %q",
xid, tid, err, data, datai.Tid, datai.Data)
}
} else {
// deleted
errWant := &zodb.ErrXidMissing{xid}
if !(data == nil && tid == 0 && reflect.DeepEqual(err, errWant)) {
t.Fatalf("load: %v:\nhave: %v, %#v, %#v\nwant: %v, %#v, %#v",
xid, tid, err, data, zodb.Tid(0), errWant, []byte(nil))
}
}
}
}
}
// TODO Iterate (not yet implemented for NEO)
// shutdown storage
// XXX wait for S to shutdown + verify shutdown error
Scancel()
xwait(wg)
*/
}
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