Project

General

Profile

Actions

Bug #69708

open

cephfs-journal-tool: journal reset leaves the old journal objects untrimmed

Added by Kotresh Hiremath Ravishankar about 1 year ago. Updated 6 months ago.

Status:
Pending Backport
Priority:
High
Category:
Administration/Usability
Target version:
% Done:

0%

Source:
Development
Backport:
reef,squid,tentacle
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
tools
Labels (FS):
offline
Pull request ID:
Tags (freeform):
backport_processed
Fixed In:
v20.3.0-3149-g15ebe51643
Released In:
Upkeep Timestamp:
2025-09-19T03:58:33+00:00

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.

Related issues 3 (2 open1 closed)

Copied to CephFS - Backport #73129: reef: cephfs-journal-tool: journal reset leaves the old journal objects untrimmedResolvedKotresh Hiremath RavishankarActions
Copied to CephFS - Backport #73130: squid: cephfs-journal-tool: journal reset leaves the old journal objects untrimmedQA TestingKotresh Hiremath RavishankarActions
Copied to CephFS - Backport #73131: tentacle: cephfs-journal-tool: journal reset leaves the old journal objects untrimmedQA TestingKotresh Hiremath RavishankarActions
Actions #1

Updated by Arshdeep Singh about 1 year ago

Can you provide more info on this , I want to contribute on this, what approach would you suggest for this

Actions #2

Updated by Venky Shankar about 1 year 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
Actions #3

Updated by Venky Shankar about 1 year 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.

Actions #4

Updated by Patrick Donnelly 9 months ago

  • Target version deleted (v20.0.0)
Actions #5

Updated by Kotresh Hiremath Ravishankar 6 months ago

  • Status changed from Triaged to Fix Under Review
  • Pull request ID set to 65577
Actions #6

Updated by Kotresh Hiremath Ravishankar 6 months ago

  • Backport changed from reef,squid to reef,squid,tentacle
Actions #7

Updated by Venky Shankar 6 months ago

  • Target version set to v21.0.0
  • Labels (FS) offline added
Actions #8

Updated by Venky Shankar 6 months ago

  • Status changed from Fix Under Review to Pending Backport
Actions #9

Updated by Upkeep Bot 6 months ago

  • Copied to Backport #73129: reef: cephfs-journal-tool: journal reset leaves the old journal objects untrimmed added
Actions #10

Updated by Upkeep Bot 6 months ago

  • Copied to Backport #73130: squid: cephfs-journal-tool: journal reset leaves the old journal objects untrimmed added
Actions #11

Updated by Upkeep Bot 6 months ago

  • Copied to Backport #73131: tentacle: cephfs-journal-tool: journal reset leaves the old journal objects untrimmed added
Actions #12

Updated by Upkeep Bot 6 months 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
Actions #13

Updated by Upkeep Bot 6 months ago

  • Tags (freeform) set to backport_processed
Actions

Also available in: Atom PDF