Bug #69708
closedcephfs-journal-tool: journal reset leaves the old journal objects untrimmed
0%
Description
Found this while working on the downstream BZ https://bugzilla.redhat.com/show_bug.cgi?id=2331118
Please take a look at https://bugzilla.redhat.com/show_bug.cgi?id=2331118#c25
Problem Description:
I looked into the code and found that the cephfs-journal-tool updates the expire_pos,write_pos,read_pos to the new_start (old_write_pos + 1) and writes
this out to the journal header. So when the mds restarts after recovery dentry, it would fetch new udpated exire_pos, write_pos, read_pos, so the trimming
happens from new expire_pos. The old journal log objects never get trimmed!!!
Please find the relevant code below of cephfs-journal-tool.
---------------
int Resetter::reset()
{
...
...
lock.lock();
uint64_t old_start = journaler.get_read_pos();
uint64_t old_end = journaler.get_write_pos();
uint64_t old_len = old_end - old_start;
cout << "old journal was " << old_start << "~" << old_len << std::endl;
uint64_t new_start = round_up_to(old_end+1, journaler.get_layout_period());
cout << "new journal start will be " << new_start
<< " (" << (new_start - old_end) << " bytes past old end)" << std::endl;
journaler.set_read_pos(new_start);
journaler.set_write_pos(new_start);
journaler.set_expire_pos(new_start);
journaler.set_trimmed_pos(new_start);
journaler.set_writeable();
cout << "writing journal head" << std::endl;
journaler.write_head(new C_SafeCond(mylock, cond, &done, &r));
....
}
--------------------
We have the following output of the journal reset command executed at the customer site.
------------
bash-5.1$ cephfs-journal-tool --rank=ocs-storagecluster-cephfilesystem:0 journal reset
old journal was 1305835407849959~27424540185
new journal start will be 1305862836584448 (4194304 bytes past old end)
writing journal head
writing EResetJournal entry
done
-------------
Need to figure out if can the above and delete the unused stale journal log objects.
AS Updated by Arshdeep Singh almost 2 years ago
Can you provide more info on this , I want to contribute on this, what approach would you suggest for this
VS Updated by Venky Shankar almost 2 years ago
- Category set to Administration/Usability
- Status changed from New to Triaged
- Assignee set to Kotresh Hiremath Ravishankar
- Priority changed from Normal to High
- Target version set to v20.0.0
- Source set to Development
- Backport set to reef,squid
VS Updated by Venky Shankar almost 2 years ago
Arshdeep Singh wrote in #note-1:
Can you provide more info on this , I want to contribute on this, what approach would you suggest for this
Hey, I assigned this to Kotresh since he was already working through the details as I know.
I suggest to start attending cephfs standups (link in community calender) if you want to get started with cephfs development.
PD Updated by Patrick Donnelly over 1 year ago
- Target version deleted (
v20.0.0)
KH Updated by Kotresh Hiremath Ravishankar about 1 year ago
- Status changed from Triaged to Fix Under Review
- Pull request ID set to 65577
KH Updated by Kotresh Hiremath Ravishankar about 1 year ago
- Backport changed from reef,squid to reef,squid,tentacle
VS Updated by Venky Shankar about 1 year ago
- Target version set to v21.0.0
- Labels (FS) offline added
VS Updated by Venky Shankar about 1 year ago
- Status changed from Fix Under Review to Pending Backport
UB Updated by Upkeep Bot about 1 year ago
- Copied to Backport #73129: reef: cephfs-journal-tool: journal reset leaves the old journal objects untrimmed added
UB Updated by Upkeep Bot about 1 year ago
- Copied to Backport #73130: squid: cephfs-journal-tool: journal reset leaves the old journal objects untrimmed added
UB Updated by Upkeep Bot about 1 year ago
- Copied to Backport #73131: tentacle: cephfs-journal-tool: journal reset leaves the old journal objects untrimmed added
UB Updated by Upkeep Bot about 1 year ago
- Merge Commit set to 15ebe516433b5cc0a91992a624ed34b5b5d01484
- Fixed In set to v20.3.0-3149-g15ebe51643
- Upkeep Timestamp set to 2025-09-19T03:58:33+00:00
UB Updated by Upkeep Bot about 1 year ago
- Tags (freeform) set to backport_processed
UB Updated by Upkeep Bot 3 months ago
- Status changed from Pending Backport to Backporting
- Tags (freeform) deleted (
backport_processed) - Upkeep Timestamp changed from 2025-09-19T03:58:33+00:00 to 2026-08-27T18:07:15+00:00
UB Updated by Upkeep Bot about 1 month ago
- Released In set to v21.2.0~2026
- Upkeep Timestamp changed from 2026-08-27T18:07:15+00:00 to 2026-10-24T01:08:19+00:00
UB Updated by Upkeep Bot 30 days ago
- Released In changed from v21.2.0~2026 to v21.2.0~2027
- Upkeep Timestamp changed from 2026-10-24T01:08:19+00:00 to 2026-11-04T01:06:52+00:00