void FSMap::dump(Formatter *f) const
{
f->dump_int("epoch", epoch);
+ f->dump_string("btime", fmt::format("{}", btime));
// Use 'default' naming to match 'set-default' CLI
f->dump_int("default_fscid", legacy_client_fscid);
FSMap &FSMap::operator=(const FSMap &rhs)
{
epoch = rhs.epoch;
+ btime = rhs.btime;
next_filesystem_id = rhs.next_filesystem_id;
legacy_client_fscid = rhs.legacy_client_fscid;
default_compat = rhs.default_compat;
void FSMap::print(ostream& out) const
{
out << "e" << epoch << std::endl;
+ out << "btime " << fmt::format("{}", btime) << std::endl;
out << "enable_multiple, ever_enabled_multiple: " << enable_multiple << ","
<< ever_enabled_multiple << std::endl;
out << "default compat: " << default_compat << std::endl;
{
if (f) {
f->dump_unsigned("epoch", get_epoch());
+ f->dump_string("btime", fmt::format("{}", btime));
for (const auto& [fscid, fs] : filesystems) {
f->dump_unsigned("id", fscid);
f->dump_unsigned("up", fs.mds_map.up.size());
encode(standby_daemons, bl, features);
encode(standby_epochs, bl);
encode(ever_enabled_multiple, bl);
+ encode(btime, bl);
ENCODE_FINISH(bl);
}
if (struct_v >= 7) {
decode(ever_enabled_multiple, p);
}
+ if (struct_v >= 8) {
+ decode(btime, p);
+ }
DECODE_FINISH(p);
}
#include <errno.h>
#include "include/types.h"
+#include "common/ceph_time.h"
#include "common/Clock.h"
#include "mds/MDSMap.h"
class FSMap {
public:
+ using real_clock = ceph::real_clock;
using mds_info_t = MDSMap::mds_info_t;
using fsmap = typename std::map<fs_cluster_id_t, Filesystem>;
using const_iterator = typename fsmap::const_iterator;
using iterator = typename fsmap::iterator;
- static const version_t STRUCT_VERSION = 7;
+ static const version_t STRUCT_VERSION = 8;
static const version_t STRUCT_VERSION_TRIM_TO = 7;
FSMap() : default_compat(MDSMap::get_compat_set_default()) {}
FSMap(const FSMap &rhs)
:
epoch(rhs.epoch),
+ btime(rhs.btime),
next_filesystem_id(rhs.next_filesystem_id),
legacy_client_fscid(rhs.legacy_client_fscid),
default_compat(rhs.default_compat),
epoch_t get_epoch() const { return epoch; }
void inc_epoch() { epoch++; }
+ void set_btime() {
+ btime = real_clock::now();
+ }
+ auto get_btime() const {
+ return btime;
+ }
+
version_t get_struct_version() const { return struct_version; }
bool is_struct_old() const {
return struct_version < STRUCT_VERSION_TRIM_TO;
}
epoch_t epoch = 0;
+ ceph::real_time btime = real_clock::zero();
+
uint64_t next_filesystem_id = FS_CLUSTER_ID_ANONYMOUS + 1;
fs_cluster_id_t legacy_client_fscid = FS_CLUSTER_ID_NONE;
CompatSet default_compat;