Skip to content

rgw: emit bucket logging records for lifecycle delete actions - #69264

Merged
yuvalif merged 2 commits into
ceph:mainfrom
ShreeJejurikar:wip-bucket-logging-lifecycle
Jul 1, 2026
Merged

yuvalif merged 2 commits into
ceph:mainfrom
ShreeJejurikar:wip-bucket-logging-lifecycle

Conversation

@ShreeJejurikar

@ShreeJejurikar ShreeJejurikar commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

LC actions that remove an object: current expiration, noncurrent expiration, and the source-delete branch of cloud-tier transitions, now emit a LIFECYCLE.DELETE.OBJECT journal record to the bucket's logging target.

The bucketlogging frontend's log_record() and verify_target_bucket_policy() gain no-req_state overloads so callers without a request state (LC, and future non-HTTP callers) share the same code path. The req_state-bearing overloads route through the no-req_state primitives, so PutBucketLogging config validation and per-record log writes use identical inputs: source_account from bucket->get_owner() and a minimal IAM env with only aws:SourceArn and aws:SourceAccount. This eliminates a class of bugs where a logging configuration could validate at PUT time but fail at log time (or vice versa).

LC integration tests in src/test/rgw/bucket_logging/test_bucket_logging.py cover:

  • current expiration on a non-versioned bucket
  • current expiration on a versioned bucket (creates a delete marker; original version becomes noncurrent)
  • noncurrent expiration
  • ExpiredObjectDeleteMarker (negative: must not log)
  • Expiration's DM-cleanup branch (negative: must not log)
  • LC on a bucket with no logging config (safety)

Testing

  • vstart (MON=1 OSD=1 RGW=1) on Ubuntu 24.04, build clean
  • Standard mode: 16 passed / 6 skipped (5 LC tests are Journal-only by design + 1 pre-existing #75295 skip)
  • Journal mode: 21 passed / 1 skipped (the 1 is the same pre-existing #75295 skip)
  • Teuthology pending a shaman build

Note for review

T6 (test_lc_versioned_current_expiration_logs_journal_record) pins the journal record's version_id to '-' for versioned current-expiration — LC selects the object by key (not by version), so the SAL object's instance is unset and the formatter emits the placeholder. Happy to set obj->set_instance(o.key.instance) before remove_expired_obj in this PR if logging the actual version id is preferred; otherwise leaving the behavior as observed.

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)

@ShreeJejurikar
ShreeJejurikar requested a review from a team as a code owner June 3, 2026 11:36
@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

16 similar comments
@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

Comment thread src/rgw/rgw_bucket_logging.cc Resolved
Comment thread src/rgw/rgw_bucket_logging.cc Resolved
Comment thread src/rgw/rgw_bucket_logging.h Resolved
Comment thread src/rgw/rgw_bucket_logging.h Resolved
Comment thread src/rgw/rgw_bucket_logging.cc Resolved
Comment thread src/rgw/rgw_bucket_logging.cc Resolved
Comment thread src/rgw/rgw_bucket_logging.cc Resolved
Comment thread src/rgw/rgw_bucket_logging.cc Resolved
Comment thread src/rgw/rgw_bucket_logging.cc Resolved
Comment thread src/rgw/rgw_bucket_logging.cc Resolved
Comment thread src/rgw/rgw_lc.cc Resolved
Comment thread src/rgw/rgw_lc.cc Resolved
@yuvalif
yuvalif requested a review from nbalacha June 10, 2026 18:03
LC delete actions now emit LIFECYCLE.DELETE.OBJECT journal records
via no-req_state overloads of the bucketlogging frontend.

Signed-off-by: ShreeJejurikar <[email protected]>
@ShreeJejurikar
ShreeJejurikar force-pushed the wip-bucket-logging-lifecycle branch from 63a25ae to efeb0fe Compare June 11, 2026 07:19
@yuvalif
yuvalif self-requested a review June 11, 2026 13:59
@yuvalif

yuvalif commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

jenkins test windows

@yuvalif

yuvalif commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check

@yuvalif

yuvalif commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@yuvalif

yuvalif commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

jenkins test submodules

@yuvalif

yuvalif commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

jenkins test signed

@mattbenjamin mattbenjamin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the lc specific stuff looks fine

@anrao19

anrao19 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

pr testing completed and approved by @ivancich , more details : https://tracker.ceph.com/issues/77460.
@ShreeJejurikar , if no further testing is need. This pr can be merged

@anrao19

anrao19 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@anrao19

anrao19 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

jenkins test windows

1 similar comment
@yuvalif

yuvalif commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

jenkins test windows

@yuvalif
yuvalif merged commit 96aea14 into ceph:main Jul 1, 2026
6 checks passed
adamemerson added a commit to adamemerson/ceph that referenced this pull request Jul 24, 2026
When the `rgw_copious_policy_logging` option is set to true, a
detailed trace of policy evaluation is logged.

Assisted-by: Claude Opus 4.6 <[email protected]>
(I wanted to see how it performed on rebase conflict resolution.)
Assisted-by: Claude Fable 5 <[email protected]>
(I figured I should have it look at the policy evaluation code for
bugs while it's included, and it found a few mistakes in output.)
Signed-off-by: Adam C. Emerson <[email protected]>
(cherry picked from commit 7bdb627)

Conflicts:
	src/rgw/rgw_bucket_logging.cc
 - Clash with minimal environment production from
   <ceph#69264>.

Fixes: https://tracker.ceph.com/issues/78661
Signed-off-by: Adam C. Emerson <[email protected]>
adamemerson added a commit to adamemerson/ceph that referenced this pull request Aug 20, 2026
When the `rgw_copious_policy_logging` option is set to true, a
detailed trace of policy evaluation is logged.

Assisted-by: Claude Opus 4.6 <[email protected]>
(I wanted to see how it performed on rebase conflict resolution.)
Assisted-by: Claude Fable 5 <[email protected]>
(I figured I should have it look at the policy evaluation code for
bugs while it's included, and it found a few mistakes in output.)
Signed-off-by: Adam C. Emerson <[email protected]>

Conflicts:
	src/common/options/rgw.yaml.in
 - Intervening options in upstream and other backports
	src/rgw/rgw_bucket_logging.cc
 - Clash with minimal environment production from
   <ceph#69264>.
	src/rgw/rgw_common.cc
	src/rgw/rgw_op.cc
 - Clash with change in `RestrictPublicBuckets` handling in
   <ceph#64293>.
	src/test/rgw/test_rgw_iam_policy.cc
 - Original commit modified upstream tests (keystone, etc.) not in
   downstream

Fixes: https://tracker.ceph.com/issues/78662
(cherry picked from commit 7bdb627)
batrick pushed a commit to adamemerson/ceph that referenced this pull request Aug 21, 2026
When the `rgw_copious_policy_logging` option is set to true, a
detailed trace of policy evaluation is logged.

Assisted-by: Claude Opus 4.6 <[email protected]>
(I wanted to see how it performed on rebase conflict resolution.)
Assisted-by: Claude Fable 5 <[email protected]>
(I figured I should have it look at the policy evaluation code for
bugs while it's included, and it found a few mistakes in output.)
Signed-off-by: Adam C. Emerson <[email protected]>

Conflicts:
	src/common/options/rgw.yaml.in
 - Intervening options in upstream and other backports
	src/rgw/rgw_bucket_logging.cc
 - Clash with minimal environment production from
   <ceph#69264>.
	src/rgw/rgw_common.cc
	src/rgw/rgw_op.cc
 - Clash with change in `RestrictPublicBuckets` handling in
   <ceph#64293>.
	src/test/rgw/test_rgw_iam_policy.cc
 - Original commit modified upstream tests (keystone, etc.) not in
   downstream

Fixes: https://tracker.ceph.com/issues/78662
(cherry picked from commit 7bdb627)
adamemerson added a commit to adamemerson/ceph that referenced this pull request Sep 21, 2026
When the `rgw_copious_policy_logging` option is set to true, a
detailed trace of policy evaluation is logged.

Assisted-by: Claude Opus 4.6 <[email protected]>
(I wanted to see how it performed on rebase conflict resolution.)
Assisted-by: Claude Fable 5 <[email protected]>
(I figured I should have it look at the policy evaluation code for
bugs while it's included, and it found a few mistakes in output.)
Signed-off-by: Adam C. Emerson <[email protected]>

Conflicts:
	src/common/options/rgw.yaml.in
 - Intervening options in upstream and other backports
	src/rgw/rgw_bucket_logging.cc
 - Clash with minimal environment production from
   <ceph#69264>.
	src/rgw/rgw_common.cc
	src/rgw/rgw_op.cc
 - Clash with change in `RestrictPublicBuckets` handling in
   <ceph#64293>.
	src/test/rgw/test_rgw_iam_policy.cc
 - Original commit modified upstream tests (keystone, etc.) not in
   downstream

Fixes: https://tracker.ceph.com/issues/78662
(cherry picked from commit 7bdb627)
adamemerson added a commit to adamemerson/ceph that referenced this pull request Oct 9, 2026
When the `rgw_copious_policy_logging` option is set to true, a
detailed trace of policy evaluation is logged.

Assisted-by: Claude Opus 4.6 <[email protected]>
(I wanted to see how it performed on rebase conflict resolution.)
Assisted-by: Claude Fable 5 <[email protected]>
(I figured I should have it look at the policy evaluation code for
bugs while it's included, and it found a few mistakes in output.)
Signed-off-by: Adam C. Emerson <[email protected]>

Conflicts:
	src/common/options/rgw.yaml.in
 - Intervening options in upstream and other backports
	src/rgw/rgw_bucket_logging.cc
 - Clash with minimal environment production from
   <ceph#69264>.
	src/rgw/rgw_common.cc
	src/rgw/rgw_op.cc
 - Clash with change in `RestrictPublicBuckets` handling in
   <ceph#64293>.
	src/test/rgw/test_rgw_iam_policy.cc
 - Original commit modified upstream tests (keystone, etc.) not in
   downstream

Fixes: https://tracker.ceph.com/issues/78662
(cherry picked from commit 7bdb627)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants