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

RESP2REDIS: Should not fail trying to load empty module #53

Merged
merged 3 commits into from
Aug 11, 2024

Conversation

moticless
Copy link
Collaborator

@moticless moticless commented Aug 8, 2024

If RDB2RESP was configured to "supportRestoreModuleAux" and generates
RESTOREMODAUX commands, currently relevant only to Redis enterprise,
then if RDB was generated by a server with some module, but user didn't
make any use of that module, attempting to play it to another server that
wasn't loaded with that module, the RDB parser will get fail. This is because
the module always store something in the AUX field, and the RDB parser will try
to load it.

In order to overcome this issue, A module that its AUX payload is less than
15 Bytes (including RDB version and checksum) counted as AUX field of an empty
Module (not in use), then the parser, when restoring the empty module, it
should ignore returned error: "-ERR Module X not found..."

Few changes were made to support it:

  • Propagate restoreSize to RESP2REDIS handlers.
  • ReaderResp gets now error-callback which can indicate to mask given error.
  • RESP2REDIS indicates to ignore RESTOREMODAUX error message of type "-ERR Module .. not found ..."
  • Added tests accordingly.

Additionally added timeout to recv() from redis to avoid blocking forever. Irrelevant to this fix.

Copy link
Member

@oranagra oranagra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed by Yaacov

@moticless moticless merged commit efff6b5 into redis:main Aug 11, 2024
2 checks passed
@moticless moticless deleted the resp2redis-ignore-empty-module-err branch August 11, 2024 08:12
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