Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure correct compression for a node that was too small to compress but grows larger #13121

Open
wants to merge 5 commits into
base: unstable
Choose a base branch
from

Conversation

sundb
Copy link
Collaborator

@sundb sundb commented Mar 8, 2024

Following #12568
Discussion in #12568 (comment)

When a node needs to be compressed but is too small to be compressed, if this node becomes big enough to be compressed, it should be correctly compressed.

Reproduction:
When we use quicklistDecompressNodeForUse() to decompress the node mentioned above, recompress
will be 0, thus when quicklistRecompressOnly() is used to recompress this node, it will not be recompressed again anyway.

Solution:
Enable the attempted_compress feature, no longer used only in REDIS_TEST.
When it is true, it means that the node needs to be compressed but failed.

When a node is compressed but fails, set attempted_compress to 1.
When using quicklistDecompressNodeForUse() and attempted_compress is 1, we will set recompress to 1, ensuring that when calling quicklistRecompressOnly(), this node can be correctly compressed.

@CLAassistant
Copy link

CLAassistant commented Mar 24, 2024

CLA assistant check
All committers have signed the CLA.

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.

None yet

2 participants