Skip to content

Commit

Permalink
PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
moticless committed Sep 26, 2024
1 parent afb5252 commit e0b1b07
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ static pthread_mutex_t bio_mutex_comp;
static int job_comp_pipe[2]; /* Pipe used to awake the event loop */

typedef struct bio_comp_item {
comp_fn *func; /* callback after completion job will be processed */
uint64_t arg; /* user data to be passed to the function */
void *ptr; /* user pointer to be passed to the function */
comp_fn *func; /* callback after completion job will be processed */
uint64_t arg; /* user data to be passed to the function */
void *ptr; /* user pointer to be passed to the function */
} bio_comp_item;

/* This structure represents a background Job. It is only used locally to this
Expand Down
5 changes: 3 additions & 2 deletions src/cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -1576,8 +1576,9 @@ void replySlotsFlushAndFree(client *c, SlotsFlush *sflush) {
* flushing a single shard as a whole, but in the future the same command may be
* used to partially flush a shard based on hash slots. Currently only if provided
* slots cover entirely the slots of a node, the node will be flushed and the
* return value will be pairs of slot ranges and the node. Otherwise, a single empty
* set will be returned. If possible, SFLUSH SYNC will be run as blocking ASYNC.
* return value will be pairs of slot ranges. Otherwise, a single empty set will
* be returned. If possible, SFLUSH SYNC will be run as blocking ASYNC as an
* optimization.
*/
void sflushCommand(client *c) {
int flags = EMPTYDB_NO_FLAGS, argc = c->argc;
Expand Down
20 changes: 19 additions & 1 deletion src/commands/sflush.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,25 @@
"command_tips": [
],
"reply_schema": {
"const": "OK"
"description": "List of slot ranges",
"type": "array",
"minItems": 0,
"maxItems": 4294967295,
"items": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"items": [
{
"description": "start slot number",
"type": "integer"
},
{
"description": "end slot number",
"type": "integer"
}
]
}
},
"arguments": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ void flushAllDataAndResetRDB(int flags) {
* Utilized by commands SFLUSH, FLUSHALL and FLUSHDB.
*/
void flushallSyncBgDone(uint64_t client_id, void *sflush) {
SlotsFlush *slotsFlush = (SlotsFlush *)sflush;
SlotsFlush *slotsFlush = sflush;
client *c = lookupClientByID(client_id);

/* Verify that client still exists */
Expand Down

0 comments on commit e0b1b07

Please sign in to comment.