Whamcloud - gitweb
LU-15280 llog: fix processing of a wrapped catalog 08/45708/23
authorEtienne AUJAMES <etienne.aujames@cea.fr>
Wed, 1 Dec 2021 23:22:33 +0000 (00:22 +0100)
committerEtienne AUJAMES <etienne.aujames@cea.fr>
Wed, 8 Feb 2023 19:02:56 +0000 (20:02 +0100)
commit0087f5428484dc1fbab66fabb661d8700b1cac9a
treeaee90b337487aa346bf42938ab8be5415b6a5ae9
parent0568f4ca253049d324956e3d89ece0cbd2ff2155
LU-15280 llog: fix processing of a wrapped catalog

Several issues were found with "lfs changelog --follow" for a wrapped
catalog (llog_cat_process() with startidx):

1/ incorrect lpcd_first_idx value for a wrapped catalog (startcat>0)

The first llog index to process is "lpcd_first_idx + 1". The startidx
represents the last record index processed for a llog plain. The
catalog index of this llog is startcat.
lpcd_first_idx of a catalog should be set to "startcat - 1"
e.g:
llog_cat_process(... startcat=10, startidx=101) means that the
processing will start with the llog plain at the index 10 of the
catalog. And the first record to process will be at index 102.

2/ startidx is not reset for an incorrect startcat index

startidx is relevant only for a startcat. So if the corresponding llog
plain is removed or if startcat is out of range, we need to reset
startidx.

This patch remove LLOG_CAT_FIRST, that was really confusing
(LU-14158). And update osp_sync_thread() with the
llog_cat_process() corrected behavior.

It modifies also llog_cat_retain_cb() to zap empty plain llog directly
in it (like for llog_cat_size_cb()), the current implementation is not
compatible with this patch.

The test "conf-sanity 135" verify "lfs changelog --follow" for a
wrapped changelog_catalog.

Test-Parameters: testlist=conf-sanity env=ONLY=135,ONLY_REPEAT=10
Test-Parameters: testlist=sanity env=ONLY=60a,ONLY_REPEAT=20
Test-Parameters: testlist=conf-sanity env=SLOW=yes,ONLY=106,ONLY_REPEAT=10
Fixes: a4f049b9 ("LU-13102 llog: fix processing of a wrapped catalog")
Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Change-Id: Iaf46ddd4a6ec1e06cec0d17aa9bde766bd793abc
lustre/include/lustre_log.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/lod/lod_dev.c
lustre/obdclass/llog.c
lustre/obdclass/llog_cat.c
lustre/obdclass/llog_osd.c
lustre/osp/osp_sync.c
lustre/tests/conf-sanity.sh
lustre/tests/test-framework.sh