Commit Graph

135598 Commits

Author SHA1 Message Date
Casey Bodley
3a4acab5c7 rgw: process_request() takes RGWProcessEnv
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-12-09 16:40:32 -05:00
Casey Bodley
0de9bd3fb6 rgw: move lua_manager into RGWProcessEnv
each frontend no longer has to own/reload the lua manager themselves

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-12-09 16:34:19 -05:00
Casey Bodley
3500e6cf06 rgw: auth_registry uses unique_ptr instead of shared_ptr
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-12-09 16:29:16 -05:00
Casey Bodley
c0fdbd2b2d rgw: RGWRealmReloader reloads auth_registry
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-12-09 16:22:53 -05:00
Casey Bodley
26c600bf3c rgw/auth: strategies take ImplicitTenants by const ref
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-12-09 16:10:46 -05:00
Casey Bodley
dc678bad57 rgw: frontends share RGWProcessEnv by reference
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-12-09 15:53:29 -05:00
Casey Bodley
66f637e477 rgw/main: add RGWProcessEnv in AppMain
instead of constructing a separate RGWProcessEnv for each frontend,
initialize a single instance in AppMain and share a reference with each
frontend

RGWRealmReloader now takes a reference to RGWProcessEnv instead of a
reference to the Store pointer itself, and updates RGWProcessEnv::store
on realm reload

because RGWRealmReloader may mutate RGWProcessEnv::store, we no longer have
a separate AppMain::store pointer, so don't worry about keeping that
consistent over reloads

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-12-09 15:43:23 -05:00
Casey Bodley
957a6e951c rgw: move uri_prefix out of RGWProcessEnv
each frontend parses its own prefix from the frontend config

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-12-09 15:20:03 -05:00
Casey Bodley
517b0cc911 rgw: null-initialize RGWProcessEnv pointer members
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-12-09 15:13:16 -05:00
Casey Bodley
6bdfcd25f0 rgw: remove unused RGWProcessEnv::port
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-12-09 14:51:38 -05:00
Adam King
a6065a8340 pybind/mgr: partial reversion of #49359
When creating #49359 I was testing on an outdated
branch and didn't realize part of what I was fixing
had already been fixed in #49321. Basically ended up
changing what a variable "mypy_args" is set to but that
variable is no longer being used. It has no actual effect
but we should remove the extraneous code.

Signed-off-by: Adam King <adking@redhat.com>
2022-12-09 14:20:47 -05:00
Casey Bodley
8f8bb1d2b7 rgw: rgw_parse_url_bucket() rejects empty bucket names after 'tenant:'
fail with ERR_INVALID_BUCKET_NAME if rgw_parse_url_bucket() finds a
'tenant:' but empty bucket name

Fixes: https://tracker.ceph.com/issues/58111

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-12-09 14:01:35 -05:00
Adam King
9c9d0d3618
Merge pull request #49359 from adk3798/mypy-args
mgr/pybind: fix mypy and autopep8 arg parsing

Reviewed-by: Laura Flores <lflores@redhat.com>
2022-12-09 13:19:10 -05:00
Casey Bodley
473d7e446d rgw/notify: reservation_t takes optional_yield
allows callers to specify something other than s->yield

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-12-09 13:06:11 -05:00
Casey Bodley
500a28fbe8
Merge pull request #48626 from qiuxinyidian/rgw-coroutine
rgw: modify multisite coroutine stack block

Reviewed-by: Casey Bodley <cbodley@redhat.com>
Reviewed-by: Adam C. Emerson <aemerson@redhat.com>
2022-12-09 12:56:28 -05:00
Casey Bodley
c27987273e
Merge pull request #48559 from baergj/fix-listbuckets-truncation-main
rgw: Fix truncated ListBuckets response.

Reviewed-by: Daniel Gryniewicz <dang@redhat.com>
Reviewed-by: J. Eric Ivancich <ivancich@redhat.com>
2022-12-09 12:55:21 -05:00
Casey Bodley
2e08de5b8d
Merge pull request #48554 from giubacc/rgw_dns_name_multivalue
rgw: add multivalue support to rgw_dns_name config option

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2022-12-09 12:54:13 -05:00
Casey Bodley
46462ebf27
Merge pull request #48390 from cbodley/wip-57784
rgw: beast frontend checks for local_endpoint() errors

Reviewed-by: Yuval Lifshitz <ylifshit@redhat.com>
2022-12-09 12:52:32 -05:00
Casey Bodley
e86e0b7de0
Merge pull request #45818 from cbodley/wip-system-rapidjson
cmake: use rapidjson headers from s3select's submodule

Reviewed-by: Deepika Upadhyay <dupadhya@redhat.com>
Reviewed-by: Kefu Chai <tchaikov@gmail.com>
2022-12-09 12:52:07 -05:00
Daniel Gryniewicz
2c8520c925
Merge pull request #49336 from dang/wip-dang-zipper-driver
Store -> Driver rename + header cleanup

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2022-12-09 12:41:13 -05:00
Adam King
2ecd74cdac pybind/mgr: fix tox autopep8 args
Similar to mypy, we now need a backslash to signal
a newline doesn't mean to start a new command

Signed-off-by: Adam King <adking@redhat.com>
2022-12-09 11:25:01 -05:00
Adam King
8e5840ff2c mgr/pybind: fix mypy arg parsing
On the new tox version it is treating each line as a new command
so it will do something like "mypy --config-file=../../mypy.ini"
as one command and then "-m balancer" as a totally separate command.
The first one immediately fails as it doesn't include any modules
to test. Adding backslashes to the ends of the lines gets it to
handle the lines as one long command

Signed-off-by: Adam King <adking@redhat.com>
2022-12-09 11:19:43 -05:00
Kamoltat
4d8b0c29bf qa/standalone/mon: remove --mon-inital-members setting
Problem:

--mon-initial-members does nothing but causes monmap
to populate ``removed_ranks`` because the way we start
monitors in standalone tests uses ``run_mon $dir $id ..``
on each mon. Regardless of --mon-initial-members=a,b,c, if
we set --mon-host=$MONA,$MONB,$MONC (which we do every single tests),
everytime we run a monitor (e.g.,run mon.b) it will pre-build
our monmap with

```
noname-a=mon.noname-a addrs v2:127.0.0.1:7127/0,
b=mon.b addrs v2:127.0.0.1:7128/0,
noname-c=mon.noname-c addrs v2:127.0.0.1:7129/0,
```

Now, with --mon-initial-members=a,b,c we are letting
monmap know that we should have initial members name:
a,b,c, which we only have `b` as a match. So what
``MonMap::set_initial_members`` do is that it will
remove noname-a and noname-c which will
populate `removed_ranks`.

Solution:

remove all instances of --mon-initial-members
in the standalone test as it has no impact on
the nature of the tests themselves.

Fixes: https://tracker.ceph.com/issues/58132

Signed-off-by: Kamoltat <ksirivad@redhat.com>
2022-12-09 15:43:45 +00:00
Kamoltat
767a4be12d mon: clear connection score during update & add sanity check live/dead connection report
When upgrading the monitors (include booting up),
we check if `peer_tracker` is dirty or not. If
so, we clear it. Added some functions in `Elector` and
`ConnectionTracker` class to
check for clean `peer_tracker`.

Moreover, there could be some cases where due
to startup weirdness or abnormal circumstances,
we might get a report from our own rank. Therefore,
it doesn't hurt to add a sanity check in
`ConnectionTracker::report_live_connection` and
`ConnectionTracker::report_dead_connection`.

Fixes: https://tracker.ceph.com/issues/58049

Signed-off-by: Kamoltat <ksirivad@redhat.com>
2022-12-09 15:43:45 +00:00
Kamoltat
8efc19911b mon/Elector & ConnectionTracker: reset peer_tracker.rank
In `notify_clear_peer_state()` we another
mechanism in reseting our `peer_tracker.rank`
to match our own monitor.rank.

This is added so there is a way for us
to recover from a scenrio where `peer_tracker.rank`
is messed up from adjusting the ranks or removing
ranks.

`notifiy_clear_peer_state()` can be triggered
by using the command:

`ceph connection scores reset`

Also in `clear_peer_reports`, besides
reassigning my_reports to an empty object,
we also have to make `my_reports` = `rank`
from `peer_tracker`, such that we don't get
-1 as a rank in my_reports.

Fixes: https://tracker.ceph.com/issues/58049

Signed-off-by: Kamoltat <ksirivad@redhat.com>
2022-12-09 15:43:45 +00:00
Kamoltat
39481462fb mon: change how we handle removed_ranks
when a new monitor joins, there is a chance that
it will recive a monmap that recently removed
a monitor and ``removed_rank`` will have some
content in it. A new monitor that joins
should never remove rank in peer_tracker but
rather call ``notify_clear_peer_state()``
to reset the `peer_report`.

In the case when it is a monitor that
has joined quorum before and is only 1
epoch behind the newest monmap provided
by the probe_replied monitor. We can
actually remove and adjust ranks in `peer_report`
since we are sure that if there is any content in
removed_ranks, then it has to be because in the
next epoch we are removing a rank, since every
update of an epoch we always clear the removed_ranks.

There is no point in keeping the content
of ``removed_ranks`` after monmap gets updated
to the epoch.

Therefore, clear ``removed_ranks`` every update.

When there is discontinuity between
monmaps for more 1 epoch or the new monitor never joined quorum before,
we always reset `peer_tracker`.

Moreover, beneficial for monitor log to also log
which rank has been removed at the current time
of the monmap. So add removed_ranks to `print_summary`
and `dump` in MonMap.cc.

Fixes: https://tracker.ceph.com/issues/58049

Signed-off-by: Kamoltat <ksirivad@redhat.com>
2022-12-09 15:43:45 +00:00
Kamoltat
72d1f5839a mon/ConnectionTracker.cc: Improve notify_rank_removed()
PROBLEM:

In `ConnectionTracker::receive_peer_report`
we loop through ranks which is bad when
there is `notify_rank_removed` before this and
the ranks are not adjusted yet. When we rely
on the rank in certain scenarios, we end up
with extra peer_report copy which we don't
want.

SOLUTION:

In `ConnectionTracker::receive_peer_report`
instead of passing `report.rank` in the function
`ConnectionTracker::reports`, we pass `i.first`
instead so that trim old ranks properly.

We also added a assert in notify_rank_removed(),
comparing expected rank provided by the monmap
against the rank that we adjust ourself to as
a sanity check.

We edited test/mon/test_election.cc
to reflect the changes made in notify_rank_removed().

Fixes: https://tracker.ceph.com/issues/58049

Signed-off-by: Kamoltat <ksirivad@redhat.com>
2022-12-09 15:43:45 +00:00
Kamoltat
a781ff788b mon: Init Loggings for ConnectionTracker.cc & Added more loggings to ElectionLogic & Elector
Problem:

Currently there are not ConnectionTracker logs,
therefore it is really hard to debug

Solution:

Enable loggings for most functions in ConnectionTracker.cc
Most of the logs are in debug_mon = 30.

Also Added some logs in Elector and ElectionLogic
so that debugging will be easier in the future.

Fixes: https://tracker.ceph.com/issues/58049

Signed-off-by: Kamoltat <ksirivad@redhat.com>
2022-12-09 15:43:45 +00:00
Yingxin
94a142f227
Merge pull request #48691 from zhscn/wip-reserve
crimson/os/seastore: correct the behavior of reserving space

Reviewed-by: Yingxin Cheng <yingxin.cheng@intel.com>
Reviewed-by: Kefu Chai <tchaikov@gmail.com>
Reviewed-by: Xuehan Xu <xxhdx1985126@gmail.com>
Reviewed-by: Myoungwon Oh <myoungwon.oh@samsung.com>
2022-12-09 18:01:52 +08:00
Pere Diaz Bou
92168eac67
Merge pull request #47842 from trociny/wip-rbd-rest-api-metadata
mgr/dashboard: allow to get/update RBD image metadata via REST API

Reviewed-by: Pere Diaz Bou <pdiazbou@redhat.com>
2022-12-09 09:34:06 +01:00
colemitchell
7c8617423d
Merge pull request #49342 from zdover23/wip-doc-2022-12-09-rbd-rados-rbd-cmds-removing-a-block-device-semantics
doc/rbd: refine "Removing a Block Device Image"

Reviewed-by: Cole Mitchell <cole.mitchell@gmail.com>
2022-12-09 01:45:28 -05:00
Zac Dover
3a6284a49b doc/rbd: refine "Removing a Block Device Image"
Refine and add unselectable prompts to "Removing a Block Device Image"
in doc/rbd/rados-rbd-cmds.

https://tracker.ceph.com/issues/57001

Signed-off-by: Zac Dover <zac.dover@gmail.com>
2022-12-09 16:38:46 +10:00
colemitchell
9ccf87c165
Merge pull request #49341 from zdover23/wip-doc-2022-12-09-rbd-rados-rbd-cmds-resizing-a-block-device-image-semantics
doc/rbd: refine "Resizing a Block Device Image"

Reviewed-by: Cole Mitchell <cole.mitchell@gmail.com>
2022-12-09 01:17:17 -05:00
colemitchell
10505022c7
Merge pull request #49343 from zdover23/wip-doc-2022-12-09-rbd-rados-rbd-cmds-restoring-a-block-device-image-semantics
doc/rbd: refine "Restoring a Block Device Image"

Reviewed-by: Cole Mitchell <cole.mitchell@gmail.com>
2022-12-09 01:16:43 -05:00
Zac Dover
8fb4edb92d doc/rbd: refine "Restoring a Block Device Image"
Refine and add unselectable prompts to "Restoring a Block Device Image"
in doc/rbd/rados-rbd-cmds.rst.

https://tracker.ceph.com/issues/57001

Signed-off-by: Zac Dover <zac.dover@gmail.com>
2022-12-09 16:07:19 +10:00
Zac Dover
078bec94d0 doc/rbd: refine "Resizing a Block Device Image"
Refine and add unselectable prompts to "Resizing a Block Device Image"
in doc/rbd/rados/rbd-cmds.rst.

https://tracker.ceph.com/issues/57001

Signed-off-by: Zac Dover <zac.dover@gmail.com>
2022-12-09 15:19:54 +10:00
colemitchell
19426975b2
Merge pull request #49338 from zdover23/wip-doc-2022-12-09-rbd-rados-rbd-cmds-creating-a-block-device-image-semantics
doc/rbd: refine "Creating a Block Device Image"

Reviewed-by: Anthony D'Atri <anthony.datri@gmail.com>
2022-12-08 23:50:23 -05:00
colemitchell
7c1191da75
Merge pull request #49340 from zdover23/wip-doc-2022-12-09-rbd-rados-rbd-cmds-retrieving-image-information-semantics
doc/rbd: refine "Retrieving Image Information"

Reviewed-by: Anthony D'Atri <anthony.datri@gmail.com>
2022-12-08 23:50:07 -05:00
colemitchell
2d50caa884
Merge pull request #49339 from zdover23/wip-doc-2022-12-09-rbd-rados-rbd-cmds-listing-block-device-images-semantics
doc/rbd: refine "Listing Block Device Images"

Reviewed-by: Anthony D'Atri <anthony.datri@gmail.com>
2022-12-08 21:50:05 -05:00
Zac Dover
d418037b38 doc/rbd: refine "Retrieving Image Information"
Refine the text and prompts in "Retrieving Image Information" in
doc/rbd/rados-rbd-cmds.rst.

https://tracker.ceph.com/issues/57001

Signed-off-by: Zac Dover <zac.dover@gmail.com>
2022-12-09 10:45:19 +10:00
Kefu Chai
af7d7d386b
Merge pull request #49321 from tchaikov/wip-qa-install-with-utf-8
qa: set locale to C.UTF-8 in tox.ini

Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Adam King <adking@redhat.com>
2022-12-09 08:31:05 +08:00
chunmei-liu
2ec6ff5e39 crimson/osd: dump each shard seastar metrics
Signed-off-by: chunmei-liu <chunmei.liu@intel.com>
Signed-off-by: Samuel Just <sjust@redhat.com>
2022-12-08 16:27:10 -08:00
Zac Dover
ad3c93535f doc/rbd: refine "Listing Block Device Images"
Refine the text and prompts in "Listing Block Device Images" in
doc/rbd/rados-rbd-cmds.rst.

https://tracker.ceph.com/issues/57001

Signed-off-by: Zac Dover <zac.dover@gmail.com>
2022-12-09 10:21:47 +10:00
Zac Dover
20b14437d6 doc/rbd: refine "Creating a Block Device Image"
Refine the English and prompts in "Creating a Block Device Image" in
doc/rbd/rados-rbd-cmds.rst.

https://tracker.ceph.com/issues/57001

Signed-off-by: Zac Dover <zac.dover@gmail.com>
2022-12-09 09:53:14 +10:00
Matt Benjamin
c30449b35b rgw: define a hierarchy of basic type headers
Defines a hierarchy of "simple" data types ensured to be
safe to include in any context above the zipper line, and
also from CLS.

The following headers are currently defined to contain basic
types only:

 rewrite src/rgw/rgw_basic_types.h (70%) // includes the whole hierarchy
 create mode 100644 src/rgw/rgw_acl_types.h
 create mode 100644 src/rgw/rgw_bucket_types.h
 create mode 100644 src/rgw/rgw_obj_types.h
 create mode 100644 src/rgw/rgw_placement_types.h
 create mode 100644 src/rgw/rgw_pool_types.h
 create mode 100644 src/rgw/rgw_quota_types.h
 create mode 100644 src/rgw/rgw_user_types.h
 create mode 100644 src/rgw/rgw_zone_types.h

This commit consolidates the following original commits:

* rgw: move RGWUploadPartInfo to rgw_basic_types.{h,cc}
* rgw: move rgw_obj_key to rgw_basic_types.{h,cc}
* rgw: move rgw_placement_rule to rgw_basic_types.{h,cc}
* rgw: move rgw_obj to rgw_basic_types.{h,cc}
* rgw: include rgw_compression_types.h in rgw_basic_types.{h,cc}
* rgw: move rgw_raw_obj to rgw_basic_types.{h,cc}
* rgw: rgw_multi.h: remove unused RGWMPObj forward decl

and the following cleanups from review:

* rgw: remove stray comments
* rgw: move rgw_obj_manifest.h inclusion to top of rgw_basic_types.h
* rgw: nit: indentation
* rgw: remove this line
* rgw: move rgw_bucket_shard to rgw_bucket_types.h, cleanup
* rgw: fix rgw_quota.h

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
2022-12-08 14:42:34 -05:00
Matt Benjamin
9ee09fc27f rgw: setup for inclusion of rgw_basic_types in rgw cls
In downstream 4.1 version this change moved rgw_pool, rgw_bucket,
and some related types--but these have already moved on more
recent branches.

Include rgw_basic_types.h only from cls_rgw_types.h (review).

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
2022-12-08 14:42:34 -05:00
Daniel Gryniewicz
644a488190 RGW - Zipper - move rgw/store to rgw/driver
Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
2022-12-08 14:42:29 -05:00
Daniel Gryniewicz
1fac0a75ee RGW - Zipper - Rename rgw::sal::Store to rgw::sal::Driver
All along, we've had an overload of the term "store".  It was the base
class of the entrypoint, and it was the lowest layer in a stack.  This
renames the base class to Driver.  So, the primary elements of zipper
that to work are now Drivers, and they come in two different flavors:
Filters live in the middle of the stack, and do not need to implement
every API, but pass through instead.  And Stores live a the bottom of
the stack, and must implement the entire API.

Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
2022-12-08 14:13:12 -05:00
Kefu Chai
c67106b120 pybind/mgr: do not test with py37
as we always test with ubuntu jammy, which does not provide python3.7:

py37: skipped because could not find python interpreter with spec(s): py37

so there is no point testing with python3.7.

also, in tox v4, it is not able to handle "key = value" anymore, where
value has newlines in it. so we need to find a better way passing
command line options to the test command.

this change partially reverts 2dd86c9e3e

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2022-12-09 01:07:19 +08:00
Kefu Chai
da40d84640 cmake: temporarily disable py3 test
py3 tries to import all python modules to ensure that they are
python3 compatible. but the installation fails on jenkins test node:

  Resolved https://github.com/ceph/teuthology.git to commit 4da97cf64e542f347ec47b7bdbe5eca99759f9b7
  Installing build dependencies: started
  error: subprocess-exited-with-error

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2022-12-09 01:07:19 +08:00