Mark Nelson [Fri, 24 Jul 2020 05:29:15 +0000 (05:29 +0000)]
mds/CInode: Optimize only pinned by subtrees check
Fixes: https://tracker.ceph.com/issues/46727 Signed-off-by: Mark Nelson <mnelson@redhat.com>
(cherry picked from commit 6a865f805b723525358ed8e79bb3d41709e98bf3)
Conflicts:
src/mds/MDCache.cc
- use the nautilus code flow of trim instead master
Sebastian Krah [Tue, 19 Nov 2019 10:41:49 +0000 (11:41 +0100)]
mgr/dashboard: Don't use any xlf file when building the default language
The build-i18n script no longer uses a xlf file when building the default
language. This means that we don't need to keep the messages.en-US.xlf in the repository anymore.
Fixes: https://tracker.ceph.com/issues/42693 Signed-off-by: Sebastian Krah <skrah@suse.com>
(cherry picked from commit 5efe0a3ab25e26421001033bd7ea36c86aca2b02)
Conflicts:
src/pybind/mgr/dashboard/frontend/src/locale/messages.en-US.xlf
- Deleted this file
Stephan Müller [Wed, 13 Nov 2019 12:16:55 +0000 (13:16 +0100)]
mgr/dashboard: Fix pool renaming functionality
The problem was that, if a pool was renamed the routine to update tried
to work on the old pool name and didn't used the info that the pool got
renamed, therefore an error occurred in the UI saying that the pool
could not be found.
Fixes: https://tracker.ceph.com/issues/42776 Signed-off-by: Stephan Müller <smueller@suse.com>
(cherry picked from commit de933cd3c82b6a7d5c4ddfa77804509c9fcaa3db)
Conflicts:
qa/tasks/mgr/dashboard/test_pool.py:
- Ignore incoming quota test
Ernesto Puerta [Thu, 1 Oct 2020 10:43:52 +0000 (12:43 +0200)]
mgr/dashboard: fix broken backporting
A [previous backport](https://github.com/ceph/ceph/pull/35367) from a
[master PR](https://github.com/ceph/ceph/pull/32829) changed the testing
condition for PG status from 'incomplete' to 'unknown'.
Casey Bodley [Mon, 31 Aug 2020 15:19:34 +0000 (11:19 -0400)]
radosgw-admin: period pull command is not always a raw_storage_op
if a --url is given, 'period pull' does not depend on any zone/period
configuration and can be a raw_storage_op. if we get a --remote instead,
we do need to initialize the zone/period configuration to find the
correct endpoint/access keys
Aleksei Gutikov [Mon, 30 Mar 2020 12:27:45 +0000 (15:27 +0300)]
mgr: decrease pool stats if pg was removed
After merge of placement groups resulting pg contains
objects from itself and merged one.
PGMap::apply_incremental treat this growth as pool stats delta,
but forget to decrease stats for removed pg.
Fixes: https://tracker.ceph.com/issues/44815 Signed-off-by: Aleksei Gutikov <aleksey.gutikov@synesis.ru>
(cherry picked from commit 6090acdae4495e11f117df2330b579744eeada2a)
This will crash the choose_acting() procedure as it will mistakenly
think that peer 3 should continue to perform asynchronous recovery
(e.g., due to num_objects_missing = 1) in contrast to fully
backfill-recovered.
While I did not dig into the real cause, there are a couple of
possible explanations of how num_objects can be off. I think that
if a roll forward or log replay could delete something twice, maybe
there would be an undercount. Or maybe something as simple as a
corruption.
Since _update_calc_stats() is going to fix num_objects_missing
for that peer anyway, let's make sure it always starts with a
clean state.
Casey Bodley [Fri, 29 May 2020 16:31:16 +0000 (12:31 -0400)]
rgw: fix shutdown crash in RGWAsyncReadMDLogEntries
RGWAsyncReadMDLogEntries must not store pointers into coroutine memory,
because it's not guaranteed to outlive our call. store these by-value
instead, and have RGWReadMDLogEntriesCR::request_complete() copy/move
them back on completion
When rgw_bucket_unlink_instance removes the last instance of a name, it
also clears the value of rgw_bucket_olh_entry.key. However, bucket index
resharding uses this key when choosing its shard placement, so an empty
key causes all of these olh entries to be misplaced in shard 0. After
reshard, all of the olh recovery/cleanup logic would be sent to the
correct shard, and these misplaced olh entries would never be cleaned
up.
Preserving the key's name on last unlink allows the olh entry to be
resharded correctly and cleaned up normally.
Soumya Koduri [Tue, 16 Jun 2020 12:40:08 +0000 (18:10 +0530)]
rgw: Empty reqs_change_state queue before unregistered_reqs
In RGWHTTPManager::manage_pending_request(), before unregistering
or unlinking the http requests, empty the reqs_change_state list
to avoid use after free.
if an existing object is cached with an object version, but it's
mutated without updating that version number, clear the OBJV flag so
that later cache reads asking for an object version result in a miss and
re-read the version from the osd
Casey Bodley [Thu, 6 Aug 2020 16:57:13 +0000 (12:57 -0400)]
rgw: system object cache tracks version over increments
instead of checking write_version before the write (which doesn't take
cls_version_inc() into account), check read_version after apply_write()
has been called. only cache the result if we got a read_version != 0
Casey Bodley [Tue, 4 Aug 2020 19:03:35 +0000 (15:03 -0400)]
rgw: RGWObjVersionTracker tracks read version over increments
when no write_version is given, cls_version_inc() is used to increment
the version so other writers can use cls_version_check() to detect races
however, apply_write() will clear its cached read_version, which means
that later writes can no longer use cls_version_check() to detect other
racing writers
in cases where cls_version_inc() is used AND we know the previous version,
we can increment the cached read_version and preserve the ability to use
cls_version_check(). we know the previous version if we provided a valid
read_version to cls_version_check() and it succeeded
Matthew Oliver [Thu, 9 Jul 2020 06:13:05 +0000 (06:13 +0000)]
rgw: Swift API anonymous access should 401
There was a previous patch to fix this but turns out that only fixed it
for the Swift V1 auth. And it actaully broke keystone because it didn't
take into account the idiosyncrasies of multi tenancy. Which resulted in
the incorect behaviour for keystone. Worse, because it didn't take
tenants properly into account keystone ACLs where broken.
This patch reworks, and simplifies the original patch to work for both
auths. It even extends the ThirdPartyAccountApplier to check for an ANON
user and properly scope it to a tenant.
Fixes: https://tracker.ceph.com/issues/46295 Signed-off-by: Matthew Oliver <moliver@suse.com>
(cherry picked from commit 67081098dc2dddd80d52d5acd166e68954cae618)
Conflicts:
src/rgw/rgw_swift_auth.h
- only need to modify the user related code to rgw_user construct
mgr/dashboard: Custom Directive for verifying if user is read_only
This commit introduces two new Custom Directives: `FormInputDisableDirective` and `FormScopeDirective`.
By using the `cdFormScope` attribute of the directive we can customize the behaviour of the modal components.
Conflicts:
src/pybind/mgr/dashboard/frontend/src/app/shared/directives/directives.module.ts
- Import the FormInputDisableDirective and FormScopeDirective to the directive.module imports and exports
src/pybind/mgr/dashboard/frontend/src/app/shared/directives/form-input-disable.directive.spec.ts
- Changed TestBed.inject(...) to TestBed.get(...) to match the syntax for the nautilus TS version
src/pybind/mgr/dashboard/frontend/src/app/shared/directives/form-input-disable.directive.ts
- Changed some of the operators to match the nautilus TS version
msg/msg_types: entity_addrvec_t: fix decode on big-endian hosts
When decoding an entity_addrvec_t with marker 1, we just have
a single (non-legacy) entity_addr_t. This should be decoded
exactly the same as done by entity_addr_t::decode, but it
currently is not. Specifically, the sa_family member of
the sockaddr is not converted from the on-wire little-endian
format to host byte order (as done by entity_addr_t::decode).
Fixed by using the same code as in entity_addr_t::decode.
Ulrich Weigand [Tue, 18 Aug 2020 07:51:22 +0000 (09:51 +0200)]
messages,mds: Fix decoding of enum types on big-endian systems
When a struct member that has enum type needs to be encoded or
decoded, we need to use an explicit integer type, since there
are no encode routines for the enum type. (This is probably
to avoid introducing dependencies on implementation-defined
choices by the compiler to use a particular underlying type.)
This leads to code sequences along the lines of:
encode((int32_t)state, bl);
and
decode((int32_t&)(state), bl);
The encode line is actually fine, but the decode line is
incorrect on big-endian systems if the underlying type of
the enum differs from the explicitly chosen integer type.
This is because this performs in effect a pointer cast,
and will write the decoded int32_t value into the memory
backing the "state" member variable. If the sizes differ,
the value is written into the wrong bytes of "state" on
big-endian systems.
This patch fixes the problem by decoding into an intermediate
variable of the integer type first, and then casting the result
while assigning to the struct member of enum type.
This bug showed up initially as invalid health-status values
causing Ceph daemon aborts on s390x. I've tried to find and
fix all other instances of the same enum decode pattern as well.
rbd: make common options override krbd-specific options
ceph-csi has added support for passing custom map and unmap options via
mapOptions and unmapOptions storage class parameters. However, it also
uses --read-only for implementing ROX (ReadOnlyMany) PVs. If the user
supplies "mapOptions: rw", they will get around the intended read-only
restriction (at least on the block device).
ceph-csi could be patched to use "-o ro", but it actually makes sense
for common options to win over device type-specific equivalents.
Conflicts:
src/tools/rbd/action/Kernel.cc [ snapshot quiesce support and
commit 34f539d8af33 ("rbd: delay parsing of default kernel map
options") not in nautilus ]