Skip to content

[CLEAN] Synthetic Benchmark PR #14283 - Redis 8.2.1#83

Open
ofir-frd wants to merge 3 commits intobase_pr_14283_20260121_9070from
clean_pr_14283_20260121_9070
Open

[CLEAN] Synthetic Benchmark PR #14283 - Redis 8.2.1#83
ofir-frd wants to merge 3 commits intobase_pr_14283_20260121_9070from
clean_pr_14283_20260121_9070

Conversation

@ofir-frd
Copy link

Benchmark PR redis#14283

Type: Clean (correct implementation)

Original PR Title: Redis 8.2.1
Original PR Description: ### Bug fixes

Performance and resource utilization

sundb and others added 3 commits January 21, 2026 10:29
…s#14274)

Fix redis#14267
This bug was introduced by redis#13495

### Summary

When a replica clears a large database, it periodically calls
processEventsWhileBlocked() in the replicationEmptyDbCallback() callback
during the key deletion process.
If defragmentation is enabled, this means that active defrag can be
triggered while the database is being deleted.
The defragmentation process may also modify the database at this time,
which could lead to crashes when the database is accessed after
defragmentation.

Code Path:
```
replicationEmptyDbCallback() -> processEventsWhileBlocked() -> whileBlockedCron() -> defragWhileBlocked()
```

### Solution

This PR temporarily disables active defrag before emptying the database,
then restores the active defrag setting after the empty is complete.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…fter reload (redis#14276)

This bug was introduced by redis#14130
found by @oranagra

### Summary

Because `s->cgroup_ref` is created at runtime the first time a consumer
group is linked with a message, but it is not released when all
references are removed.

However, after `debug reload` or restart, if the PEL is empty (meaning
no consumer group is referencing any message), `s->cgroup_ref` will not
be recreated.

As a result, when executing XADD or XTRIM with `ACKED` option and
checking whether a message that is being read but has not been ACKed can
be deleted, the cgroup_ref being NULL will cause a crash.

### Code Path
```
xaddCommand -> streamTrim -> streamEntryIsReferenced
```

### Solution

Check if `s->cgroup_ref` is NULL in streamEntryIsReferenced().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments