Skip to content

[Upgrade to >= 3.4] | I8866_DispatchRegionCodesFixingJobs - FixRegionCodes Job #11758

@bozana

Description

@bozana

Update (07.04.26): for the final solution see #11758 (comment)

Update (31.0326): for the final solution see #11758 (comment)


Valid Title

  • I have updated the title to accurately reflect the bug description

Description

S. the messages in this issue, from here on: #8866 (comment)
The lib/pkp/lib/regionMapping.php contains fixes for the old region codes. For some regions, the fix cannot be applied twice, because the fixed region code would actually be seen as the code to be fixed, in some cases.
If the job FixRegionCodes fails, it will be re-tried again, which could then lead to invalid region codes in the DB.
Thus, a new solution is needed, that inserts a marker, e.g. a prefix for the codes to be fixed (so that only this entries with the marker are considered for update) and that additionally splits the lines to update into chunks (so that no timeout happens in huge installations).

The new solution uses smaller and chained jobs, that can be re-tried. All the region that needs to be fixed are marked with the prefix 'pkp-'. Then the regions containing the prefix are fixed. The jobs are per country and 100000 rows.

Steps to Reproduce

  1. Have entries in the DB table metrics_submission_geo_daily and/or metrics_submission_geo_monthly with some of those region codes, e.g.
    country = 'KH', region = '09'
  2. run the FixRegionCodes job
  3. the region should now be '10'
  4. run the FixRegionCodes job
  5. the region is now '11', which is wrong, it should be '10'

Expected Result

After running the job several times the region code should still be correct. From example above: region should be '10'

Actual Result

After running the job several times the region code is wrongly fixed again. From example above: region is '11'

Environment Details

No response

Application Version

OJS, OMP, OPS version >= 3.4

Logs

No response

Additional Information

No response


PRs:

stable-3_4_0:

stable-3_5_0:

Fix 1:

main:

Fix 1:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions