osd, rados: Adding ss_attr_missing and ss_attr_corrupt errors to list-inconsistent-obj

Signed-off-by: David Zafman <dzafman@redhat.com>
This commit is contained in:
David Zafman 2017-07-18 18:45:57 -07:00
parent 5f58301a13
commit 4c949b6258
4 changed files with 138 additions and 15 deletions

View File

@ -67,7 +67,9 @@
"ec_size_error",
"oi_attr_missing",
"oi_attr_corrupted",
"obj_size_oi_mismatch"
"obj_size_oi_mismatch",
"ss_attr_missing",
"ss_attr_corrupted"
]
},
"minItems": 0,
@ -134,7 +136,9 @@
"ec_size_error",
"oi_attr_missing",
"oi_attr_corrupted",
"obj_size_oi_mismatch"
"obj_size_oi_mismatch",
"ss_attr_missing",
"ss_attr_corrupted"
]
},
"minItems": 0,

View File

@ -481,7 +481,7 @@ function TEST_list_missing_erasure_coded_overwrites() {
function TEST_corrupt_scrub_replicated() {
local dir=$1
local poolname=csr_pool
local total_objs=15
local total_objs=16
setup $dir || return 1
run_mon $dir a --osd_pool_default_size=2 || return 1
@ -597,6 +597,12 @@ function TEST_corrupt_scrub_replicated() {
15)
objectstore_tool $dir $osd $objname rm-attr _ || return 1
;;
16)
objectstore_tool $dir 0 $objname rm-attr snapset || return 1
echo -n bad-val > $dir/bad-val
objectstore_tool $dir 1 $objname set-attr snapset $dir/bad-val || return 1
esac
done
@ -815,6 +821,57 @@ function TEST_corrupt_scrub_replicated() {
"name": "ROBJ15"
}
},
{
"errors": [],
"object": {
"locator": "",
"name": "ROBJ16",
"nspace": "",
"snap": "head",
"version": 0
},
"shards": [
{
"attrs": [
{
"Base64": true,
"name": "_",
"value": ""
}
],
"errors": [
"ss_attr_missing"
],
"osd": 0,
"primary": false,
"size": 7
},
{
"attrs": [
{
"Base64": true,
"name": "_",
"value": ""
},
{
"Base64": false,
"name": "snapset",
"value": "bad-val"
}
],
"errors": [
"ss_attr_corrupted"
],
"osd": 1,
"primary": true,
"size": 7
}
],
"union_shard_errors": [
"ss_attr_missing",
"ss_attr_corrupted"
]
},
{
"shards": [
{
@ -903,14 +960,14 @@ function TEST_corrupt_scrub_replicated() {
"primary": true
}
],
"selected_object_info": "3:86586531:::ROBJ8:head(82'62 client.4351.0:1 dirty|omap|data_digest|omap_digest s 7 uv 62 dd 2ddbf8f5 od d6be81dc alloc_hint [0 0 0])",
"selected_object_info": "3:86586531:::ROBJ8:head(82'62 client.4351.0:1 dirty|omap|data_digest|omap_digest s 7 uv 66 dd 2ddbf8f5 od d6be81dc alloc_hint [0 0 0])",
"union_shard_errors": [],
"errors": [
"attr_value_mismatch",
"attr_name_mismatch"
],
"object": {
"version": 62,
"version": 66,
"snap": "head",
"locator": "",
"nspace": "",
@ -920,7 +977,7 @@ function TEST_corrupt_scrub_replicated() {
{
"shards": [
{
"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])",
"object_info": "3:ffdb2004:::ROBJ9:head(102'63 client.4433.0:1 dirty|omap|data_digest|omap_digest s 1 uv 67 dd 2b63260d od 2eecc539 alloc_hint [0 0 0])",
"size": 1,
"errors": [],
"osd": 0,
@ -936,7 +993,7 @@ function TEST_corrupt_scrub_replicated() {
"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])",
"selected_object_info": "3:ffdb2004:::ROBJ9:head(102'63 client.4433.0:1 dirty|omap|data_digest|omap_digest s 1 uv 67 dd 2b63260d od 2eecc539 alloc_hint [0 0 0])",
"union_shard_errors": [
"obj_size_oi_mismatch"
],
@ -944,7 +1001,7 @@ function TEST_corrupt_scrub_replicated() {
"object_info_inconsistency"
],
"object": {
"version": 63,
"version": 67,
"snap": "head",
"locator": "",
"nspace": "",
@ -1281,6 +1338,61 @@ EOF
"name": "ROBJ15"
}
},
{
"errors": [],
"object": {
"locator": "",
"name": "ROBJ16",
"nspace": "",
"snap": "head",
"version": 0
},
"shards": [
{
"attrs": [
{
"Base64": true,
"name": "_",
"value": ""
}
],
"data_digest": "0x2ddbf8f5",
"errors": [
"ss_attr_missing"
],
"omap_digest": "0x8b699207",
"osd": 0,
"primary": false,
"size": 7
},
{
"attrs": [
{
"Base64": true,
"name": "_",
"value": ""
},
{
"Base64": false,
"name": "snapset",
"value": "bad-val"
}
],
"data_digest": "0x2ddbf8f5",
"errors": [
"ss_attr_corrupted"
],
"omap_digest": "0x8b699207",
"osd": 1,
"primary": true,
"size": 7
}
],
"union_shard_errors": [
"ss_attr_missing",
"ss_attr_corrupted"
]
},
{
"shards": [
{
@ -1555,14 +1667,14 @@ EOF
"primary": true
}
],
"selected_object_info": "3:86586531:::ROBJ8:head(82'62 client.4351.0:1 dirty|omap|data_digest|omap_digest s 7 uv 62 dd 2ddbf8f5 od d6be81dc alloc_hint [0 0 0])",
"selected_object_info": "3:86586531:::ROBJ8:head(82'62 client.4351.0:1 dirty|omap|data_digest|omap_digest s 7 uv 66 dd 2ddbf8f5 od d6be81dc alloc_hint [0 0 0])",
"union_shard_errors": [],
"errors": [
"attr_value_mismatch",
"attr_name_mismatch"
],
"object": {
"version": 62,
"version": 66,
"snap": "head",
"locator": "",
"nspace": "",
@ -1583,7 +1695,7 @@ EOF
"primary": false
},
{
"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])",
"object_info": "3:ffdb2004:::ROBJ9:head(122'64 client.4532.0:1 dirty|omap|data_digest|omap_digest s 3 uv 68 dd 1f26fb26 od 2eecc539 alloc_hint [0 0 0])",
"data_digest": "0x1f26fb26",
"omap_digest": "0x2eecc539",
"size": 3,
@ -1592,7 +1704,7 @@ EOF
"primary": true
}
],
"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])",
"selected_object_info": "3:ffdb2004:::ROBJ9:head(122'64 client.4532.0:1 dirty|omap|data_digest|omap_digest s 3 uv 68 dd 1f26fb26 od 2eecc539 alloc_hint [0 0 0])",
"union_shard_errors": [
"obj_size_oi_mismatch"
],
@ -1600,7 +1712,7 @@ EOF
"object_info_inconsistency"
],
"object": {
"version": 64,
"version": 68,
"snap": "head",
"locator": "",
"nspace": "",

View File

@ -852,11 +852,12 @@ map<pg_shard_t, ScrubMap *>::const_iterator
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.
// We won't pick an auth copy if the snapset is missing or won't decode.
if (obj.is_head() || obj.is_snapdir()) {
k = i->second.attrs.find(SS_ATTR);
if (k == i->second.attrs.end()) {
shard_info.set_ss_attr_missing();
error_string += " ss_attr_missing";
goto out;
}
ss_bl.push_back(k->second);
@ -865,6 +866,8 @@ map<pg_shard_t, ScrubMap *>::const_iterator
::decode(ss, bliter);
} catch (...) {
// invalid snapset, probably corrupt
shard_info.set_ss_attr_corrupted();
error_string += " ss_attr_corrupted";
goto out;
}
}

View File

@ -1340,6 +1340,10 @@ static void dump_errors(const err_t &err, Formatter &f, const char *name)
f.dump_string("error", "oi_attr_corrupted");
if (err.has_obj_size_oi_mismatch())
f.dump_string("error", "obj_size_oi_mismatch");
if (err.has_ss_attr_missing())
f.dump_string("error", "ss_attr_missing");
if (err.has_ss_attr_corrupted())
f.dump_string("error", "ss_attr_corrupted");
f.close_section();
}