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

Support for implementing Defrag Module type callback using existing Module APIs #98

Open
KarthikSubbarao opened this issue Sep 19, 2024 · 1 comment

Comments

@KarthikSubbarao
Copy link
Member

KarthikSubbarao commented Sep 19, 2024

The Module data types provide a callback for defragmentation and this is called when the active defrag is in progress.

For modules to implement the defrag callback, we will need wrapper functions in the valkeymodule-rs SDK written around the following existing Module APIs:

Higher priority:

ValkeyModule_DefragAlloc
ValkeyModule_DefragCursorSet
ValkeyModule_DefragCursorGet

Medium priority:

ValkeyModule_DefragShouldStop

Lower priority:

ValkeyModule_DefragValkeyModuleString
ValkeyModule_GetDbIdFromDefragCtx
ValkeyModule_RegisterDefragFunc
ValkeyModule_GetKeyNameFromDefragCtx

Example Valkey Module in C implementing the defragmentation callback: https://github.com/valkey-io/valkey/blob/4593dc2f059661e1c4eb43bba025f68948344228/tests/modules/defragtest.c#L143-L193

@hahnandrew
Copy link

Happy to pick this up 😄

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

No branches or pull requests

2 participants