@@ -21,11 +21,11 @@ examining, modifying, and extracting data from journals.
2121Syntax
2222------
2323
24- ::
24+ .. parsed-literal ::
2525
26- cephfs-journal-tool journal <inspect|import|export|reset>
27- cephfs-journal-tool header <get|set>
28- cephfs-journal-tool event <get|splice|apply > [filter] <list|json|summary|binary>
26+ cephfs-journal-tool [ :ref: ` options<cephfs_journal_tool_options> `] journal <inspect|import|export|reset>
27+ cephfs-journal-tool [ :ref: ` options<cephfs_journal_tool_options> `] header <get|set> <trimmed_pos|expire_pos|write_pos|pool_id> <value >
28+ cephfs-journal-tool [ :ref: ` options<cephfs_journal_tool_options> `] event <get|splice|recover_dentries > [filter] <list|json|summary|binary>
2929
3030
3131 The tool operates in three modes: ``journal ``, ``header `` and ``event ``,
@@ -43,11 +43,13 @@ This should be your starting point to assess the state of a journal.
4343 present and can be decoded.
4444
4545* ``import `` and ``export `` read and write binary dumps of the journal
46- in a sparse file format. Pass the filename as the last argument. The
47- export operation may not work reliably for journals which are damaged (missing
46+ in a sparse file format. Pass the filename as the last argument. The import operation checks
47+ if the imported journal FSID matches with the online cluster FSID. Using ``--force `` skips
48+ the FSID check. The export operation may not work reliably for journals which are damaged (missing
4849 objects).
4950
50- * ``reset `` truncates a journal, discarding any information within it.
51+ * ``reset `` truncates a journal, discarding any information within it. Using ``--force `` does a
52+ hard reset without trying to recover from on-disk.
5153
5254
5355Example: journal inspect
@@ -93,7 +95,7 @@ Header mode
9395* ``get `` outputs the current content of the journal header
9496
9597* ``set `` modifies an attribute of the header. Allowed attributes are
96- ``trimmed_pos ``, ``expire_pos `` and ``write_pos ``.
98+ ``trimmed_pos ``, ``expire_pos ``, ``write_pos `` and `` pool_id ``.
9799
98100Example: header get/set
99101~~~~~~~~~~~~~~~~~~~~~~~
@@ -134,7 +136,9 @@ Actions:
134136
135137* ``get `` read the events from the log
136138* ``splice `` erase events or regions in the journal
137- * ``apply `` extract file system metadata from events and attempt to apply it to the metadata store.
139+ * ``recover_dentries `` recover the dentries from the journal. It does a selective offline replay
140+ which only reads out dentries and writes them to the backing store if their version is greater
141+ than what is currently in the backing store.
138142
139143Filtering:
140144
@@ -152,7 +156,7 @@ Filters may be combined on an AND basis (i.e. only the intersection of events fr
152156Output modes:
153157
154158* ``binary ``: write each event as a binary file, within a folder whose name is controlled by ``--path ``
155- * ``json ``: write all events to a single file, as a JSON serialized list of objects
159+ * ``json ``: write all events to a single file specified by `` --path `` , as a JSON serialized list of objects.
156160* ``summary ``: write a human readable summary of the events read to standard out
157161* ``list ``: write a human readable terse listing of the type of each event, and
158162 which file paths the event affects.
@@ -209,11 +213,11 @@ Example: event mode
209213 OPEN: 1
210214 UPDATE: 2
211215
212- # cephfs-journal-tool event apply --range 0x410bf1.. summary
216+ # cephfs-journal-tool event recover_dentries summary
213217 Events by type:
214- NOOP : 1
215- SESSION : 1
216- UPDATE: 9
218+ LID : 1
219+ SUBTREEMAP : 1
220+ Errors: 0
217221
218222 # cephfs-journal-tool event get --inode=1099511627776 list
219223 0x40068b UPDATE: (mkdir)
@@ -237,3 +241,12 @@ Example: event mode
237241 # cephfs-journal-tool event get binary --path bin_events
238242 Wrote output to binary files in directory 'bin_events'
239243
244+ .. _cephfs_journal_tool_options :
245+
246+ Options
247+ ~~~~~~~
248+
249+ * ``--rank=<filesystem>:{mds-rank|all} `` Used to specify the filesystem, the MDS rank or all ranks.
250+ * ``--journal=<mdlog|purge_queue> `` The journal type. The default value is ``mdlog ``, which is the
251+ only option that supports event mode. When ``purge_queue `` is used, the journal scanner creates
252+ a PurgeItem object and adds it to EventMap for processing.
0 commit comments