Project

Profile

Help

Issue #5977

closed

Issue #5976: Migrate only content from the specified repositories

Migrated Content counters are wrong

Added by ipanova@redhat.com about 4 years ago. Updated almost 3 years ago.

Status:
CLOSED - WORKSFORME
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

The ProgressReport uses the total count of PulpContent, rather than the true number migrated, which is downloaded content + lazy content in a repo being actively migrated.

$ pulp-admin repo list
+----------------------------------------------------------------------+
                              Repositories
+----------------------------------------------------------------------+

Id:                  file
Display Name:        None
Description:         None
Content Unit Counts: 
  Iso: 3

Id:                  file2
Display Name:        None
Description:         None
Content Unit Counts: 
  Iso: 3

Id:                  file-many
Display Name:        None
Description:         None
Content Unit Counts: 
  Iso: 250

Id:                  file-large
Display Name:        None
Description:         None
Content Unit Counts: 
  Iso: 10

(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 pulp-2to3-migration]$ http POST :24817/pulp/api/v3/migration-plans/ plan='{"plugins": [{ "type": "iso", "repositories" :  [{"name": "file","pulp2_importer_repository_id": "file", "repository_versions": [{"pulp2_repository_id": "file"}]}]}]}'
HTTP/1.1 201 Created
Allow: GET, POST, HEAD, OPTIONS
Connection: close
Content-Length: 289
Content-Type: application/json
Date: Mon, 13 Jan 2020 18:49:40 GMT
Location: /pulp/api/v3/migration-plans/ae1e5041-3cb5-4ca7-aa52-33aea081f0a8/
Server: gunicorn/20.0.4
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
    "plan": {
        "plugins": [
            {
                "repositories": [
                    {
                        "name": "file",
                        "pulp2_importer_repository_id": "file",
                        "repository_versions": [
                            {
                                "pulp2_repository_id": "file"
                            }
                        ]
                    }
                ],
                "type": "iso"
            }
        ]
    },
    "pulp_created": "2020-01-13T18:49:40.893261Z",
    "pulp_href": "/pulp/api/v3/migration-plans/ae1e5041-3cb5-4ca7-aa52-33aea081f0a8/"
}

(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 pulp-2to3-migration]$ http POST :24817/pulp/api/v3/migration-plans/ae1e5041-3cb5-4ca7-aa52-33aea081f0a8/run/
HTTP/1.1 202 Accepted
Allow: POST, OPTIONS
Connection: close
Content-Length: 67
Content-Type: application/json
Date: Mon, 13 Jan 2020 18:49:58 GMT
Server: gunicorn/20.0.4
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
    "task": "/pulp/api/v3/tasks/1528d333-8209-4465-9e69-c26a6d7eeeee/"
}

(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 pulp-2to3-migration]$ http GET :24817/pulp/api/v3/tasks/1528d333-8209-4465-9e69-c26a6d7eeeee/
HTTP/1.1 200 OK
Allow: GET, PATCH, DELETE, HEAD, OPTIONS
Connection: close
Content-Length: 1680
Content-Type: application/json
Date: Mon, 13 Jan 2020 18:52:41 GMT
Server: gunicorn/20.0.4
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
    "created_resources": [
        "/pulp/api/v3/repositories/file/file/4788f61a-815a-42fb-9331-ec6787d08281/versions/1/"
    ],
    "error": null,
    "finished_at": "2020-01-13T18:50:08.206748Z",
    "name": "pulp_2to3_migration.app.tasks.migrate.migrate_from_pulp2",
    "progress_reports": [
        {
            "code": "premigrating.repositories",
            "done": 1,
            "message": "Pre-migrating Pulp 2 repositories, importers, distributors",
            "state": "completed",
            "suffix": null,
            "total": 1
        },
        {
            "code": "creating.repositories",
            "done": 1,
            "message": "Creating repositories in Pulp 3",
            "state": "completed",
            "suffix": null,
            "total": 1
        },
        {
            "code": "migrating.importers",
            "done": 1,
            "message": "Migrating importers to Pulp 3",
            "state": "completed",
            "suffix": null,
            "total": 1
        },
        {
            "code": "premigrating.content.general",
            "done": 266,
            "message": "Pre-migrating Pulp 2 ISO content (general info)",
            "state": "completed",
            "suffix": null,
            "total": 266
        },
        {
            "code": "premigrating.content.detail",
            "done": 266,
            "message": "Pre-migrating Pulp 2 ISO content (detail info)",
            "state": "completed",
            "suffix": null,
            "total": 266
        },
        {
            "code": "migrating.content",
            "done": 266,
            "message": "Migrating content to Pulp 3",
            "state": "completed",
            "suffix": null,
            "total": 266
        },
        {
            "code": "migrating.iso.content",
            "done": 266,
            "message": "Migrating iso content to Pulp 3 iso",
            "state": "completed",
            "suffix": null,
            "total": 266
        },
        {
            "code": "migrating.distributors",
            "done": 0,
            "message": "Migrating distributors to Pulp 3",
            "state": "completed",
            "suffix": null,
            "total": 1
        }
    ],
    "pulp_created": "2020-01-13T18:49:58.745661Z",
    "pulp_href": "/pulp/api/v3/tasks/1528d333-8209-4465-9e69-c26a6d7eeeee/",
    "reserved_resources_record": [
        "pulp_2to3_migration"
    ],
    "started_at": "2020-01-13T18:49:58.846424Z",
    "state": "completed",
    "worker": "/pulp/api/v3/workers/53cf0e07-b984-441d-8373-f7c0894fb750/"
}

Python 3.6.8 (default, Aug  7 2019, 17:28:10) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.11.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: Pulp2RepoContent.objects.count()                                                                                                                                                                           
Out[1]: 3

In [2]: Pulp2Repository.objects.count()                                                                                                                                                                            
Out[2]: 1

In [3]: Pulp2Content.objects.count()                                                                                                                                                                               
Out[3]: 266

In [4]: Pulp2ISO.objects.count()                                                                                                                                                                                   
Out[4]: 266

In [5]: FileContent.objects.count()                                                                                                                                                                                
Out[5]: 13

There have not been migrated 266 iso units in reality.

Also available in: Atom PDF