summaryrefslogtreecommitdiff
path: root/src/server.c
diff options
context:
space:
mode:
authoryoav-steinberg <yoav@monfort.co.il>2022-01-02 09:39:01 +0200
committerGitHub <noreply@github.com>2022-01-02 09:39:01 +0200
commit1bf6d6f11eb08d98ba3de688d18d805a2d8696d5 (patch)
treee808f1f65487fbeae9eeb281b1d33a1fd8baaf63 /src/server.c
parent888e92eb5797c1a6ce4c7b89c5814dbe13a8d8e3 (diff)
downloadredis-1bf6d6f11eb08d98ba3de688d18d805a2d8696d5.tar.gz
Generate RDB with Functions only via redis-cli --functions-rdb (#9968)
This is needed in order to ease the deployment of functions for ephemeral cases, where user needs to spin up a server with functions pre-loaded. #### Details: * Added `--functions-rdb` option to _redis-cli_. * Functions only rdb via `REPLCONF rdb-filter-only functions`. This is a placeholder for a space separated inclusion filter for the RDB. In the future can be `REPLCONF rdb-filter-only "functions db:3 key-patten:user*"` and a complementing `rdb-filter-exclude` `REPLCONF` can also be added. * Handle "slave requirements" specification to RDB saving code so we can use the same RDB when different slaves express the same requirements (like functions-only) and not share the RDB when their requirements differ. This is currently just a flags `int`, but can be extended to a more complex structure with various filter fields. * make sure to support filters only in diskless replication mode (not to override the persistence file), we do that by forcing diskless (even if disabled by config) other changes: * some refactoring in rdb.c (extract portion of a big function to a sub-function) * rdb_key_save_delay used in AOFRW too * sendChildInfo takes the number of updated keys (incremental, rather than absolute) Co-authored-by: Oran Agra <oran@redislabs.com>
Diffstat (limited to 'src/server.c')
-rw-r--r--src/server.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server.c b/src/server.c
index 6d531449e..a5a95d1d8 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1209,7 +1209,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
sp->changes, (int)sp->seconds);
rdbSaveInfo rsi, *rsiptr;
rsiptr = rdbPopulateSaveInfo(&rsi);
- rdbSaveBackground(server.rdb_filename,rsiptr);
+ rdbSaveBackground(SLAVE_REQ_NONE, server.rdb_filename,rsiptr);
break;
}
}
@@ -1298,7 +1298,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
{
rdbSaveInfo rsi, *rsiptr;
rsiptr = rdbPopulateSaveInfo(&rsi);
- if (rdbSaveBackground(server.rdb_filename,rsiptr) == C_OK)
+ if (rdbSaveBackground(SLAVE_REQ_NONE, server.rdb_filename,rsiptr) == C_OK)
server.rdb_bgsave_scheduled = 0;
}
@@ -3692,7 +3692,7 @@ int prepareForShutdown(int flags) {
/* Snapshotting. Perform a SYNC SAVE and exit */
rdbSaveInfo rsi, *rsiptr;
rsiptr = rdbPopulateSaveInfo(&rsi);
- if (rdbSave(server.rdb_filename,rsiptr) != C_OK) {
+ if (rdbSave(SLAVE_REQ_NONE, server.rdb_filename,rsiptr) != C_OK) {
/* Ooops.. error saving! The best we can do is to continue
* operating. Note that if there was a background saving process,
* in the next cron() Redis will be notified that the background