Commit a8b2fcf 1 parent e1ac5dd commit a8b2fcf Copy full SHA for a8b2fcf
File tree 1 file changed +37
-0
lines changed
1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,43 @@ class MetaDumper {
33
33
}
34
34
35
35
std::string prefix;
36
+ {
37
+ LOG (INFO) << " ------------------------------------------\n\n " ;
38
+ LOG (INFO) << " Meta version:" ;
39
+ enum class MetaVersion {
40
+ UNKNOWN = 0 ,
41
+ V1 = 1 ,
42
+ V2 = 2 ,
43
+ V3 = 3 ,
44
+ };
45
+
46
+ prefix = " __meta_version__" ;
47
+ iter->Seek (rocksdb::Slice (prefix));
48
+ bool found = false ;
49
+ while (iter->Valid () && iter->key ().starts_with (prefix)) {
50
+ auto version = *reinterpret_cast <const MetaVersion*>(iter->value ().data ());
51
+ found = true ;
52
+ LOG (INFO) << " Meta version=" << static_cast <int >(version);
53
+ break ;
54
+ }
55
+
56
+ if (!found) {
57
+ prefix = MetaKeyUtils::hostPrefix ();
58
+ iter->Seek (rocksdb::Slice (prefix));
59
+ while (iter->Valid () && iter->key ().starts_with (prefix)) {
60
+ found = true ;
61
+ auto v1KeySize = prefix.size () + sizeof (int64_t );
62
+ auto version = (iter->key ().size () == v1KeySize) ? MetaVersion::V1 : MetaVersion::V3;
63
+ LOG (INFO) << " Meta version=" << static_cast <int >(version);
64
+ iter->Next ();
65
+ break ;
66
+ }
67
+
68
+ if (!found) {
69
+ LOG (INFO) << " Meta version= Unkown" ;
70
+ }
71
+ }
72
+ }
36
73
{
37
74
LOG (INFO) << " ------------------------------------------\n\n " ;
38
75
LOG (INFO) << " Space info:" ;
You can’t perform that action at this time.
0 commit comments