Project

Profile

Help

Issue #2666

closed

Rsync publish for RPM repo fails to run in fast forward mode

Added by yuzheng about 7 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.12.1
Platform Release:
2.13.1
OS:
Triaged:
Yes
Groomed:
Yes
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Sprint 19
Quarter:

Description

Reproducing steps:
1. Create a RPM repo with default configurations. Upload some rpms/srpms to the repo.

$ curl -k -X POST https://10.66.136.68/pulp/api/v2/repositories/ -H "Content-Type: application/json" -H  "Authorization: Basic YWRtaW46YWRtaW4=" -d '{"display_name": "test-repo38", "description": "test repo", "distributors": [{"distributor_id": "yum_distributor", "distributor_type_id": "yum_distributor", "distributor_config": {"http": true, "https": false, "relative_url": "content/dist/test-repo38"}}, {"distributor_id": "cdn_distributor", "distributor_type_id": "rpm_rsync_distributor", "distributor_config": {"remote": {"auth_type": "publickey", "ssh_user": "cdn", "host": "10.66.136.68", "root": "/home/cdn/", "ssh_identity_file": "/var/www/.ssh/id_rsa"}, "predistributor_id": "yum_distributor"}}], "notes": {"_repo-type": "rpm-repo", "relative_url": "content/dist/test-repo38"}, "importer_type_id": "yum_importer", "id": "test-repo38"}'
$ pulp-admin rpm repo uploads rpm --repo-id test-repo38 --file fox-1.1-2.noarch.rpm
$ pulp-admin rpm repo uploads srpm --repo-id test-repo38 --file test-srpm01-1.0-1.src.rpm

2. Run yum publish and rsync publish.

$ curl -k -X POST https://10.66.136.68/pulp/api/v2/repositories/test-repo38/actions/publish/ -H "Content-Type: application/json" -H  "Authorization: Basic YWRtaW46YWRtaW4=" -d '{"id": "yum_distributor", "override_config": {}}'
$ curl -k -X POST https://10.66.136.68/pulp/api/v2/repositories/test-repo38/actions/publish/ -H "Content-Type: application/json" -H  "Authorization: Basic YWRtaW46YWRtaW4=" -d '{"id": "cdn_distributor", "override_config": {}}'

3. Repeat step 2, and check status of the 2nd rsync publish task.

$ pulp-admin tasks details --task-id c64f9c6f-d150-4c4f-b8e2-67888f8380d3
+----------------------------------------------------------------------+
                              Task Details
+----------------------------------------------------------------------+

Operations:       publish
Resources:        test-repo38 (repository)
State:            Successful
Start Time:       2017-03-27T04:08:19Z
Finish Time:      2017-03-27T04:08:20Z
Result:           
  Completed:           2017-03-27T04:08:20Z
  Details:             
    Description:   
    Details:       
    Error Details: 
    Items Total:   2
    Num Failures:  0
    Num Processed: 2
    Num Success:   2

No new unit has been added to the repo since last publish, and default publish mode should be fast forward. However, all units in the repo are processed here. The problem might be last_published is incorrectly set to None when last_deleted has no value.

/usr/lib/python2.7/site-packages/pulp/plugins/rsync/publish.py
348         if self.last_deleted:
349             last_deleted = self.last_deleted.replace(tzinfo=None)
350         else:
351             last_published = None

Related issues

Has duplicate Pulp - Issue #2743: If unit has never been deleted from a repo, rsync distributor incorrectly forces full publishCLOSED - DUPLICATEActions
Copied to RPM Support - Issue #2844: Rsync publish for RPM repo fails to run in fast forward modeCLOSED - CURRENTRELEASEdalleyActions

Also available in: Atom PDF