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
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
Stefane Fermigier
neo
Commits
e2630ae4
Commit
e2630ae4
authored
May 29, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6b35dbe6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
go/neo/master.go
go/neo/master.go
+10
-6
go/neo/parttab.go
go/neo/parttab.go
+1
-1
No files found.
go/neo/master.go
View file @
e2630ae4
...
@@ -63,7 +63,7 @@ type nodeLeave struct {
...
@@ -63,7 +63,7 @@ type nodeLeave struct {
// storage node passed recovery phase
// storage node passed recovery phase
type
storRecovery
struct
{
type
storRecovery
struct
{
part
t
ab
PartitionTable
part
T
ab
PartitionTable
// XXX + lastOid, lastTid, backup_tid, truncate_tid ?
// XXX + lastOid, lastTid, backup_tid, truncate_tid ?
}
}
...
@@ -127,13 +127,17 @@ func (m *Master) run(ctx context.Context) {
...
@@ -127,13 +127,17 @@ func (m *Master) run(ctx context.Context) {
// TODO consider adjusting partTab
// TODO consider adjusting partTab
// node disconnects
// node disconnects
//case link := <-m.nodeLeave:
case
_
=
<-
m
.
nodeLeave
:
// TODO
// a storage node came through recovery - let's see whether
// a storage node came through recovery - let's see whether
// ptid ↑ and if so we should take partition table from there
// ptid ↑ and if so we should take partition table from there
case
r
:=
<-
m
.
storRecovery
:
case
r
:=
<-
m
.
storRecovery
:
_
=
r
if
r
.
partTab
.
ptid
>
m
.
partTab
.
ptid
{
m
.
partTab
=
r
.
partTab
// XXX also transfer subscribers ?
// XXX or during recovery no one must be subscribed to partTab ?
}
}
}
}
}
...
@@ -245,7 +249,7 @@ func (m *Master) storCtlRecovery(ctx context.Context, link *NodeLink) {
...
@@ -245,7 +249,7 @@ func (m *Master) storCtlRecovery(ctx context.Context, link *NodeLink) {
// reconstruct partition table from response
// reconstruct partition table from response
pt
:=
PartitionTable
{}
pt
:=
PartitionTable
{}
pt
.
pt
I
d
=
resp
.
PTid
pt
.
pt
i
d
=
resp
.
PTid
for
_
,
row
:=
range
resp
.
RowList
{
for
_
,
row
:=
range
resp
.
RowList
{
i
:=
row
.
Offset
i
:=
row
.
Offset
for
i
>=
uint32
(
len
(
pt
.
ptTab
))
{
for
i
>=
uint32
(
len
(
pt
.
ptTab
))
{
...
@@ -261,7 +265,7 @@ func (m *Master) storCtlRecovery(ctx context.Context, link *NodeLink) {
...
@@ -261,7 +265,7 @@ func (m *Master) storCtlRecovery(ctx context.Context, link *NodeLink) {
}
}
}
}
m
.
storRecovery
<-
storRecovery
{
part
t
ab
:
pt
}
m
.
storRecovery
<-
storRecovery
{
part
T
ab
:
pt
}
}
}
// allocUUID allocates new node uuid for a node of kind nodeType
// allocUUID allocates new node uuid for a node of kind nodeType
...
...
go/neo/parttab.go
View file @
e2630ae4
...
@@ -109,7 +109,7 @@ type PartitionTable struct {
...
@@ -109,7 +109,7 @@ type PartitionTable struct {
ptTab
[][]
PartitionCell
// [#Np]
ptTab
[][]
PartitionCell
// [#Np]
pt
I
d
PTid
// ↑ for versioning XXX -> ver ?
pt
i
d
PTid
// ↑ for versioning XXX -> ver ?
}
}
// PartitionCell describes one storage in a ptid entry in partition table
// PartitionCell describes one storage in a ptid entry in partition table
...
...
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