Skip to content

Commit

Permalink
update passed parameter
Browse files Browse the repository at this point in the history
Signed-off-by: hwware <wen.hui.ware@gmail.com>
  • Loading branch information
hwware committed Nov 21, 2024
1 parent bc908e7 commit 3e5b507
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/evict.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ int performEvictions(void) {
int replicas = listLength(server.replicas);
int result = EVICT_FAIL;

if (getMaxmemoryState(&mem_reported, NULL, &mem_tofree, NULL, server.maxmemory) == C_OK) {
if (getMaxmemoryState(&mem_reported, NULL, &mem_tofree, NULL, server.maxmemory_soft) == C_OK) {
result = EVICT_OK;
goto update_metrics;
}
Expand Down Expand Up @@ -712,7 +712,7 @@ int performEvictions(void) {
* across the dbAsyncDelete() call, while the thread can
* release the memory all the time. */
if (server.lazyfree_lazy_eviction) {
if (getMaxmemoryState(NULL, NULL, NULL, NULL, server.maxmemory) == C_OK) {
if (getMaxmemoryState(NULL, NULL, NULL, NULL, server.maxmemory_soft) == C_OK) {
break;
}
}
Expand Down Expand Up @@ -754,7 +754,7 @@ int performEvictions(void) {
mstime_t lazyfree_latency;
latencyStartMonitor(lazyfree_latency);
while (bioPendingJobsOfType(BIO_LAZY_FREE) && elapsedUs(evictionTimer) < eviction_time_limit_us) {
if (getMaxmemoryState(NULL, NULL, NULL, NULL, server.maxmemory) == C_OK) {
if (getMaxmemoryState(NULL, NULL, NULL, NULL, server.maxmemory_soft) == C_OK) {
result = EVICT_OK;
break;
}
Expand Down
1 change: 0 additions & 1 deletion tests/unit/maxmemory.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ start_server {tags {"maxmemory" "external:skip"}} {
}

start_server {tags {"maxmemory external:skip"}} {

test "Without maxmemory small integers are shared" {
r config set maxmemory 0
r set a 1
Expand Down

0 comments on commit 3e5b507

Please sign in to comment.