fprintf(f, "dmaster: %u\n", h->dmaster);
fprintf(f, "rsn: %llu\n", (unsigned long long)h->rsn);
+
+ if (c->printlmaster && ctdb->vnn_map != NULL) {
+ fprintf(f, "lmaster: %u\n", ctdb_lmaster(ctdb, &key));
+ }
+
fprintf(f, "flags: 0x%08x", h->flags);
if (h->flags & CTDB_REC_FLAG_MIGRATED_WITH_DATA) printf(" MIGRATED_WITH_DATA");
if (h->flags & CTDB_REC_FLAG_VACUUM_MIGRATED) printf(" VACUUM_MIGRATED");
int maxruntime;
int printemptyrecords;
int printdatasize;
+ int printlmaster;
} options;
#define TIMELIMIT() timeval_current_ofs(options.timelimit, 0)
return -1;
}
+ if (options.printlmaster) {
+ ret = ctdb_ctrl_getvnnmap(ctdb, TIMELIMIT(), options.pnn,
+ ctdb, &ctdb->vnn_map);
+ if (ret != 0) {
+ DEBUG(DEBUG_ERR, ("Unable to get vnnmap from node %u\n",
+ options.pnn));
+ return ret;
+ }
+ }
+
ZERO_STRUCT(c);
c.f = stdout;
c.printemptyrecords = (bool)options.printemptyrecords;
c.printdatasize = (bool)options.printdatasize;
+ c.printlmaster = (bool)options.printlmaster;
/* traverse and dump the cluster tdb */
ret = ctdb_dump_db(ctdb_db, &c);
c.f = stdout;
c.printemptyrecords = (bool)options.printemptyrecords;
c.printdatasize = (bool)options.printdatasize;
+ c.printlmaster = false;
return ctdb_dumpdb_record(d->ctdb, key, data, &c);
}
c.f = stdout;
c.printemptyrecords = (bool)options.printemptyrecords;
c.printdatasize = (bool)options.printdatasize;
+ c.printlmaster = false;
for (i=0; i < m->count; i++) {
uint32_t reqid = 0;
{ "maxruntime", 'T', POPT_ARG_INT, &options.maxruntime, 0, "die if runtime exceeds this limit (in seconds)", "integer" },
{ "print-emptyrecords", 0, POPT_ARG_NONE, &options.printemptyrecords, 0, "print the empty records when dumping databases (catdb, cattdb, dumpdbbackup)", NULL },
{ "print-datasize", 0, POPT_ARG_NONE, &options.printdatasize, 0, "do not print record data when dumping databases, only the data size", NULL },
+ { "print-lmaster", 0, POPT_ARG_NONE, &options.printlmaster, 0, "print the record's lmaster in catdb", NULL },
POPT_TABLEEND
};
int opt;