Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dgraph
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
dgraph
Commits
d6a776a2
Unverified
Commit
d6a776a2
authored
8 years ago
by
Janardhan Reddy
Browse files
Options
Downloads
Patches
Plain Diff
evict pl's from memory while populating shard
parent
40eb5c16
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
posting/lists.go
+12
-0
12 additions, 0 deletions
posting/lists.go
worker/draft.go
+12
-2
12 additions, 2 deletions
worker/draft.go
with
24 additions
and
2 deletions
posting/lists.go
+
12
−
0
View file @
d6a776a2
...
@@ -453,6 +453,18 @@ func CommitLists(numRoutines int) {
...
@@ -453,6 +453,18 @@ func CommitLists(numRoutines int) {
wg
.
Wait
()
wg
.
Wait
()
}
}
// EvictAll removes all pl's stored in memory
func
EvictAll
(
numRoutines
int
)
{
stopTheWorld
.
Lock
()
defer
stopTheWorld
.
Unlock
()
CommitLists
(
numRoutines
)
lhmap
.
EachWithDelete
(
func
(
k
uint64
,
l
*
List
)
{
l
.
SetForDeletion
()
l
.
decr
()
})
}
// The following logic is used to batch up all the writes to RocksDB.
// The following logic is used to batch up all the writes to RocksDB.
type
syncEntry
struct
{
type
syncEntry
struct
{
key
[]
byte
key
[]
byte
...
...
This diff is collapsed.
Click to expand it.
worker/draft.go
+
12
−
2
View file @
d6a776a2
...
@@ -516,6 +516,14 @@ func (n *node) retrieveSnapshot(rc task.RaftContext) {
...
@@ -516,6 +516,14 @@ func (n *node) retrieveSnapshot(rc task.RaftContext) {
x
.
AssertTruef
(
pool
!=
nil
,
"Pool shouldn't be nil for address: %v for id: %v"
,
addr
,
rc
.
Id
)
x
.
AssertTruef
(
pool
!=
nil
,
"Pool shouldn't be nil for address: %v for id: %v"
,
addr
,
rc
.
Id
)
x
.
AssertTrue
(
rc
.
Group
==
n
.
gid
)
x
.
AssertTrue
(
rc
.
Group
==
n
.
gid
)
// Wait for watermarks to sync since populateShard writes directly to db, otherwise
// the values might get overwritten
// Safe to keep this line
n
.
syncAllMarks
(
n
.
ctx
)
// Need to clear pl's stored in memory for the case when retrieving snapshot with
// index greater than this node's last index
// Should invalidate/remove pl's to this group only ideally
posting
.
EvictAll
(
10
)
x
.
Check2
(
populateShard
(
n
.
ctx
,
pool
,
n
.
gid
))
x
.
Check2
(
populateShard
(
n
.
ctx
,
pool
,
n
.
gid
))
x
.
Checkf
(
schema
.
LoadFromDb
(),
"Error while initilizating schema"
)
x
.
Checkf
(
schema
.
LoadFromDb
(),
"Error while initilizating schema"
)
}
}
...
@@ -668,8 +676,10 @@ func (n *node) joinPeers() {
...
@@ -668,8 +676,10 @@ func (n *node) joinPeers() {
x
.
AssertTruef
(
pool
!=
nil
,
"Unable to get pool for addr: %q for peer: %d"
,
paddr
,
pid
)
x
.
AssertTruef
(
pool
!=
nil
,
"Unable to get pool for addr: %q for peer: %d"
,
paddr
,
pid
)
// Bring the instance up to speed first.
// Bring the instance up to speed first.
_
,
err
:=
populateShard
(
n
.
ctx
,
pool
,
n
.
gid
)
// Raft would decide whether snapshot needs to fetched or not
x
.
Checkf
(
err
,
"Error while populating shard"
)
// so populateShard is not needed
// _, err := populateShard(n.ctx, pool, n.gid)
// x.Checkf(err, "Error while populating shard")
conn
,
err
:=
pool
.
Get
()
conn
,
err
:=
pool
.
Get
()
x
.
Check
(
err
)
x
.
Check
(
err
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment