kInAtomicGroup = 300,
};
+// Mask for an identified tag from the future which can be safely ignored.
+uint32_t kTagSafeIgnoreMask = 1 << 13;
+
enum CustomTag : uint32_t {
kTerminate = 1, // The end of customized fields
kNeedCompaction = 2,
break;
}
if (!GetLengthPrefixedSlice(input, &field)) {
- return "new-file4 custom field lenth prefixed slice error";
+ return "new-file4 custom field length prefixed slice error";
}
switch (custom_tag) {
case kPathId:
break;
default:
- msg = "unknown tag";
+ if (tag & kTagSafeIgnoreMask) {
+ // Tag from future which can be safely ignored.
+ // The next field must be the length of the entry.
+ uint32_t field_len;
+ if (!GetVarint32(&input, &field_len) ||
+ static_cast<size_t>(field_len) > input.size()) {
+ if (!msg) {
+ msg = "safely ignoreable tag length error";
+ }
+ } else {
+ input.remove_prefix(static_cast<size_t>(field_len));
+ }
+ } else {
+ msg = "unknown tag";
+ }
break;
}
}
AppendNumberTo(&r, max_column_family_);
}
if (is_in_atomic_group_) {
- r.append("\n AtomicGroup: ");
+ r.append("\n AtomicGroup: ");
AppendNumberTo(&r, remaining_entries_);
r.append(" entries remains");
}