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
34f4f310
Commit
34f4f310
authored
Sep 08, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~staticcheck
parent
d99bf118
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
24 additions
and
24 deletions
+24
-24
go/internal/xtesting/xtesting.go
go/internal/xtesting/xtesting.go
+1
-1
go/neo/client.go
go/neo/client.go
+1
-3
go/neo/mastered.go
go/neo/mastered.go
+2
-2
go/zodb/btree/btree.go.in
go/zodb/btree/btree.go.in
+3
-3
go/zodb/btree/testdata/gen-testdata
go/zodb/btree/testdata/gen-testdata
+3
-3
go/zodb/btree/ziobtree.go
go/zodb/btree/ziobtree.go
+5
-3
go/zodb/btree/zlobtree.go
go/zodb/btree/zlobtree.go
+3
-3
go/zodb/py/pydata-gen-testdata
go/zodb/py/pydata-gen-testdata
+3
-3
go/zodb/storage/fs1/format.go
go/zodb/storage/fs1/format.go
+1
-1
go/zodb/storage/zeo/proto.go
go/zodb/storage/zeo/proto.go
+2
-2
No files found.
go/internal/xtesting/xtesting.go
View file @
34f4f310
...
@@ -388,7 +388,7 @@ func DrvTestWatch(t *testing.T, zurl string, zdrvOpen zodb.DriverOpener, bugv ..
...
@@ -388,7 +388,7 @@ func DrvTestWatch(t *testing.T, zurl string, zdrvOpen zodb.DriverOpener, bugv ..
ctx
:=
context
.
Background
()
ctx
:=
context
.
Background
()
watchq
:=
make
(
chan
zodb
.
Event
)
watchq
:=
make
(
chan
zodb
.
Event
)
zdrv
,
at0
,
err
:=
zdrvOpen
(
ctx
,
u
,
&
zodb
.
DriverOptions
{
ReadOnly
:
true
,
Watchq
:
watchq
})
zdrv
,
at0
,
err
:=
zdrvOpen
(
ctx
,
u
,
&
zodb
.
DriverOptions
{
ReadOnly
:
true
,
Watchq
:
watchq
})
;
X
(
err
)
if
at0
!=
at
{
if
at0
!=
at
{
t
.
Fatalf
(
"opened @ %s ; want %s"
,
at0
,
at
)
t
.
Fatalf
(
"opened @ %s ; want %s"
,
at0
,
at
)
}
}
...
...
go/neo/client.go
View file @
34f4f310
...
@@ -457,9 +457,7 @@ func openClientByURL(ctx context.Context, u *url.URL, opt *zodb.DriverOptions) (
...
@@ -457,9 +457,7 @@ func openClientByURL(ctx context.Context, u *url.URL, opt *zodb.DriverOptions) (
}
}
name
:=
u
.
Path
name
:=
u
.
Path
if
strings
.
HasPrefix
(
name
,
"/"
)
{
name
=
strings
.
TrimPrefix
(
name
,
"/"
)
name
=
name
[
1
:
]
}
if
name
==
""
{
if
name
==
""
{
return
nil
,
zodb
.
InvalidTid
,
fmt
.
Errorf
(
"cluster name not specified"
)
return
nil
,
zodb
.
InvalidTid
,
fmt
.
Errorf
(
"cluster name not specified"
)
}
}
...
...
go/neo/mastered.go
View file @
34f4f310
...
@@ -76,12 +76,12 @@ type _MasteredNode struct {
...
@@ -76,12 +76,12 @@ type _MasteredNode struct {
type
_MasteredNodeFlags
int
type
_MasteredNodeFlags
int
const
(
const
(
// δPartTabPassThrough tells mlink.Recv1 not to filter out messages related
// δPartTabPassThrough tells mlink.Recv1 not to filter out messages related
// to partition table changes. When mlink.Recv1 receives such messages the
re
// to partition table changes. When mlink.Recv1 receives such messages the
y
// are already processed internally to update .state.PartTab correspondingly.
// are already processed internally to update .state.PartTab correspondingly.
//
//
// Storage uses this mode to receive δPartTab notifications to know
// Storage uses this mode to receive δPartTab notifications to know
// when to persist it.
// when to persist it.
δPartTabPassThrough
_MasteredNodeFlags
=
iota
δPartTabPassThrough
_MasteredNodeFlags
=
1
<<
iota
)
)
// newMasteredNode creates new _MasteredNode that connects to masterAddr/cluster via net.
// newMasteredNode creates new _MasteredNode that connects to masterAddr/cluster via net.
...
...
go/zodb/btree/btree.go.in
View file @
34f4f310
//
Copyright
(
c
)
2001
,
2002
Zope
Foundation
and
Contributors
.
//
Copyright
(
c
)
2001
,
2002
Zope
Foundation
and
Contributors
.
//
All
Rights
Reserved
.
//
All
Rights
Reserved
.
//
//
//
Copyright
(
C
)
2018
-
20
19
Nexedi
SA
and
Contributors
.
//
Copyright
(
C
)
2018
-
20
21
Nexedi
SA
and
Contributors
.
//
Kirill
Smelkov
<
kirr
@
nexedi
.
com
>
//
Kirill
Smelkov
<
kirr
@
nexedi
.
com
>
//
//
//
This
software
is
subject
to
the
provisions
of
the
Zope
Public
License
,
//
This
software
is
subject
to
the
provisions
of
the
Zope
Public
License
,
...
@@ -609,7 +609,7 @@ func (bt *btreeState) PySetState(pystate interface{}) (err error) {
...
@@ -609,7 +609,7 @@ func (bt *btreeState) PySetState(pystate interface{}) (err error) {
}
}
if i > 1 && !(key > kprev) {
if i > 1 && !(key > kprev) {
fmt.Errorf("data: [%d]: key not ↑", i)
return
fmt.Errorf("data: [%d]: key not ↑", i)
}
}
kprev = key
kprev = key
...
@@ -629,7 +629,7 @@ func (bt *btreeState) PySetState(pystate interface{}) (err error) {
...
@@ -629,7 +629,7 @@ func (bt *btreeState) PySetState(pystate interface{}) (err error) {
childrenKind = kind
childrenKind = kind
}
}
if kind != childrenKind {
if kind != childrenKind {
fmt.Errorf("data: [%d]: children must be of the same type", i)
return
fmt.Errorf("data: [%d]: children must be of the same type", i)
}
}
bt.data = append(bt.data, Entry{key: kkey, child: child.(Node)})
bt.data = append(bt.data, Entry{key: kkey, child: child.(Node)})
...
...
go/zodb/btree/testdata/gen-testdata
View file @
34f4f310
#!/usr/bin/env python2
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Copyright (C) 2018-202
0
Nexedi SA and Contributors.
# Copyright (C) 2018-202
1
Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
# Kirill Smelkov <kirr@nexedi.com>
#
#
# This program is free software: you can Use, Study, Modify and Redistribute
# This program is free software: you can Use, Study, Modify and Redistribute
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
from
ZODB.DB
import
DB
from
ZODB.DB
import
DB
from
BTrees.LOBTree
import
LOBucket
,
LOBTree
from
BTrees.LOBTree
import
LOBucket
,
LOBTree
from
ZODB.utils
import
u64
from
ZODB.utils
import
u64
from
zodbtools.test.gen_testdata
import
run_with_zodb
3
py2_compat
from
zodbtools.test.gen_testdata
import
run_with_zodb
4
py2_compat
import
os
,
os
.
path
,
transaction
import
os
,
os
.
path
,
transaction
from
golang.gcompat
import
qq
from
golang.gcompat
import
qq
...
@@ -89,7 +89,7 @@ def main2():
...
@@ -89,7 +89,7 @@ def main2():
db
.
close
()
db
.
close
()
def
main
():
def
main
():
run_with_zodb
3
py2_compat
(
main2
)
run_with_zodb
4
py2_compat
(
main2
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
go/zodb/btree/ziobtree.go
View file @
34f4f310
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
// Copyright (c) 2001, 2002 Zope Foundation and Contributors.
// Copyright (c) 2001, 2002 Zope Foundation and Contributors.
// All Rights Reserved.
// All Rights Reserved.
//
//
// Copyright (C) 2018-20
19
Nexedi SA and Contributors.
// Copyright (C) 2018-20
21
Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
// Kirill Smelkov <kirr@nexedi.com>
//
//
// This software is subject to the provisions of the Zope Public License,
// This software is subject to the provisions of the Zope Public License,
...
@@ -197,6 +197,8 @@ func (t *IOBTree) VGet(ctx context.Context, key int32, visit func(node IONode))
...
@@ -197,6 +197,8 @@ func (t *IOBTree) VGet(ctx context.Context, key int32, visit func(node IONode))
return
key
<
t
.
data
[
j
]
.
key
return
key
<
t
.
data
[
j
]
.
key
})
})
// FIXME panic index out of range (empty T without children;
// logically incorrect, but Restructure generated it once)
child
:=
t
.
data
[
i
]
.
child
child
:=
t
.
data
[
i
]
.
child
t
.
PDeactivate
()
t
.
PDeactivate
()
err
=
child
.
PActivate
(
ctx
)
err
=
child
.
PActivate
(
ctx
)
...
@@ -609,7 +611,7 @@ func (bt *iobtreeState) PySetState(pystate interface{}) (err error) {
...
@@ -609,7 +611,7 @@ func (bt *iobtreeState) PySetState(pystate interface{}) (err error) {
}
}
if
i
>
1
&&
!
(
key
>
kprev
)
{
if
i
>
1
&&
!
(
key
>
kprev
)
{
fmt
.
Errorf
(
"data: [%d]: key not ↑"
,
i
)
return
fmt
.
Errorf
(
"data: [%d]: key not ↑"
,
i
)
}
}
kprev
=
key
kprev
=
key
...
@@ -629,7 +631,7 @@ func (bt *iobtreeState) PySetState(pystate interface{}) (err error) {
...
@@ -629,7 +631,7 @@ func (bt *iobtreeState) PySetState(pystate interface{}) (err error) {
childrenKind
=
kind
childrenKind
=
kind
}
}
if
kind
!=
childrenKind
{
if
kind
!=
childrenKind
{
fmt
.
Errorf
(
"data: [%d]: children must be of the same type"
,
i
)
return
fmt
.
Errorf
(
"data: [%d]: children must be of the same type"
,
i
)
}
}
bt
.
data
=
append
(
bt
.
data
,
IOEntry
{
key
:
kkey
,
child
:
child
.
(
IONode
)})
bt
.
data
=
append
(
bt
.
data
,
IOEntry
{
key
:
kkey
,
child
:
child
.
(
IONode
)})
...
...
go/zodb/btree/zlobtree.go
View file @
34f4f310
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
// Copyright (c) 2001, 2002 Zope Foundation and Contributors.
// Copyright (c) 2001, 2002 Zope Foundation and Contributors.
// All Rights Reserved.
// All Rights Reserved.
//
//
// Copyright (C) 2018-20
19
Nexedi SA and Contributors.
// Copyright (C) 2018-20
21
Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
// Kirill Smelkov <kirr@nexedi.com>
//
//
// This software is subject to the provisions of the Zope Public License,
// This software is subject to the provisions of the Zope Public License,
...
@@ -611,7 +611,7 @@ func (bt *lobtreeState) PySetState(pystate interface{}) (err error) {
...
@@ -611,7 +611,7 @@ func (bt *lobtreeState) PySetState(pystate interface{}) (err error) {
}
}
if
i
>
1
&&
!
(
key
>
kprev
)
{
if
i
>
1
&&
!
(
key
>
kprev
)
{
fmt
.
Errorf
(
"data: [%d]: key not ↑"
,
i
)
return
fmt
.
Errorf
(
"data: [%d]: key not ↑"
,
i
)
}
}
kprev
=
key
kprev
=
key
...
@@ -631,7 +631,7 @@ func (bt *lobtreeState) PySetState(pystate interface{}) (err error) {
...
@@ -631,7 +631,7 @@ func (bt *lobtreeState) PySetState(pystate interface{}) (err error) {
childrenKind
=
kind
childrenKind
=
kind
}
}
if
kind
!=
childrenKind
{
if
kind
!=
childrenKind
{
fmt
.
Errorf
(
"data: [%d]: children must be of the same type"
,
i
)
return
fmt
.
Errorf
(
"data: [%d]: children must be of the same type"
,
i
)
}
}
bt
.
data
=
append
(
bt
.
data
,
LOEntry
{
key
:
kkey
,
child
:
child
.
(
LONode
)})
bt
.
data
=
append
(
bt
.
data
,
LOEntry
{
key
:
kkey
,
child
:
child
.
(
LONode
)})
...
...
go/zodb/py/pydata-gen-testdata
View file @
34f4f310
#!/usr/bin/env python2
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Copyright (C) 2017-202
0
Nexedi SA and Contributors.
# Copyright (C) 2017-202
1
Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
# Kirill Smelkov <kirr@nexedi.com>
#
#
# This program is free software: you can Use, Study, Modify and Redistribute
# This program is free software: you can Use, Study, Modify and Redistribute
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
"""generate reference pickle objects encoding for tests"""
"""generate reference pickle objects encoding for tests"""
from
ZODB
import
serialize
from
ZODB
import
serialize
from
zodbtools.test.gen_testdata
import
run_with_zodb
3
py2_compat
from
zodbtools.test.gen_testdata
import
run_with_zodb
4
py2_compat
from
golang.gcompat
import
qq
from
golang.gcompat
import
qq
def
main2
():
def
main2
():
...
@@ -56,7 +56,7 @@ def main2():
...
@@ -56,7 +56,7 @@ def main2():
emit
(
"}"
)
emit
(
"}"
)
def
main
():
def
main
():
run_with_zodb
3
py2_compat
(
main2
)
run_with_zodb
4
py2_compat
(
main2
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
main
()
main
()
go/zodb/storage/fs1/format.go
View file @
34f4f310
...
@@ -207,7 +207,7 @@ func (txnh *TxnHeader) CloneFrom(txnh2 *TxnHeader) {
...
@@ -207,7 +207,7 @@ func (txnh *TxnHeader) CloneFrom(txnh2 *TxnHeader) {
type
TxnLoadFlags
int
type
TxnLoadFlags
int
const
(
const
(
LoadAll
TxnLoadFlags
=
0x00
// load whole transaction header
LoadAll
TxnLoadFlags
=
0x00
// load whole transaction header
LoadNoStrings
=
0x01
// do not load user/desc/ext strings
LoadNoStrings
TxnLoadFlags
=
0x01
// do not load user/desc/ext strings
)
)
// Load reads and decodes transaction record header @ pos.
// Load reads and decodes transaction record header @ pos.
...
...
go/zodb/storage/zeo/proto.go
View file @
34f4f310
// Copyright (C) 2018-202
0
Nexedi SA and Contributors.
// Copyright (C) 2018-202
1
Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
// Kirill Smelkov <kirr@nexedi.com>
//
//
// This program is free software: you can Use, Study, Modify and Redistribute
// This program is free software: you can Use, Study, Modify and Redistribute
...
@@ -54,7 +54,7 @@ type msg struct {
...
@@ -54,7 +54,7 @@ type msg struct {
type
msgFlags
int64
type
msgFlags
int64
const
(
const
(
msgAsync
msgFlags
=
1
// message does not need a reply
msgAsync
msgFlags
=
1
// message does not need a reply
msgExcept
=
2
// exception was raised on remote side (ZEO5)
msgExcept
msgFlags
=
2
// exception was raised on remote side (ZEO5)
)
)
// encoding represents messages encoding.
// encoding represents messages encoding.
...
...
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