The problem/use-case that the feature addresses

The returned status code may signal an error at the execution stage of the method, but neither in the body of the previously mentioned one, https://github.com/redis/redis/blob/d86cf6610144249f846f3358ea8cc1cf6409b3e8/src/rdb.c#L1599-L1640 nor at the stage of calling the flushAllDataAndResetRDB() method https://github.com/redis/redis/blob/d86cf6610144249f846f3358ea8cc1cf6409b3e8/src/db.c#L1017 , the return value is not checked, https://github.com/redis/redis/blob/d86cf6610144249f846f3358ea8cc1cf6409b3e8/src/db.c#L1023 which can lead to undefined behavior.

Description of the feature

Adding a return value check

Alternatives you've considered

--

Additional information

I do not exclude that the method will work correctly due to the correctness of the structural and correct filling of the arguments, however, in order to avoid errors I see it advisable to add a check.

Comment From: sundb

@LM4O322 The only risk I can think of is that the user's execution of the flush command might not clear the rdb. However, if it fails, rdbsave will write to the failure log. we need to note that the data has already been cleared at this time, so the options for error handling are limited.