Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw structures rework #11485

Merged
merged 29 commits into from
Mar 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
66c2b0c
rgw: introduce rgw_pool, rgw_raw_obj
yehudasa Oct 8, 2016
10f7358
rgw: separate RGWObjState
yehudasa Oct 9, 2016
5fff637
rgw: more fixes and adjustments following rgw_pool, rgw_raw_obj
yehudasa Oct 10, 2016
18e8ecc
rgw: remove unneeded virtual declarations
yehudasa Oct 11, 2016
3583d67
rgw: decode rgw_raw_obj as rgw_obj when it's old object
yehudasa Oct 11, 2016
81070d3
rgw: use rgw_raw_obj in manifest code
yehudasa Oct 13, 2016
df534b4
rgw: simple manifest compaction
yehudasa Oct 13, 2016
9c1b828
rgw: implicit rgw_bucket placement, manifest uses rgw_raw_obj
yehudasa Oct 31, 2016
fc6fa2f
test/rgw: extend obj, manifest unitests
yehudasa Oct 31, 2016
2ae6f6c
rgw: fix bucket overwrite
yehudasa Nov 16, 2016
bdf53ab
rgw: clean rgw_obj
yehudasa Nov 17, 2016
5cf5ab4
rgw: add rgw_obj_index_key, kill RGWObjEnt
yehudasa Nov 17, 2016
50c522e
rgw: keep rgw_obj key info in rgw_obj_key field
yehudasa Nov 21, 2016
e67a3b5
rgw: fix ECANCELED handling in rgw_get_system_obj()
yehudasa Nov 22, 2016
5f9ab9f
cls/version: add more useful logging
yehudasa Nov 22, 2016
479e9f7
rgw: move placement rule out of rgw_bucket
yehudasa Nov 28, 2016
a3303c9
rgw: compilation and other fixes following rebase
yehudasa Dec 15, 2016
b34208f
rgw: add namespace to rgw_pool
yehudasa Dec 16, 2016
5f46b3c
rgw: handle pools namespace
yehudasa Dec 16, 2016
b21d13f
rgw: modify default pools to use namespaces
yehudasa Dec 16, 2016
21200e8
rgw: fix async cr operation
yehudasa Dec 19, 2016
9fbdd2b
mrgw.sh: fix script
yehudasa Dec 19, 2016
48dd2ce
rgw_admin: remove broken check
yehudasa Dec 20, 2016
2977169
rgw: metadata put of bucket instance sets bucket_id
yehudasa Dec 20, 2016
8310c8f
rgw: get_obj_state() checks for empty oids
yehudasa Jan 5, 2017
803b04e
rgw: new rest api to retrieve object layout
yehudasa Jan 9, 2017
00a2af1
rgw: more fixes following rebase
yehudasa Feb 18, 2017
515db13
qa/tasks/radosgw_admin: adjust test to new bucket structure
yehudasa Mar 8, 2017
a9ec5e8
rgw: fix crash when listing objects via swift
yehudasa Mar 8, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions qa/tasks/radosgw_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,6 @@ def task(ctx, config):
'bucket.instance:{bucket_name}:{bucket_instance}'.format(
bucket_name=bucket_name2,bucket_instance=dest_bucket_id)],
check_status=True)
del out1['data']['bucket_info']['bucket']['pool']
del out1['data']['bucket_info']['bucket']['index_pool']
del out1['data']['bucket_info']['bucket']['data_extra_pool']
del out2['data']['bucket_info']['bucket']['pool']
del out2['data']['bucket_info']['bucket']['index_pool']
del out2['data']['bucket_info']['bucket']['data_extra_pool']
assert out1 == out2

same_region = 0
Expand Down
12 changes: 11 additions & 1 deletion src/cls/rgw/cls_rgw_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ struct cls_rgw_obj_key {
cls_rgw_obj_key(const string &_name) : name(_name) {}
cls_rgw_obj_key(const string& n, const string& i) : name(n), instance(i) {}

void set(const string& _name) {
name = _name;
}

bool operator==(const cls_rgw_obj_key& k) const {
return (name.compare(k.name) == 0) &&
(instance.compare(k.instance) == 0);
Expand All @@ -250,6 +254,12 @@ struct cls_rgw_obj_key {
}
return (r < 0);
}
bool operator<=(const cls_rgw_obj_key& k) const {
return !(k < *this);
}
bool empty() {
return name.empty();
}
void encode(bufferlist &bl) const {
ENCODE_START(1, 1, bl);
::encode(name, bl);
Expand Down Expand Up @@ -872,7 +882,7 @@ struct cls_rgw_obj_chain {

cls_rgw_obj_chain() {}

void push_obj(string& pool, cls_rgw_obj_key& key, string& loc) {
void push_obj(const string& pool, const cls_rgw_obj_key& key, const string& loc) {
cls_rgw_obj obj;
obj.pool = pool;
obj.key = key;
Expand Down
5 changes: 0 additions & 5 deletions src/cls/user/cls_user_types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,13 @@ void cls_user_gen_test_bucket(cls_user_bucket *bucket, int i)
snprintf(buf, sizeof(buf), ".%d", i);

bucket->name = string("buck") + buf;
bucket->data_pool = string(".data.pool") + buf;
bucket->index_pool = string(".index.pool") + buf;
bucket->marker = string("mark") + buf;
bucket->bucket_id = string("bucket.id") + buf;
}

void cls_user_bucket::dump(Formatter *f) const
{
encode_json("name", name, f);
encode_json("data_pool", data_pool,f);
encode_json("data_extra_pool", data_extra_pool,f);
encode_json("index_pool", index_pool,f);
encode_json("marker", marker,f);
encode_json("bucket_id", bucket_id,f);
}
Expand Down
47 changes: 32 additions & 15 deletions src/cls/user/cls_user_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,34 @@
*/
struct cls_user_bucket {
std::string name;
std::string data_pool;
std::string index_pool;
std::string marker;
std::string bucket_id;
std::string data_extra_pool;
std::string placement_id;
struct {
std::string data_pool;
std::string index_pool;
std::string data_extra_pool;
} explicit_placement;

void encode(bufferlist& bl) const {
ENCODE_START(7, 3, bl);
ENCODE_START(8, 8, bl);
::encode(name, bl);
::encode(data_pool, bl);
::encode(marker, bl);
::encode(bucket_id, bl);
::encode(index_pool, bl);
::encode(data_extra_pool, bl);
::encode(placement_id, bl);
if (placement_id.empty()) {
::encode(explicit_placement.data_pool, bl);
::encode(explicit_placement.index_pool, bl);
::encode(explicit_placement.data_extra_pool, bl);
}
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(7, 3, 3, bl);
DECODE_START_LEGACY_COMPAT_LEN(8, 3, 3, bl);
::decode(name, bl);
::decode(data_pool, bl);
if (struct_v < 8) {
::decode(explicit_placement.data_pool, bl);
}
if (struct_v >= 2) {
::decode(marker, bl);
if (struct_v <= 3) {
Expand All @@ -46,13 +54,22 @@ struct cls_user_bucket {
::decode(bucket_id, bl);
}
}
if (struct_v >= 5) {
::decode(index_pool, bl);
if (struct_v < 8) {
if (struct_v >= 5) {
::decode(explicit_placement.index_pool, bl);
} else {
explicit_placement.index_pool = explicit_placement.data_pool;
}
if (struct_v >= 7) {
::decode(explicit_placement.data_extra_pool, bl);
}
} else {
index_pool = data_pool;
}
if (struct_v >= 7) {
::decode(data_extra_pool, bl);
::decode(placement_id, bl);
if (placement_id.empty()) {
::decode(explicit_placement.data_pool, bl);
::decode(explicit_placement.index_pool, bl);
::decode(explicit_placement.data_extra_pool, bl);
}
}
DECODE_FINISH(bl);
}
Expand Down
1 change: 1 addition & 0 deletions src/cls/version/cls_version.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ static bool check_conds(list<obj_version_cond>& conds, obj_version& objv)
for (list<obj_version_cond>::iterator iter = conds.begin(); iter != conds.end(); ++iter) {
obj_version_cond& cond = *iter;
obj_version& v = cond.ver;
CLS_LOG(20, "cls_version: check_version %s:%d (cond=%d)", v.tag.c_str(), (int)v.ver, (int)cond.cond);

switch (cond.cond) {
case VER_COND_NONE:
Expand Down
5 changes: 5 additions & 0 deletions src/cls/version/cls_version_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ struct obj_version {
ver++;
}

void clear() {
ver = 0;
tag.clear();
}

bool empty() {
return tag.empty();
}
Expand Down
4 changes: 2 additions & 2 deletions src/mrgw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ script_root=`dirname $0`
script_root=`(cd $script_root;pwd)`
if [ -e CMakeCache.txt ]; then
script_root=$PWD
elif [ -e $root_path/../build/CMakeCache.txt ]; then
cd $root_path/../build
elif [ -e $script_root/../build/CMakeCache.txt ]; then
cd $script_root/../build
script_root=$PWD
fi
vstart_path=`dirname $0`
Expand Down
Loading