Block DEBUG POPULATE in loading and async-loading (#12790)

When we are loading data, it is not safe to generate data
through DEBUG POPULATE. POPULATE may generate keys, causing
panic when loading data with duplicate keys.
This commit is contained in:
Binbin 2023-11-21 23:00:27 +08:00 committed by GitHub
parent 4278ed8de5
commit 2c41b13505
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -716,6 +716,11 @@ NULL
if (getPositiveLongFromObjectOrReply(c, c->argv[2], &keys, NULL) != C_OK)
return;
if (server.loading || server.async_loading) {
addReplyErrorObject(c, shared.loadingerr);
return;
}
if (dbExpand(c->db, keys, DB_MAIN, 1) == C_ERR) {
addReplyError(c, "OOM in dictTryExpand");
return;