Skip to content

rgw/lc: fixed the radosgw-admin lc list started epoch time - #71544

Open
Amitgb14 wants to merge 2 commits into
ceph:mainfrom
Amitgb14:main
Open

Amitgb14 wants to merge 2 commits into
ceph:mainfrom
Amitgb14:main

Conversation

@Amitgb14

@Amitgb14 Amitgb14 commented Sep 3, 2026 •

Copy link
Copy Markdown

The single-bucket lifecycle path used by 'radosgw-admin lc process --bucket' writes the LC pool entry with only the status updated, leaving start_time at its default-initialized value of 0 for buckets that have never been processed by the periodic LC worker. As a result, 'radosgw-admin lc list' displays "started: Thu, 01 Jan 1970 00:00:00 GMT" for such entries, and stale-session detection in expired_session() compares against a bogus timestamp.

Stamp entry.start_time with the current time before writing the entry, matching RGWLC::process() for the periodic-shard path.

Before,

[
    {
        "bucket": ":mybucket:dc59444a-db3c-4b42-a029-1cc805136e06.4243.1",
        "started": "Thu, 01 Jan 1970 00:00:00 GMT",
        "status": "COMPLETE"
    }
]

After,

[
    {
        "bucket": ":mybucket:dc59444a-db3c-4b42-a029-1cc805136e06.4243.1",
        "started": "Thu, 03 Sep 2026 06:33:00 GMT",
        "status": "COMPLETE"
    }
]

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

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 x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

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)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@Amitgb14
Amitgb14 requested a review from a team as a code owner September 3, 2026 23:23
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

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 ci-approved to allow Jenkins CI jobs to run.

@github-actions github-actions Bot added the rgw label Sep 3, 2026
@RaminNietzsche

Copy link
Copy Markdown
Member

@Amitgb14
Thanks for the fix! The root cause analysis looks solid to me.

The problem is that the admin path to process a bucket was setting the lc_processing value, but was not recording the entry.start_time value at the same time. The location of the fix also seems correct. Recording the start_time immediately before set_entry() seems like a better choice than doing it earlier in the function.

@RaminNietzsche

Copy link
Copy Markdown
Member

There’s some related LC work in #71453 (reverting 541d13a / the multi-RGW expired_session() issue).

As far as I can tell, that revert doesn’t set start_time in the admin process_bucket() path, so it seems like this PR may still be needed for correct lc list output and LC pool metadata.

The changes look independent to me and should hopefully merge cleanly together.

Comment thread src/rgw/rgw_lc.cc Resolved
@Amitgb14

Amitgb14 commented Sep 5, 2026

Copy link
Copy Markdown
Author

Hi @RaminNietzsche and @kchheda3, I have reworked the patch to initialize start_time only when it is unset, so an ad-hoc run never overwrites a timestamp the periodic worker recorded. I've added a regression test in a second commit.

@Amitgb14

Copy link
Copy Markdown
Author

@kchheda3, could you please review the changes?

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@RaminNietzsche

Copy link
Copy Markdown
Member

@ceph/rgw

@RaminNietzsche RaminNietzsche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the rework. Preserving an existing start_time addresses the "ad-hoc must not overwrite the scheduled session" concern for buckets the worker has already processed.

One case still changes scheduled behaviour: for a bucket that has never been processed, the first lc process --bucket now stores today's start_time with COMPLETE, so the next scheduled pass hits already_run_today() and skips the bucket for the day (before this change, already_run_today(0) was false). That is probably fine since the bucket was just processed, but it is exactly the interaction @kchheda3 raised, so it would be good to confirm it is intended and mention it in the commit message.

Smaller points:

  • Could the workunit also cover the scheduled interaction: an ad-hoc run followed by lc process (no --bucket) with rgw_lc_debug_interval, asserting the expected skip or process?
  • The first assertion pins the Thu, 01 Jan 1970 display for a never-processed entry; that will break if lc list later prints something nicer for an unset value.
  • Nit: ceph_clock_now().sec() would make the utime_t to uint64_t conversion explicit.

The single-bucket lifecycle path used by 'radosgw-admin lc process
--bucket' writes the LC pool entry with only the status updated,
leaving start_time at its default-initialized value of 0 for buckets
that have never been processed by the periodic LC worker. As a
result, 'radosgw-admin lc list' displays "started: Thu, 01 Jan 1970
00:00:00 GMT" for such entries, and an entry left at 0 while
PROCESSING is treated as an expired session by the periodic worker.

Initialize entry.start_time before writing the entry, but only when
it has never been set. An ad-hoc run must not overwrite a timestamp
that is already recorded for the entry, since already_run_today() and
expired_session() in the periodic-shard path read that value; a
second ad-hoc run therefore leaves 'started' unchanged.

For a bucket that has never been processed, the first ad-hoc run now
records start_time, so a scheduled pass later the same day sees
COMPLETE and already_run_today() and skips the bucket. This is
intended: the bucket was just processed. Buckets already processed by
the periodic worker keep their existing start_time, so their schedule
is unchanged. Likewise, if that first ad-hoc run is interrupted while
PROCESSING, the entry is no longer treated as immediately stale
(start_time == 0); expired_session() clears it on a later worker
cycle, as for an interrupted scheduled run.

Before,
[
    {
        "bucket": ":mybucket:dc59444a-db3c-4b42-a029-1cc805136e06.4243.1",
        "started": "Thu, 01 Jan 1970 00:00:00 GMT",
        "status": "COMPLETE"
    }
]

After,
[
    {
        "bucket": ":mybucket:dc59444a-db3c-4b42-a029-1cc805136e06.4243.1",
        "started": "Thu, 03 Sep 2026 06:33:00 GMT",
        "status": "COMPLETE"
    }
]

Fixes: https://tracker.ceph.com/issues/80264
Signed-off-by: Amit Ghadge <[email protected]>
Adds a workunit covering the 'started' value reported by
'radosgw-admin lc list' and its interaction with scheduled processing:

  - an entry that has never been processed is UNINITIAL
  - an ad-hoc 'lc process --bucket' initializes 'started'
  - a second ad-hoc run does not overwrite it
  - a scheduled 'lc process' in the same rgw_lc_debug_interval skips
    the bucket (already_run_today())
  - a scheduled 'lc process' in a later interval processes it

Signed-off-by: Amit Ghadge <[email protected]>
@Amitgb14

Copy link
Copy Markdown
Author

Thanks @RaminNietzsche for your feedback. I'm started working on the suggested changes.

@RaminNietzsche

Copy link
Copy Markdown
Member

jenkins test make check

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.

3 participants