Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
56b941f3
Commit
56b941f3
authored
May 30, 2018
by
Jonathan Basseri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scheduler: fix equiv. cache logging.
Change the log messages to accurately reflect the cache behavior.
parent
c24842d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
eqivalence.go
pkg/scheduler/core/equivalence/eqivalence.go
+5
-6
No files found.
pkg/scheduler/core/equivalence/eqivalence.go
View file @
56b941f3
...
@@ -162,7 +162,7 @@ func (c *Cache) updateResult(
...
@@ -162,7 +162,7 @@ func (c *Cache) updateResult(
equivalenceHash
:
predicateItem
,
equivalenceHash
:
predicateItem
,
}
}
}
}
glog
.
V
(
5
)
.
Infof
(
"
Updated cached predicate: %v for pod: %v on node: %s, with item %v"
,
predicateKey
,
podName
,
node
Name
,
predicateItem
)
glog
.
V
(
5
)
.
Infof
(
"
Cache update: node=%s,predicate=%s,pod=%s,value=%v"
,
nodeName
,
predicateKey
,
pod
Name
,
predicateItem
)
}
}
// lookupResult returns cached predicate results and a bool saying whether a
// lookupResult returns cached predicate results and a bool saying whether a
...
@@ -173,8 +173,7 @@ func (c *Cache) lookupResult(
...
@@ -173,8 +173,7 @@ func (c *Cache) lookupResult(
)
(
value
predicateResult
,
ok
bool
)
{
)
(
value
predicateResult
,
ok
bool
)
{
c
.
mu
.
RLock
()
c
.
mu
.
RLock
()
defer
c
.
mu
.
RUnlock
()
defer
c
.
mu
.
RUnlock
()
glog
.
V
(
5
)
.
Infof
(
"Begin to calculate predicate: %v for pod: %s on node: %s based on equivalence cache"
,
glog
.
V
(
5
)
.
Infof
(
"Cache lookup: node=%s,predicate=%s,pod=%s"
,
nodeName
,
predicateKey
,
podName
)
predicateKey
,
podName
,
nodeName
)
value
,
ok
=
c
.
cache
[
nodeName
][
predicateKey
][
equivalenceHash
]
value
,
ok
=
c
.
cache
[
nodeName
][
predicateKey
][
equivalenceHash
]
return
value
,
ok
return
value
,
ok
}
}
...
@@ -192,7 +191,7 @@ func (c *Cache) InvalidatePredicates(predicateKeys sets.String) {
...
@@ -192,7 +191,7 @@ func (c *Cache) InvalidatePredicates(predicateKeys sets.String) {
delete
(
predicates
,
predicateKey
)
delete
(
predicates
,
predicateKey
)
}
}
}
}
glog
.
V
(
5
)
.
Infof
(
"
Done invalidating cached predicates: %v on all node
"
,
predicateKeys
)
glog
.
V
(
5
)
.
Infof
(
"
Cache invalidation: node=*,predicates=%v
"
,
predicateKeys
)
}
}
// InvalidatePredicatesOnNode clears cached results for the given predicates on one node.
// InvalidatePredicatesOnNode clears cached results for the given predicates on one node.
...
@@ -205,7 +204,7 @@ func (c *Cache) InvalidatePredicatesOnNode(nodeName string, predicateKeys sets.S
...
@@ -205,7 +204,7 @@ func (c *Cache) InvalidatePredicatesOnNode(nodeName string, predicateKeys sets.S
for
predicateKey
:=
range
predicateKeys
{
for
predicateKey
:=
range
predicateKeys
{
delete
(
c
.
cache
[
nodeName
],
predicateKey
)
delete
(
c
.
cache
[
nodeName
],
predicateKey
)
}
}
glog
.
V
(
5
)
.
Infof
(
"
Done invalidating cached predicates: %v on node: %s"
,
predicateKeys
,
nodeName
)
glog
.
V
(
5
)
.
Infof
(
"
Cache invalidation: node=%s,predicates=%v"
,
nodeName
,
predicateKeys
)
}
}
// InvalidateAllPredicatesOnNode clears all cached results for one node.
// InvalidateAllPredicatesOnNode clears all cached results for one node.
...
@@ -213,7 +212,7 @@ func (c *Cache) InvalidateAllPredicatesOnNode(nodeName string) {
...
@@ -213,7 +212,7 @@ func (c *Cache) InvalidateAllPredicatesOnNode(nodeName string) {
c
.
mu
.
Lock
()
c
.
mu
.
Lock
()
defer
c
.
mu
.
Unlock
()
defer
c
.
mu
.
Unlock
()
delete
(
c
.
cache
,
nodeName
)
delete
(
c
.
cache
,
nodeName
)
glog
.
V
(
5
)
.
Infof
(
"
Done invalidating all cached predicates on node: %s
"
,
nodeName
)
glog
.
V
(
5
)
.
Infof
(
"
Cache invalidation: node=%s,predicates=*
"
,
nodeName
)
}
}
// InvalidateCachedPredicateItemForPodAdd is a wrapper of
// InvalidateCachedPredicateItemForPodAdd is a wrapper of
...
...
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