"show cache status");
ceph_assert(r == 0);
r = admin_socket->register_command("cache drop",
- "cache drop name=timeout,type=CephInt,range=1",
+ "cache drop name=timeout,type=CephInt,range=0,req=false",
asok_hook,
"drop cache");
ceph_assert(r == 0);
MDSCommand("heap "
"name=heapcmd,type=CephChoices,strings=dump|start_profiler|stop_profiler|release|stats",
"show heap usage info (available only if compiled with tcmalloc)"),
- MDSCommand("cache drop name=timeout,type=CephInt,range=1", "trim cache and optionally request client to release all caps and flush the journal"),
+ MDSCommand("cache drop name=timeout,type=CephInt,range=0,req=false", "trim cache and optionally request client to release all caps and flush the journal"),
};
return commands;
};
}
void start_timer() {
+ if (!timeout) {
+ return;
+ }
+
timer_task = new FunctionContext([this](int _) {
timer_task = nullptr;
complete(-ETIMEDOUT);
} else if (command == "cache drop") {
int64_t timeout;
if (!cmd_getval(g_ceph_context, cmdmap, "timeout", timeout)) {
- return false;
+ timeout = 0;
}
C_SaferCond cond;
} else if (prefix == "cache drop") {
int64_t timeout;
if (!cmd_getval(g_ceph_context, cmdmap, "timeout", timeout)) {
- return false;
+ timeout = 0;
}
JSONFormatter *f = new JSONFormatter(true);