The problem/use-case that the feature addresses In RedisGraph we use virtual keys solution for replication of large keys In that case when replication the data BGSAVE can be run in an intermediate state for example for backup and this backup is useless
A description of the problem that the feature will solve, or the use-case with which the feature will be used. In case any module identify situation running BGSAVE we can abort in gracefully currently the suggested solution by @yossigo is call exit(255)
Description of the feature Adding an API RedisModule_AbortBGSave
A description of what you want to happen. be able to abort bgsave gracefully
Alternatives you've considered being able to abort before forking the process
Additional information
Comment From: yossigo
Providing some additional information, because I don't think the top comment makes it clear.
It is possible for a module to be in a temporary state where it wishes to avoid serialization of data (i.e. explicit BGSAVE, full sync disk/disk-less replication or even AOF rewrite), because data serialized in this special state may be inconsistent.
One way to address this is for the module to simple exit(255) instead of providing serialized payloads. The downsides to this approach, however, are:
* It's not a clean, documented and API-based approach
* It may not be very efficient
An alternative is to let modules hook into the process of deciding if it's OK to fork (where hasActiveChildProcess() is consulted) and block the process before it begins, possibly even providing meaningful error messages where applicable.