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
7efd3012
Commit
7efd3012
authored
May 30, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
39bd3660
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
246 additions
and
126 deletions
+246
-126
go/neo/master.go
go/neo/master.go
+220
-107
go/neo/parttab.go
go/neo/parttab.go
+14
-7
go/neo/proto-marshal.go
go/neo/proto-marshal.go
+8
-8
go/neo/proto.go
go/neo/proto.go
+4
-4
No files found.
go/neo/master.go
View file @
7efd3012
This diff is collapsed.
Click to expand it.
go/neo/parttab.go
View file @
7efd3012
...
...
@@ -130,15 +130,16 @@ type PartitionCell struct {
}
// Operational returns whether all object space is covered by at least some ready-to-serve nodes
// NOTE XXX operational here means only pt itself is operational
// for cluster to be really operational it has to be checked whether
// nodes referenced by pt are up and running
// OperationalWith returns whether all object space is covered by at least some ready-to-serve nodes
//
// XXX or keep not only NodeUUID in PartitionCell - add *Node ?
// for all partitions it checks both:
// - whether there are up-to-date entries in the partition table, and
// - whether there are corresponding storage nodes that are up
//
// information about nodes being up or down is obtained from supplied NodeTable
//
// XXX
-> add `nt *NodeTable` as argument and check real node states ther
e ?
func
(
pt
*
PartitionTable
)
Operational
(
)
bool
{
// XXX
or keep not only NodeUUID in PartitionCell - add *Nod
e ?
func
(
pt
*
PartitionTable
)
Operational
With
(
nt
*
NodeTable
)
bool
{
for
_
,
ptEntry
:=
range
pt
.
ptTab
{
if
len
(
ptEntry
)
==
0
{
return
false
...
...
@@ -149,6 +150,12 @@ func (pt *PartitionTable) Operational() bool {
for
_
,
cell
:=
range
ptEntry
{
switch
cell
.
CellState
{
case
UP_TO_DATE
,
FEEDING
:
// XXX cell.isReadble in py
// cell says it is readable. let's check whether corresponding node is up
node
:=
nt
.
Get
(
cell
.
NodeUUID
)
if
node
==
nil
||
node
.
Info
.
NodeState
!=
RUNNING
{
// XXX PENDING is also ok ?
continue
}
ok
=
true
break
cellLoop
}
...
...
go/neo/proto-marshal.go
View file @
7efd3012
...
...
@@ -448,8 +448,8 @@ func (p *AnswerRecovery) NEOEncodedInfo() (uint16, int) {
func
(
p
*
AnswerRecovery
)
NEOEncode
(
data
[]
byte
)
{
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
PTid
))
binary
.
BigEndian
.
PutUint64
(
data
[
8
:
],
uint64
(
p
.
BackupT
ID
))
binary
.
BigEndian
.
PutUint64
(
data
[
16
:
],
uint64
(
p
.
TruncateT
ID
))
binary
.
BigEndian
.
PutUint64
(
data
[
8
:
],
uint64
(
p
.
BackupT
id
))
binary
.
BigEndian
.
PutUint64
(
data
[
16
:
],
uint64
(
p
.
TruncateT
id
))
}
func
(
p
*
AnswerRecovery
)
NEODecode
(
data
[]
byte
)
(
int
,
error
)
{
...
...
@@ -457,8 +457,8 @@ func (p *AnswerRecovery) NEODecode(data []byte) (int, error) {
goto
overflow
}
p
.
PTid
=
PTid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
p
.
BackupT
ID
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
8
:
]))
p
.
TruncateT
ID
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
16
:
]))
p
.
BackupT
id
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
8
:
]))
p
.
TruncateT
id
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
16
:
]))
return
24
,
nil
overflow
:
...
...
@@ -485,16 +485,16 @@ func (p *AnswerLastIDs) NEOEncodedInfo() (uint16, int) {
}
func
(
p
*
AnswerLastIDs
)
NEOEncode
(
data
[]
byte
)
{
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
LastO
ID
))
binary
.
BigEndian
.
PutUint64
(
data
[
8
:
],
uint64
(
p
.
LastT
ID
))
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
LastO
id
))
binary
.
BigEndian
.
PutUint64
(
data
[
8
:
],
uint64
(
p
.
LastT
id
))
}
func
(
p
*
AnswerLastIDs
)
NEODecode
(
data
[]
byte
)
(
int
,
error
)
{
if
uint32
(
len
(
data
))
<
16
{
goto
overflow
}
p
.
LastO
ID
=
zodb
.
Oid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
p
.
LastT
ID
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
8
:
]))
p
.
LastO
id
=
zodb
.
Oid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
p
.
LastT
id
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
8
:
]))
return
16
,
nil
overflow
:
...
...
go/neo/proto.go
View file @
7efd3012
...
...
@@ -308,8 +308,8 @@ type Recovery struct {
type
AnswerRecovery
struct
{
PTid
BackupT
ID
zodb
.
Tid
TruncateT
ID
zodb
.
Tid
BackupT
id
zodb
.
Tid
TruncateT
id
zodb
.
Tid
}
// Ask the last OID/TID so that a master can initialize its TransactionManager.
...
...
@@ -318,8 +318,8 @@ type LastIDs struct {
}
type
AnswerLastIDs
struct
{
LastO
ID
zodb
.
Oid
LastT
ID
zodb
.
Tid
LastO
id
zodb
.
Oid
LastT
id
zodb
.
Tid
}
// Ask the full partition table. PM -> S.
...
...
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