"ec_hash_error",
"ec_size_error",
"oi_attr_missing",
- "oi_attr_corrupted"
+ "oi_attr_corrupted",
+ "obj_size_oi_mismatch"
]
},
"minItems": 0,
"ec_hash_error",
"ec_size_error",
"oi_attr_missing",
- "oi_attr_corrupted"
+ "oi_attr_corrupted",
+ "obj_size_oi_mismatch"
]
},
"minItems": 0,
{
"size": 9,
"errors": [
- "size_mismatch_oi"
+ "size_mismatch_oi",
+ "obj_size_oi_mismatch"
],
"osd": 1,
"primary": true
],
"selected_object_info": "3:ce3f1d6a:::ROBJ1:head(47'54 osd.0.0:53 dirty|omap|data_digest|omap_digest s 7 uv 3 dd 2ddbf8f5 od f5fba2c6 alloc_hint [0 0 0])",
"union_shard_errors": [
- "size_mismatch_oi"
+ "size_mismatch_oi",
+ "obj_size_oi_mismatch"
],
"errors": [
"size_mismatch"
"shards": [
{
"size": 7,
+ "attrs": [
+ {
+ "Base64": false,
+ "value": "",
+ "name": "_"
+ },
+ {
+ "Base64": true,
+ "value": "AwIdAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
+ "name": "snapset"
+ }
+ ],
"errors": [
"oi_attr_corrupted"
],
},
{
"size": 7,
+ "attrs": [
+ {
+ "Base64": true,
+ "value": "AwIdAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
+ "name": "snapset"
+ }
+ ],
"errors": [
"oi_attr_missing"
],
"union_shard_errors": [
"oi_attr_missing"
],
- "errors": [
- "attr_name_mismatch"
- ],
+ "errors": [],
"object": {
"version": 45,
"snap": "head",
{
"shards": [
{
- "attrs": [
- {
- "Base64": true,
- "value": "",
- "name": "_"
- },
- {
- "Base64": true,
- "value": "AwIdAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
- "name": "snapset"
- }
- ],
"object_info": "3:ffdb2004:::ROBJ9:head(102'63 client.4433.0:1 dirty|omap|data_digest|omap_digest s 1 uv 63 dd 2b63260d od 2eecc539 alloc_hint [0 0 0])",
"size": 1,
"errors": [],
"primary": false
},
{
- "attrs": [
- {
- "Base64": true,
- "value": "",
- "name": "_"
- },
- {
- "Base64": true,
- "value": "AwIdAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
- "name": "snapset"
- }
- ],
"object_info": "3:ffdb2004:::ROBJ9:head(47'60 osd.0.0:59 dirty|omap|data_digest|omap_digest s 7 uv 27 dd 2ddbf8f5 od 2eecc539 alloc_hint [0 0 0])",
"size": 1,
- "errors": [],
+ "errors": [
+ "obj_size_oi_mismatch"
+ ],
"osd": 1,
"primary": true
}
],
"selected_object_info": "3:ffdb2004:::ROBJ9:head(102'63 client.4433.0:1 dirty|omap|data_digest|omap_digest s 1 uv 63 dd 2b63260d od 2eecc539 alloc_hint [0 0 0])",
- "union_shard_errors": [],
+ "union_shard_errors": [
+ "obj_size_oi_mismatch"
+ ],
"errors": [
- "object_info_inconsistency",
- "attr_value_mismatch"
+ "object_info_inconsistency"
],
"object": {
"version": 63,
"size": 9,
"errors": [
"data_digest_mismatch_oi",
- "size_mismatch_oi"
+ "size_mismatch_oi",
+ "obj_size_oi_mismatch"
],
"osd": 1,
"primary": true
"selected_object_info": "3:ce3f1d6a:::ROBJ1:head(47'54 osd.0.0:53 dirty|omap|data_digest|omap_digest s 7 uv 3 dd 2ddbf8f5 od f5fba2c6 alloc_hint [0 0 0])",
"union_shard_errors": [
"data_digest_mismatch_oi",
- "size_mismatch_oi"
+ "size_mismatch_oi",
+ "obj_size_oi_mismatch"
],
"errors": [
"data_digest_mismatch",
{
"shards": [
{
+ "attrs": [
+ {
+ "Base64": false,
+ "value": "",
+ "name": "_"
+ },
+ {
+ "Base64": true,
+ "value": "AwIdAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
+ "name": "snapset"
+ }
+ ],
"data_digest": "0x2ddbf8f5",
"omap_digest": "0x4f14f849",
"size": 7,
"primary": false
},
{
+ "attrs": [
+ {
+ "Base64": true,
+ "value": "AwIdAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
+ "name": "snapset"
+ }
+ ],
"data_digest": "0x2ddbf8f5",
"omap_digest": "0x4f14f849",
"size": 7,
"union_shard_errors": [
"oi_attr_missing"
],
- "errors": [
- "attr_name_mismatch"
- ],
+ "errors": [],
"object": {
"version": 45,
"snap": "head",
{
"shards": [
{
- "attrs": [
- {
- "Base64": true,
- "value": "",
- "name": "_"
- },
- {
- "Base64": true,
- "value": "AwIdAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
- "name": "snapset"
- }
- ],
"object_info": "3:ffdb2004:::ROBJ9:head(47'60 osd.0.0:59 dirty|omap|data_digest|omap_digest s 7 uv 27 dd 2ddbf8f5 od 2eecc539 alloc_hint [0 0 0])",
"data_digest": "0x1f26fb26",
"omap_digest": "0x2eecc539",
"size": 3,
- "errors": [],
+ "errors": [
+ "obj_size_oi_mismatch"
+ ],
"osd": 0,
"primary": false
},
{
- "attrs": [
- {
- "Base64": true,
- "value": "",
- "name": "_"
- },
- {
- "Base64": true,
- "value": "AwIdAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
- "name": "snapset"
- }
- ],
"object_info": "3:ffdb2004:::ROBJ9:head(122'64 client.4532.0:1 dirty|omap|data_digest|omap_digest s 3 uv 64 dd 1f26fb26 od 2eecc539 alloc_hint [0 0 0])",
"data_digest": "0x1f26fb26",
"omap_digest": "0x2eecc539",
}
],
"selected_object_info": "3:ffdb2004:::ROBJ9:head(122'64 client.4532.0:1 dirty|omap|data_digest|omap_digest s 3 uv 64 dd 1f26fb26 od 2eecc539 alloc_hint [0 0 0])",
- "union_shard_errors": [],
+ "union_shard_errors": [
+ "obj_size_oi_mismatch"
+ ],
"errors": [
- "object_info_inconsistency",
- "attr_value_mismatch"
+ "object_info_inconsistency"
],
"object": {
"version": 64,
"size": 9,
"shard": 0,
"errors": [
- "size_mismatch_oi"
+ "size_mismatch_oi",
+ "obj_size_oi_mismatch"
],
"osd": 1,
"primary": true
],
"selected_object_info": "3:9175b684:::EOBJ1:head(21'1 client.4179.0:1 dirty|data_digest|omap_digest s 7 uv 1 dd 2ddbf8f5 od ffffffff alloc_hint [0 0 0])",
"union_shard_errors": [
- "size_mismatch_oi"
+ "size_mismatch_oi",
+ "obj_size_oi_mismatch"
],
"errors": [
"size_mismatch"
"size": 4096,
"shard": 0,
"errors": [
- "size_mismatch_oi"
+ "size_mismatch_oi",
+ "obj_size_oi_mismatch"
],
"osd": 1,
"primary": true
],
"selected_object_info": "3:8549dfb5:::EOBJ5:head(65'7 client.4441.0:1 dirty|data_digest|omap_digest s 7 uv 7 dd 2ddbf8f5 od ffffffff alloc_hint [0 0 0])",
"union_shard_errors": [
- "size_mismatch_oi"
+ "size_mismatch_oi",
+ "obj_size_oi_mismatch"
],
"errors": [
"size_mismatch"
"shard": 0,
"errors": [
"read_error",
- "size_mismatch_oi"
+ "size_mismatch_oi",
+ "obj_size_oi_mismatch"
],
"osd": 1,
"primary": true
"selected_object_info": "3:9175b684:::EOBJ1:head(27'1 client.4155.0:1 dirty|data_digest|omap_digest s 7 uv 1 dd 2ddbf8f5 od ffffffff alloc_hint [0 0 0])",
"union_shard_errors": [
"read_error",
- "size_mismatch_oi"
+ "size_mismatch_oi",
+ "obj_size_oi_mismatch"
],
"errors": [
"size_mismatch"
"omap_digest": "0xffffffff",
"size": 4096,
"errors": [
- "size_mismatch_oi"
+ "size_mismatch_oi",
+ "obj_size_oi_mismatch"
],
"shard": 0,
"osd": 1,
],
"selected_object_info": "3:8549dfb5:::EOBJ5:head(65'7 client.4288.0:1 dirty|data_digest|omap_digest s 7 uv 7 dd 2ddbf8f5 od ffffffff alloc_hint [0 0 0])",
"union_shard_errors": [
- "size_mismatch_oi"
+ "size_mismatch_oi",
+ "obj_size_oi_mismatch"
],
"errors": [
"size_mismatch"
"shard": 0,
"errors": [
"read_error",
- "size_mismatch_oi"
+ "size_mismatch_oi",
+ "obj_size_oi_mismatch"
],
"osd": 1,
"primary": true
"selected_object_info": "3:9175b684:::EOBJ1:head(21'1 client.4179.0:1 dirty|data_digest|omap_digest s 7 uv 1 dd 2ddbf8f5 od ffffffff alloc_hint [0 0 0])",
"union_shard_errors": [
"read_error",
- "size_mismatch_oi"
+ "size_mismatch_oi",
+ "obj_size_oi_mismatch"
],
"errors": [
"size_mismatch"
"shard": 0,
"errors": [
"size_mismatch_oi",
- "ec_size_error"
+ "ec_size_error",
+ "obj_size_oi_mismatch"
],
"osd": 1,
"primary": true
"selected_object_info": "3:8549dfb5:::EOBJ5:head(65'7 client.4441.0:1 dirty|data_digest|omap_digest s 7 uv 7 dd 2ddbf8f5 od ffffffff alloc_hint [0 0 0])",
"union_shard_errors": [
"size_mismatch_oi",
- "ec_size_error"
+ "ec_size_error",
+ "obj_size_oi_mismatch"
],
"errors": [
"size_mismatch"
void set_ss_attr_corrupted() {
errors |= err_t::SS_ATTR_CORRUPTED;
}
+ void set_obj_size_oi_mismatch() {
+ errors |= err_t::OBJ_SIZE_OI_MISMATCH;
+ }
void encode(bufferlist& bl) const;
void decode(bufferlist::iterator& bp);
};
OI_ATTR_MISSING = 1 << 14,
OI_ATTR_CORRUPTED = 1 << 15,
SS_ATTR_MISSING = 1 << 16,
- SS_ATTR_CORRUPTED = 1 << 17
+ SS_ATTR_CORRUPTED = 1 << 17,
+ OBJ_SIZE_OI_MISMATCH = 1 << 18
// When adding more here add to either SHALLOW_ERRORS or DEEP_ERRORS
};
uint64_t errors = 0;
- static constexpr uint64_t SHALLOW_ERRORS = SHARD_MISSING|SHARD_STAT_ERR|SIZE_MISMATCH_OI|OI_ATTR_MISSING|OI_ATTR_CORRUPTED|SS_ATTR_MISSING|SS_ATTR_CORRUPTED;
+ static constexpr uint64_t SHALLOW_ERRORS = SHARD_MISSING|SHARD_STAT_ERR|SIZE_MISMATCH_OI|OI_ATTR_MISSING|OI_ATTR_CORRUPTED|SS_ATTR_MISSING|SS_ATTR_CORRUPTED|OBJ_SIZE_OI_MISMATCH;
static constexpr uint64_t DEEP_ERRORS = SHARD_READ_ERR|DATA_DIGEST_MISMATCH_OI|OMAP_DIGEST_MISMATCH_OI|SHARD_EC_HASH_MISMATCH|SHARD_EC_SIZE_MISMATCH;
bool has_shard_missing() const {
return errors & SHARD_MISSING;
bool has_deep_errors() const {
return errors & DEEP_ERRORS;
}
+ bool has_obj_size_oi_mismatch() const {
+ return errors & OBJ_SIZE_OI_MISMATCH;
+ }
};
struct shard_info_t : err_t {
for (map<string,bufferptr>::const_iterator i = auth.attrs.begin();
i != auth.attrs.end();
++i) {
+ // We check system keys seperately
+ if (i->first == OI_ATTR || i->first == SS_ATTR)
+ continue;
if (!candidate.attrs.count(i->first)) {
if (error != CLEAN)
errorstream << ", ";
for (map<string,bufferptr>::const_iterator i = candidate.attrs.begin();
i != candidate.attrs.end();
++i) {
+ // We check system keys seperately
+ if (i->first == OI_ATTR || i->first == SS_ATTR)
+ continue;
if (!auth.attrs.count(i->first)) {
if (error != CLEAN)
errorstream << ", ";
error_string += " object_info_inconsistency";
}
- // Don't use this particular shard because it won't be able to repair data
- // XXX: For now we can't pick one shard for repair and another's object info
- if (i->second.read_error || i->second.ec_hash_mismatch || i->second.ec_size_mismatch)
+ if (i->second.size != be_get_ondisk_size(oi.size)) {
+ dout(5) << __func__ << " size " << i->second.size << " oi size " << oi.size << dendl;
+ shard_info.set_obj_size_oi_mismatch();
+ error_string += " obj_size_oi_mismatch";
goto out;
+ }
// We don't set errors here for snapset, but we won't pick an auth copy if the
// snapset is missing or won't decode.
}
}
+ // Don't use this particular shard because it won't be able to repair data
+ // XXX: For now we can't pick one shard for repair and another's object info
+ if (i->second.read_error || i->second.ec_hash_mismatch || i->second.ec_size_mismatch)
+ goto out;
+
if (auth_version == eversion_t() || oi.version > auth_version ||
(oi.version == auth_version && dcount(oi) > dcount(*auth_oi))) {
auth = j;
f.dump_string("error", "oi_attr_missing");
if (err.has_oi_attr_corrupted())
f.dump_string("error", "oi_attr_corrupted");
+ if (err.has_obj_size_oi_mismatch())
+ f.dump_string("error", "obj_size_oi_mismatch");
f.close_section();
}
::decode(oi, bliter); // Can't be corrupted
f.dump_stream("object_info") << oi;
}
- if (inc.has_attr_name_mismatch() || inc.has_attr_value_mismatch()) {
+ if (inc.has_attr_name_mismatch() || inc.has_attr_value_mismatch()
+ || inc.union_shards.has_oi_attr_missing()
+ || inc.union_shards.has_oi_attr_corrupted()
+ || inc.union_shards.has_ss_attr_missing()
+ || inc.union_shards.has_ss_attr_corrupted()) {
f.open_array_section("attrs");
for (auto kv : shard.attrs) {
f.open_object_section("attr");