Skip to content

rgw: flush bucket logs to old target on config change - #71236

Merged
chardan merged 2 commits into
ceph:mainfrom
chardan:rgw-jfw-op-flush-bucket-logs-78902
Sep 28, 2026
Merged

chardan merged 2 commits into
ceph:mainfrom
chardan:rgw-jfw-op-flush-bucket-logs-78902

Conversation

@chardan

@chardan chardan commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

When a bucket logging configuration changed target buckets, RGW rolled over the pending log object through the newly configured target bucket while using the old configuration. Pending records for the old target could be left behind, and the response could name an object that was not written to the new target.

See: https://tracker.ceph.com/issues/78902
And: https://tracker.ceph.com/issues/79049

Assisted-by: Codex:GPT-5

Signed-off-by: Jesse F. Williamson [email protected]

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)
    • Includes unit test(s)
    • Includes integration test(s)
    • Includes bug reproducer
    • No tests

@chardan chardan self-assigned this Aug 21, 2026
@chardan
chardan requested a review from cbodley August 21, 2026 22:02
@chardan

chardan commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

I'd like to convert the logging to use dout_fmt() while I'm here, but as that's not really related to fixing the bug I'll leave it be for now.

@chardan
chardan marked this pull request as ready for review August 23, 2026 14:19
@chardan
chardan requested a review from a team as a code owner August 23, 2026 14:19
@chardan

chardan commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@chardan
chardan requested a review from ivancich August 27, 2026 15:31
@yuvalif yuvalif mentioned this pull request Sep 3, 2026
4 of 14 tasks
@yuvalif
yuvalif requested a review from nbalacha September 3, 2026 11:36
@chardan
chardan force-pushed the rgw-jfw-op-flush-bucket-logs-78902 branch from d8e9cda to 3f5c4e3 Compare September 4, 2026 22:28
@nbalacha

nbalacha commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

When the logging mode is Standard, the conf change still leaves a dangling shadow object containing the REST.PUT.LOGGING entry for the conf change.

On checking the rados pool entries post the conf change:

[testserver build]$ bin/rados ls -p default.rgw.buckets.data
logging..bucket.69e8dbf8-1026-4755-b847-0b6e2bd59fbc.4177.2/test-log-1/
69e8dbf8-1026-4755-b847-0b6e2bd59fbc.4177.1_object-1
69e8dbf8-1026-4755-b847-0b6e2bd59fbc.4177.2__shadow_test-log-1/2026-09-07-04-58-19-000000000083HD2K0
69e8dbf8-1026-4755-b847-0b6e2bd59fbc.4177.1_object-2
69e8dbf8-1026-4755-b847-0b6e2bd59fbc.4177.2__shadow_test-log-1/2026-09-07-05-00-57-0000000001JN98OV0
69e8dbf8-1026-4755-b847-0b6e2bd59fbc.4177.2_test-log-1/2026-09-07-04-58-19-000000000083HD2K
[testserver build]$ bin/rados -p default.rgw.buckets.data get 69e8dbf8-1026-4755-b847-0b6e2bd59fbc.4177.2__shadow_test-log-1/2026-09-07-05-00-57-0000000001JN98OV0 obj
[testserver build]$ cat obj
root-user my-test-bucket [07/Sep/2026:05:00:57 +0000] ::1 root-user tx00000a3864e35fedaf288-006a9e4509-4177-default REST.PUT.LOGGING - "PUT /my-test-bucket?logging HTTP/1.1" 200 - 206 - - 23ms - "aws-cli/2.33.27 md/awscrt#0.31.2 ua/2.1 os/linux#5.14.0-654.el9.x86_64 md/arch#x86_64 lang/python#3.13.11 md/pyimpl#CPython m/E,N,W,b,n,Z cfg/retry-mode#standard md/installer#exe md/distrib#centos.9 md/prompt#off md/command#s3api.put-bucket-logging" - - SigV4 - AuthHeader localhost - - Yes

69e8dbf8-1026-4755-b847-0b6e2bd59fbc.4177.2__shadow_test-log-1/2026-09-07-05-00-57-0000000001JN98OV0 is a dangling shadow object.

@nbalacha

nbalacha commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

@chardan , does the pull request id for https://tracker.ceph.com/issues/78902 need to be set to this PR?

@nbalacha

nbalacha commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

When the logging mode is Standard, the conf change still leaves a dangling shadow object containing the REST.PUT.LOGGING entry for the conf change.

This is an existing issue unrelated to this PR. RGWPutBucketLoggingOp::execute() should use s->bucket to perform the attr modifications instead of loading a separate instance of src_bucket.
This also causes a shadow object containing the REST.PUT.LOGGING entry to be left behind when logging is disabled on a source bucket.

Opened https://tracker.ceph.com/issues/80362 to track this.

@chardan
chardan requested a review from yuvalif September 10, 2026 17:32
@yuvalif yuvalif mentioned this pull request Sep 10, 2026
@chardan

chardan commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

@yuvalif includes commits from #71637

@yuvalif

yuvalif commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

@chardan , does the pull request id for https://tracker.ceph.com/issues/78902 need to be set to this PR?

  • moved back to "open" state
  • set the right PR number
  • added backports

yuvalif

This comment was marked as duplicate.

@yuvalif
yuvalif self-requested a review September 15, 2026 09:03
}
if (const auto ret = driver->load_bucket(this, old_target_bucket_id,
&old_target_bucket, y);
ret < 0) {

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.

we should be silently ignoring this error only in case of ENOENT
all other errors should fail the op

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok. Although note that by this point the new config has actually been written, so it seems like returning a failure might be some "false advertising"?

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.

you are right, and i guess that a retry won't help at this point.
the next time since we will have old_conf == new_conf.
so we won't try to re-flush the logs.

i wonder if there is any reason to return an error in any of the other places. lines 322, 352

When a bucket logging configuration changed target buckets, RGW rolled over the pending log object through the newly configured target bucket while using the old configuration. Pending records for the old target could be left behind, and the response could name an object that was not written to the new target.

See: https://tracker.ceph.com/issues/78902
And: https://tracker.ceph.com/issues/79049

Assisted-by: Codex:GPT-5

Signed-off-by: Jesse F. Williamson <[email protected]>
@chardan
chardan force-pushed the rgw-jfw-op-flush-bucket-logs-78902 branch from 3f5c4e3 to 7293d6b Compare September 15, 2026 17:29
so, any failure in flushing after the conf was modified
should be treated as a warning (for possible data loss)

Signed-off-by: Yuval Lifshitz <[email protected]>
@yuvalif
yuvalif requested a review from a team as a code owner September 17, 2026 11:42
@yuvalif

yuvalif commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

@chardan @nbalacha added b3af613
tried to unify the handling of failures after the conf change.
returning an error and asking the client for retry won't help, since the configuration already changed the "old" conf and the new one will be the same...

added a note in the docs on that

@chardan

chardan commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

@yuvalif Thanks for the addition! Please be sure to include any new test or test changes to check the expected behavior. Appreciated!

@chardan
chardan requested a review from yuvalif September 17, 2026 16:33
@yuvalif

yuvalif commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

@yuvalif Thanks for the addition! Please be sure to include any new test or test changes to check the expected behavior. Appreciated!

not sure how to reliably test it. i can try a racing conf change with bucket deletion, but this would be a flaky test

@chardan

chardan commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

Yeah, we don't need more of those...

@anrao19

anrao19 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by anuchaithra started 2026-09-22-04:11.

@anrao19

anrao19 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

@yuvalif

yuvalif commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by anuchaithra started 2026-09-22-04:11.

@chardan , build creation failed, could you please check : https://shaman.ceph.com/builds/ceph/wip-anuchaithra-testing-20260922.041044-main/

looks like compilation error related to some other PR you have there:

 error: 'class ConfigValues' has no member named 'rgw_inject_delay_pattern'; did you mean 'rgw_inject_delay_sec'?
    src/rgw/services/svc_sys_obj_cache.cc:464
    src/rgw/driver/rados/rgw_data_sync.cc:4708
    src/rgw/driver/rados/rgw_sync.cc:1365, 1376

there is no config option added here.

@chardan

chardan commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

@yuvalif I don't think that's anything from my end... it appears to maybe be from PR 67399, commit e36dd3d
@anrao19

@chardan

chardan commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

@yuvalif / @anrao19 Are we ok with this merging at this point?

@yuvalif

yuvalif commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

@yuvalif / @anrao19 Are we ok with this merging at this point?

@chardan the compilation error is unrelated to this PR. However, it still has to pass teuthology before being merged.

@anrao19 can you please build and test it gain (the failurew in shaman was unrelated to this PR)?

@anrao19

anrao19 commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

@yuvalif / @anrao19 Are we ok with this merging at this point?

@chardan the compilation error is unrelated to this PR. However, it still has to pass teuthology before being merged.

@anrao19 can you please build and test it gain (the failurew in shaman was unrelated to this PR)?

pr testing completed and approved by @ivancich , more details in https://tracker.ceph.com/issues/80713.
@chardan , if no further testing is needed then this pr can be merged.

@chardan
chardan merged commit 6b9e8b0 into ceph:main Sep 28, 2026
19 checks passed
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.

4 participants