Skip to content
Snippets Groups Projects
Commit 62ac9c65 authored by John L. Hammond's avatar John L. Hammond Committed by Oleg Drokin
Browse files

LU-10989 utils: correct lustre_rsync changelog clear logic


In the non-extended rename case of lr_replicate() copy the record
number from ext to info. Then remove the spurious rename record
handling from lr_clear_cl().

Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Change-Id: I615ec2f384f5f9d7807156acb3ce66ac47ca1e77
Reviewed-on: https://review.whamcloud.com/32247


Tested-by: Jenkins
Tested-by: default avatarMaloo <hpdd-maloo@intel.com>
Reviewed-by: default avatarSebastien Buisson <sbuisson@ddn.com>
Reviewed-by: default avatarJian Yu <jian.yu@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
parent 75c0f9c7
No related branches found
No related tags found
No related merge requests found
...@@ -1396,14 +1396,9 @@ int lr_read_log() ...@@ -1396,14 +1396,9 @@ int lr_read_log()
int lr_clear_cl(struct lr_info *info, int force) int lr_clear_cl(struct lr_info *info, int force)
{ {
char mdt_device[LR_NAME_MAXLEN + 1]; char mdt_device[LR_NAME_MAXLEN + 1];
long long rec;
int rc = 0; int rc = 0;
if (force || info->recno > status->ls_last_recno + CLEAR_INTERVAL) { if (force || info->recno > status->ls_last_recno + CLEAR_INTERVAL) {
if (info->type == CL_RENAME)
rec = info->recno + 1;
else
rec = info->recno;
if (!noclear && !dryrun) { if (!noclear && !dryrun) {
/* llapi_changelog_clear modifies the mdt /* llapi_changelog_clear modifies the mdt
* device name so make a copy of it until this * device name so make a copy of it until this
...@@ -1413,20 +1408,21 @@ int lr_clear_cl(struct lr_info *info, int force) ...@@ -1413,20 +1408,21 @@ int lr_clear_cl(struct lr_info *info, int force)
status->ls_mdt_device); status->ls_mdt_device);
rc = llapi_changelog_clear(mdt_device, rc = llapi_changelog_clear(mdt_device,
status->ls_registration, status->ls_registration,
rec); info->recno);
if (rc) if (rc)
printf("Changelog clear (%s, %s, %lld) " printf("Changelog clear (%s, %s, %lld) "
"returned %d\n", status->ls_mdt_device, "returned %d\n", status->ls_mdt_device,
status->ls_registration, rec, rc); status->ls_registration, info->recno,
} rc);
if (!rc && !dryrun) { }
status->ls_last_recno = rec;
lr_write_log();
} if (!rc && !dryrun) {
} status->ls_last_recno = info->recno;
lr_write_log();
}
}
return rc; return rc;
} }
/* Locate a usable version of rsync. At this point we'll use any /* Locate a usable version of rsync. At this point we'll use any
...@@ -1611,6 +1607,7 @@ int lr_replicate() ...@@ -1611,6 +1607,7 @@ int lr_replicate()
snprintf(info->name, sizeof(info->name), "%s", snprintf(info->name, sizeof(info->name), "%s",
ext->name); ext->name);
info->is_extended = 1; info->is_extended = 1;
info->recno = ext->recno; /* For lr_clear_cl(). */
} }
if (dryrun) if (dryrun)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment