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
5247f617
Commit
5247f617
authored
Feb 22, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
ddadb8b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
go/neo/xneo/parttab.go
go/neo/xneo/parttab.go
+8
-12
No files found.
go/neo/xneo/parttab.go
View file @
5247f617
...
@@ -43,7 +43,7 @@ import (
...
@@ -43,7 +43,7 @@ import (
//
//
// rule. The `oid % Np` is known as partition identifier of oid.
// rule. The `oid % Np` is known as partition identifier of oid.
//
//
// There is also externally set "re
dundancy
factor" R which describes the minimum
// There is also externally set "re
plication
factor" R which describes the minimum
// amount of separate nodes a particular object data should be stored into at the same time.
// amount of separate nodes a particular object data should be stored into at the same time.
//
//
// Given Np, R and []Storage PartitionTable tries to organize
// Given Np, R and []Storage PartitionTable tries to organize
...
@@ -52,11 +52,12 @@ import (
...
@@ -52,11 +52,12 @@ import (
//
//
// mapping so that
// mapping so that
//
//
// - re
dundancy
level set by R is met
// - re
plication
level set by R is met
// - storages associated with adjacent pids are different
// - storages associated with adjacent pids are different
//
//
// when such organization is reached the partition table is called operational
// when such organization is reached, and enough storage nodes are in "running"
// and non-operational otherwise. XXX and if storages are ready
// state, the partition table is called operational and non-operational
// otherwise.
//
//
// The PartitionTable can auto-adjust to storage nodes coming and going.
// The PartitionTable can auto-adjust to storage nodes coming and going.
// Let's consider cluster change from Ns1 to Ns2 storage nodes: if we pick
// Let's consider cluster change from Ns1 to Ns2 storage nodes: if we pick
...
@@ -115,14 +116,11 @@ import (
...
@@ -115,14 +116,11 @@ import (
//
//
// PartitionTable zero value is valid empty partition table.
// PartitionTable zero value is valid empty partition table.
type
PartitionTable
struct
{
type
PartitionTable
struct
{
// XXX do we need sync.Mutex here for updates ?
PTid
proto
.
PTid
// ↑ for versioning
tab
[][]
Cell
// [#Np] pid -> []Cell
tab
[][]
Cell
// [#Np] pid -> []Cell
PTid
proto
.
PTid
// ↑ for versioning XXX -> ver ? XXX move out of here?
}
}
// Cell describes one storage in a pid entry in partition table
// Cell describes one storage in a pid entry in partition table
.
type
Cell
struct
{
type
Cell
struct
{
proto
.
CellInfo
// .nid + .state
proto
.
CellInfo
// .nid + .state
...
@@ -181,8 +179,6 @@ func MakePartTab(np int, nodev []*PeerNode) *PartitionTable {
...
@@ -181,8 +179,6 @@ func MakePartTab(np int, nodev []*PeerNode) *PartitionTable {
// - whether there are corresponding storage nodes that are up
// - whether there are corresponding storage nodes that are up
//
//
// information about nodes being up or down is obtained from supplied NodeTable
// information about nodes being up or down is obtained from supplied NodeTable
//
// XXX or keep not only NodeID in Cell - add *Node ?
func
(
pt
*
PartitionTable
)
OperationalWith
(
nt
*
NodeTable
)
bool
{
func
(
pt
*
PartitionTable
)
OperationalWith
(
nt
*
NodeTable
)
bool
{
// empty partition table is never operational
// empty partition table is never operational
if
len
(
pt
.
tab
)
==
0
{
if
len
(
pt
.
tab
)
==
0
{
...
...
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