Unverified Commit 2c41b135 authored by Binbin's avatar Binbin Committed by GitHub
Browse files

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.
parent 4278ed8d
...@@ -716,6 +716,11 @@ NULL ...@@ -716,6 +716,11 @@ NULL
if (getPositiveLongFromObjectOrReply(c, c->argv[2], &keys, NULL) != C_OK) if (getPositiveLongFromObjectOrReply(c, c->argv[2], &keys, NULL) != C_OK)
return; return;
if (server.loading || server.async_loading) {
addReplyErrorObject(c, shared.loadingerr);
return;
}
if (dbExpand(c->db, keys, DB_MAIN, 1) == C_ERR) { if (dbExpand(c->db, keys, DB_MAIN, 1) == C_ERR) {
addReplyError(c, "OOM in dictTryExpand"); addReplyError(c, "OOM in dictTryExpand");
return; return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment