Commit Graph

73192 Commits

Author SHA1 Message Date
Orit Wasserman
e03b85e987 rgw: check for bucket resharding when adding an object
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:51 -07:00
Orit Wasserman
9a084497fd rgw: add a function to add a bucket to the resharding queue
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:50 -07:00
Orit Wasserman
553bf4b996 rgw: add a check_bucket_shards to the quota
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:50 -07:00
Orit Wasserman
1ed76a680c rgw: moved reshard_bucket into RGWReshard
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:49 -07:00
Orit Wasserman
dfdc2b2cc0 rgw: remove cct from RGWReshard and BucketIndexLockGuard
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:49 -07:00
Orit Wasserman
ad138a4d72 rgw: add resharding thread
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:49 -07:00
Yehuda Sadeh
806d47329e rgw: store new num shards in bucket index reshard entry
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:48 -07:00
Yehuda Sadeh
42b3ee12ea rgw: fix deletion of index completion object
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:48 -07:00
Yehuda Sadeh
94e3c380ab rgw: reshard complete handling, use multiple locks
to reduce contention. Also, fix completions cleanup.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:47 -07:00
Yehuda Sadeh
da1f5bc910 rgw: clean up index completions on shutdown
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:47 -07:00
Yehuda Sadeh
60778b0214 rgw: update data log after index completion reshard handling
Also rearrange code a bit.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:47 -07:00
Yehuda Sadeh
245cd0f9af rgw: guard resharding in async completions
Catch return value from async index completions, resend operations
synchronously on a separate worker thread if needed.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:46 -07:00
Yehuda Sadeh
e18e271490 rgw: reshard guard for versioned operations
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:46 -07:00
Yehuda Sadeh
9677f7d31c cls/rgw: changes to support reshard guard on olh bi ops
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:46 -07:00
Yehuda Sadeh
8fd589d1eb rgw: handle reshard wait logic in cancel() too
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:45 -07:00
Yehuda Sadeh
d250fab244 rgw: fix update_bucket_id, reshard blocking logic
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:45 -07:00
Yehuda Sadeh
9766f5b92d rgw_admin: add rgw-admin reshard status command and initial blocking logic
A command that returns the reshard status field on the bucket index objects (all
shards).
Also, initial implementation of identifying and blocking while reshard in
progress.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:44 -07:00
Yehuda Sadeh
09ccfebf68 rgw: more detailed resharding status kept in bucket header
So that we can differentiate between in-progress and complete status.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:44 -07:00
Yehuda Sadeh
e4d4aa8b86 rgw: a few fixes
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:44 -07:00
Yehuda Sadeh
660a512635 rgw: mark source bucket shards when starting reshard
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:43 -07:00
Yehuda Sadeh
bb0cb4d7a5 rgw: move resharding code to BucketReshard class
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:43 -07:00
Yehuda Sadeh
7a34a049ae rgw: split per-bucket resharding logic out from general resharding
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:43 -07:00
Yehuda Sadeh
0bc15671ee rgw: revert some reshard blocking logic
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:42 -07:00
Yehuda Sadeh
7d44601e83 cls/rgw: create an objclass method to guard in-progress resharding
This method will be called on the bucket index shard.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:42 -07:00
Orit Wasserman
4ddb785bb0 rgw: RGWReshard update to new cls API
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:41 -07:00
Yehuda Sadeh
a07e8eb6af cls/rgw: adjust types and ops
- don't keep data bufferlist in struct cls_rgw_bucket_instance_entry
 - remove rgw_get_bucket_instance

We need to keep the reshard info as part of the bucket index header (for
each source bucket shard), and not in a separate object. Otherwise it'll
be impossible to have the resharding check atomic as part of the regular
bucket index updates.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:41 -07:00
Yehuda Sadeh
04cf0ca074 cls/rgw: minor changes
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:41 -07:00
Yehuda Sadeh
44e46b35f0 cls/rgw: generate_reshard_key, change output param
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:40 -07:00
Yehuda Sadeh
f446b80e2a cls/rgw: return default header if not initialized
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2017-06-05 13:17:40 -07:00
Orit Wasserman
8282366704 rgw: cls_reshard_get remove unneeded check for bufferlist length
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:40 -07:00
Orit Wasserman
1ee15336da rgw: get_bucket_header will return -ENOENT when there is no header
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:39 -07:00
Orit Wasserman
f384708196 rgw: add guard class for bucket index lock
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:39 -07:00
Orit Wasserman
830ea53831 rgw: add reshard_pool_ctx
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:38 -07:00
Orit Wasserman
be156d086d rgw: check for exisiting entries in cls_rgw_reshard_add
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:38 -07:00
Orit Wasserman
0af96c178a rgw: use pointer for is_truncated
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:38 -07:00
Orit Wasserman
ea334d3fdf rgw: cls_rgw_reshard use helper function the generate key
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:37 -07:00
Orit Wasserman
ae6a5eac37 rgw: limit op.max and add extra entry to handle tuncation in cls_rgw_reshard_list
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:37 -07:00
Orit Wasserman
59c0c30ac0 rgw: use .rgw.log:reshard pool for resharding
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:37 -07:00
Orit Wasserman
a7154a6a73 rgw: remove RGWReshard::get_head
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:36 -07:00
Orit Wasserman
5828d4a670 rgw: replace dout with ldout
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:36 -07:00
Orit Wasserman
822a5fbd47 rgw: remove cls_reshard_get_head
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:36 -07:00
Orit Wasserman
149bfc4337 rgw: store resharding information in bucket header
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:35 -07:00
Orit Wasserman
9e43e7f0bb rgw: handle correctly when there is no bucket or it doesn't have resharding flag
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:35 -07:00
Orit Wasserman
3b41ca025b rgw: block on bucket index operation when resharding the index
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:35 -07:00
Orit Wasserman
18c16f971e rgw: add RGWReshard object to RGWRados
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:34 -07:00
Orit Wasserman
c000a15fed rgw: Add lock/unlock bucket instance and block_while_resharding methods
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:34 -07:00
Orit Wasserman
2d23898b27 rgw: add cls_rgw_get_resharding
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:34 -07:00
Orit Wasserman
11e7cb1eb4 radosgw-admin: implement reshard execute command
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:33 -07:00
Orit Wasserman
3858171490 radsogw-admin add create_new_bucket_instance
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:32 -07:00
Orit Wasserman
8e30c37865 rgw: use const string for oid in get_bucket_instance_from_oid
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2017-06-05 13:17:32 -07:00