mirror of
https://github.com/ceph/ceph
synced 2025-02-07 19:03:18 +00:00
ObjectStore: Add "need_journal" interface to make aware of journal device
Impl feature #9580 Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
This commit is contained in:
parent
ccf3e06a7c
commit
2955b3da4e
@ -107,6 +107,7 @@ int main(int argc, const char **argv)
|
||||
bool get_journal_fsid = false;
|
||||
bool get_osd_fsid = false;
|
||||
bool get_cluster_fsid = false;
|
||||
bool check_need_journal = false;
|
||||
std::string dump_pg_log;
|
||||
|
||||
std::string val;
|
||||
@ -136,6 +137,8 @@ int main(int argc, const char **argv)
|
||||
get_osd_fsid = true;
|
||||
} else if (ceph_argparse_flag(args, i, "--get-journal-fsid", "--get-journal-uuid", (char*)NULL)) {
|
||||
get_journal_fsid = true;
|
||||
} else if (ceph_argparse_flag(args, i, "--check-needs-journal", (char*)NULL)) {
|
||||
check_need_journal = true;
|
||||
} else {
|
||||
++i;
|
||||
}
|
||||
@ -308,6 +311,14 @@ int main(int argc, const char **argv)
|
||||
exit(r);
|
||||
}
|
||||
|
||||
if (check_need_journal) {
|
||||
if (store->check_need_journal())
|
||||
cout << "yes" << std::endl;
|
||||
else
|
||||
cout << "no" << std::endl;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
string magic;
|
||||
uuid_d cluster_fsid, osd_fsid;
|
||||
int w;
|
||||
|
@ -96,6 +96,7 @@ public:
|
||||
return target_version;
|
||||
}
|
||||
|
||||
bool need_journal() { return true; }
|
||||
int peek_journal_fsid(uuid_d *fsid);
|
||||
|
||||
struct FSPerfTracker {
|
||||
|
@ -484,6 +484,7 @@ class KeyValueStore : public ObjectStore,
|
||||
uint32_t get_target_version() {
|
||||
return target_version;
|
||||
}
|
||||
bool need_journal() { return false; };
|
||||
int peek_journal_fsid(uuid_d *id) {
|
||||
*id = fsid;
|
||||
return 0;
|
||||
|
@ -242,6 +242,7 @@ public:
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool need_journal() { return false; };
|
||||
int peek_journal_fsid(uuid_d *fsid);
|
||||
|
||||
bool test_mount_in_use() {
|
||||
|
@ -1248,6 +1248,14 @@ public:
|
||||
*/
|
||||
virtual uint32_t get_target_version() = 0;
|
||||
|
||||
/**
|
||||
* check whether need journal device
|
||||
*
|
||||
* It's not constant for backend store. FileStore could have journaless mode
|
||||
* and KeyValueStore could have journal device for special backend.
|
||||
*/
|
||||
virtual bool need_journal() = 0;
|
||||
|
||||
/**
|
||||
* check the journal uuid/fsid, without opening
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user