Repository navigation
fix(redis): preserve pending RDB writes on graceful shutdown (0.9.0) - #158
Merged
sciabarracom merged 1 commit intoNov 4, 2026
Merged
Conversation
sciabarracom
approved these changes
Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Redis currently runs as a child of a shell that remains process 1. During an ordinary Kubernetes pod deletion, Redis does not receive the stop signal and cannot complete its final RDB save. Pending acknowledged writes can therefore be lost when the grace period expires.
Fixes apache/openserverless#284. This is separate from the ACL persistence work in #157 and is based directly on Apache
0.9.0.Change
Add
execto the Redis command in both the deployment manifest and the operator template, so Redis becomes process 1. Image version, config path, storage layout, RDB/AOF settings and permissions are unchanged.The regression test runs each manifest's configured entrypoint with a controlled server process and verifies that a stop signal reaches that server and permits a clean exit. Both original manifests fail this test; the corrected manifests pass.
Validation
execexits 0, logs SIGTERM and the final RDB save, and preserves the write. ExplicitSHUTDOWN SAVEand deliberateSIGKILLcontrols distinguish this defect from the normal RDB crash window.SHUTDOWN SAVEduring the first transition from the defective command. A subsequent ordinary Redis pod replacement, with a newly acknowledged write and no intervening manual save, exits 0 in 0.9 seconds and preserves the write.deploy.tarRedis manifest and the mounted deployment file were verified to contain the same fix. The baseline image retains its existing local fixes, including the ACL candidate; it is not a pristine upstream-image test.Full Kind integration is left to CI. The live tests used small synthetic records, not a production-sized dataset.
Existing installations
The updated Redis StatefulSet command must be applied through the component deployment procedure; replacing only the operator image does not rewrite an existing StatefulSet. The documented first rollout from the old shell command requires an authenticated
SHUTDOWN SAVEbefore the old process can be forcibly terminated. Subsequent ordinary replacements use the corrected signal path.This does not eliminate the RDB loss window after a hard crash or
SIGKILL. The termination grace period must still be sufficient to save the actual dataset.