Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
47ce1ceb
Unverified
Commit
47ce1ceb
authored
Jul 23, 2019
by
Salvatore Sanfilippo
Committed by
GitHub
Jul 23, 2019
Browse files
Merge pull request #6267 from soloestoy/opt-claim-trackingtable
Client side caching: do not reclaim tracking table if it's empty
parents
c41f94d2
9012e587
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/tracking.c
View file @
47ce1ceb
...
@@ -206,8 +206,6 @@ void trackingInvalidateKey(robj *keyobj) {
...
@@ -206,8 +206,6 @@ void trackingInvalidateKey(robj *keyobj) {
* flush the table: it will slowly get garbage collected as more keys
* flush the table: it will slowly get garbage collected as more keys
* are modified in the used caching slots. */
* are modified in the used caching slots. */
void
trackingInvalidateKeysOnFlush
(
int
dbid
)
{
void
trackingInvalidateKeysOnFlush
(
int
dbid
)
{
UNUSED
(
dbid
);
if
(
server
.
tracking_clients
)
{
if
(
server
.
tracking_clients
)
{
listNode
*
ln
;
listNode
*
ln
;
listIter
li
;
listIter
li
;
...
@@ -222,12 +220,11 @@ void trackingInvalidateKeysOnFlush(int dbid) {
...
@@ -222,12 +220,11 @@ void trackingInvalidateKeysOnFlush(int dbid) {
/* In case of FLUSHALL, reclaim all the memory used by tracking. */
/* In case of FLUSHALL, reclaim all the memory used by tracking. */
if
(
dbid
==
-
1
&&
TrackingTable
)
{
if
(
dbid
==
-
1
&&
TrackingTable
)
{
for
(
int
j
=
0
;
j
<
TRACKING_TABLE_SIZE
;
j
++
)
{
for
(
int
j
=
0
;
j
<
TRACKING_TABLE_SIZE
&&
TrackingTableUsedSlots
>
0
;
j
++
)
{
if
(
TrackingTable
[
j
]
!=
NULL
)
{
if
(
TrackingTable
[
j
]
!=
NULL
)
{
raxFree
(
TrackingTable
[
j
]);
raxFree
(
TrackingTable
[
j
]);
TrackingTable
[
j
]
=
NULL
;
TrackingTable
[
j
]
=
NULL
;
TrackingTableUsedSlots
--
;
TrackingTableUsedSlots
--
;
if
(
TrackingTableUsedSlots
==
0
)
break
;
}
}
}
}
...
...
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