Repository navigation
rgw/multisite: validate the cached version on metadata sync reads - #71143
SaravananPalanisamyRWTH wants to merge 7 commits into
Conversation
|
Thank you for your contribution. Since you are not yet a member of the Ceph organization with write permissions on ceph/ceph.git, our CI will not automatically run. Any member of the Ceph organization may label this PR |
Add an expected_version to sysobj reads. When it is set and the cached entry is at a different version, the cache missed an update, so the object is read from RADOS instead of being served from the cache. rgw_get_system_obj() takes the expected_version and passes it down. Fixes: https://tracker.ceph.com/issues/77731 Signed-off-by: Saravanan Palanisamy <[email protected]>
Bucket entrypoint, bucket instance and user info reads take an expected_version and pass it to the sysobj read. binfo_cache sits ahead of the sysobj cache, so a bucket instance entry that does not match the expected version is dropped and re-read. Fixes: https://tracker.ceph.com/issues/77731 Signed-off-by: Saravanan Palanisamy <[email protected]>
RGWMetadataManager::get() and every metadata handler's get() take an optional expected_version and pass it to the read of their object. The topic chained cache sits ahead of the sysobj cache, so a topic entry that does not match the expected version is dropped and re-read. The otp handler ignores it, since cls_otp reads do not use the sysobj cache. Fixes: https://tracker.ceph.com/issues/77731 Signed-off-by: Saravanan Palanisamy <[email protected]>
A system request may send optional rgwx-expected-version-tag and rgwx-expected-version-ver on GET /admin/metadata. Fixes: https://tracker.ceph.com/issues/77731 Signed-off-by: Saravanan Palanisamy <[email protected]>
If distribute_cache() drops the notification, the primary's other RGW daemons keep serving an entry older than RADOS for up to rgw_cache_expiry_interval, and a secondary syncing that entry replicates the stale version. It shows up as 403 AccessDenied on the secondary from an obsolete owner or ACL, with a clean sync status. Send the version from the mdlog entry with the metadata GET, so the primary re-reads from RADOS when its cached copy is not at that version. Full sync sends does not send expected_version Fixes: https://tracker.ceph.com/issues/77731 Signed-off-by: Saravanan Palanisamy <[email protected]>
RGWBucketCtl::link_bucket() calls store_bucket_entrypoint_info() to store the bucket entrypoint object in cache and mdlog entry. The link_bucket() callers (RadosBucket::link() and RRGWBucketAdminOp::link()) construct bucket entrypoint object without object version. link_bucket() does not read the stored version either. Hence the cache and mdlog entry carries empty tag and version 0. Read the stored entrypoint when ep_objv has no version. Signed-off-by: Saravanan Palanisamy <[email protected]>
Tests: https://tracker.ceph.com/issues/77731 Signed-off-by: Saravanan Palanisamy <[email protected]>
769b08b to
ceb4eea
Compare
| } else { | ||
| /* store_bucket_entrypoint_info() below needs the current version, or | ||
| * the correspoding mdlog entry has an empty tag and zero version */ | ||
| if (!pinfo || rot.read_version.tag.empty()) { |
There was a problem hiding this comment.
now that we will be reading the entrypoint whenever ep_objv is empty, this entrypoint read uses the sysobj cache. on PUT /admin/bucket the radosgw may already hold a stale entry from a missed distribute_cache(), so the store could check the old version and return -ECANCELED. the test written in the PR may not exercise this because radosgw-admin starts with an empty cache, unlike the admin rest api. maybe this read could skip the cache, so -ECANCELED means an actual concurrent link?
There was a problem hiding this comment.
> maybe this read could skip the cache, so -ECANCELED means an actual concurrent link?
hmm even if this read skips the cache, a writer can still commit between the read and store_bucket_entrypoint_info and bump the rados version. basically, if that read_bucket_entrypoint_info leaves a stale version in rot or that race, could make store_bucket_entrypoint_info below return -ECANCELED due to version mismatch while RGWBucketAdminOp::link() would have already unlinked the bucket from the old owner and moved the instance to the new owner. done_err would then remove the new owner too, before link() sees -ECANCELED, leading to inconsistent ownership.
There was a problem hiding this comment.
the purpose is to give mdlog entry a version. how about we just generate one with generate_new_write_ver() on a local tracker? it gives the store_bucket_entrypoint_info and the mdlog a version without the read.
Fixes: https://tracker.ceph.com/issues/77731
If a
distribute_cache()notification is lost, RGW gateways keep serving stale metadata untilrgw_cache_expiry_interval. PR #69748 guards against a late cache update overwriting a newer one, but a dropped notification leaves no update to reject.In multisite this leads to durable wrong metadata on the secondary, typically a 403 AccessDenied from an obsolete owner, while sync status reports no errors.
Every mdlog entry in secondary sync already contains the expected version of the metadata to be fetched from master. That version is now sent to the master as rgwx-expected-version-* params on the GET request, and the master answers from its cache only when the entry is at that version, otherwise reading from RADOS.
Fixed
link_bucket(), which wrote the bucket entrypoint and its mdlog entry without a version (empty tag, ver 0). Bothbucket linkandbucket chownwere affected, from the CLI and the admin REST API.Known gaps: full sync does not rely on mdlog entry and hence no expected-version is sent. Account and group changes are never written to the mdlog.
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.