Dirfrags prefetch may speedup rejoin stage of mds recovery. But it may
use lots of memory and cause mds out of memory.
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
.set_default(10.0)
.set_description("rate of decay for export targets communicated to clients"),
+ Option("mds_oft_prefetch_dirfrags", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+ .set_default(true)
+ .set_description("prefetch dirfrags recorded in open file table on startup")
+ .set_flag(Option::FLAG_STARTUP),
+
Option("mds_replay_interval", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
.set_default(1.0)
.set_description("time in seconds between replay of updates to journal by standby replay MDS"),
num_opening_inodes--;
if (num_opening_inodes == 0) {
if (prefetch_state == DIR_INODES) {
- prefetch_state = DIRFRAGS;
- _prefetch_dirfrags();
+ if (g_conf().get_val<bool>("mds_oft_prefetch_dirfrags")) {
+ prefetch_state = DIRFRAGS;
+ _prefetch_dirfrags();
+ } else {
+ prefetch_state = FILE_INODES;
+ _prefetch_inodes();
+ }
} else if (prefetch_state == FILE_INODES) {
prefetch_state = DONE;
logseg_destroyed_inos.clear();