Skip to content

panic: pg 1.38f: conflicting mapping(s) found when trying to map from 66 to 19 #5

Closed

Description

@k0ste

When try to verify #4 I found a panic for pgremapper :D

# ./pgremapper cancel-backfill --verbose
** executing: ceph osd dump -f json
** executing: ceph pg dump pgs_brief -f json
** executing: ceph pg dump pgs_brief -f json
panic: pg 1.38f: conflicting mapping(s) found when trying to map from 66 to 19

goroutine 86 [running]:
main.(*mappingState).remap(0xc000012030, 0xc0004ac354, 0x5, 0x42, 0x13)
        /pgremapper/mappingstate.go:76 +0x7a5
main.calcPgMappingsToUndoBackfill.func3(0xc00010e0c0, 0x5abe00, 0xc00011acc0, 0xc0000b4010, 0xc0000b4020, 0xc0000db5f4)
        /pgremapper/main.go:690 +0x373
created by main.calcPgMappingsToUndoBackfill
        /pgremapper/main.go:633 +0x185

All outputs are attached Archive.zip

Activity

  1. baergj commented on May 29, 2021

    @baergj
    Contributor

    Thanks for the report! I'll try to take a look next week.

    This is commonly caused by Ceph not cleaning out stale upmaps, and pgremapper is perhaps overly cautious when it encounters this. We will often manually ceph OSD rm-pg-upmap-items <pgid> in this case if we're about to cancel backfill anyway, but I think there are ways to safely and gracefully handle this better within the tool.

  2. baergj commented on Jun 5, 2021

    @baergj
    Contributor

    Here's the upmap entry for this PG:

            {
                "pgid": "1.38f",
                "mappings": [
                    {
                        "from": 51,
                        "to": 3
                    },
                    {
                        "from": 19,
                        "to": 11
                    }
                ]
            },

    And the current PG state:

            {
                "pgid": "1.38f",
                "state": "active+remapped+backfill_wait",
                "up": [
                    3,
                    66,
                    11
                ],
                "acting": [
                    3,
                    19,
                    39
                ],
                "up_primary": 3,
                "acting_primary": 3
            },

    This is definitely a bug; there's already an upmap 19->11 and pgremapper is trying to do 66->19. It should be doing 66->39. The issue, I think, is that cancel-backfill doesn't take existing upmaps that haven't been backfilled yet into account properly. For EC this is a bit easier because the positions within the sets is meaningful, and thus we can rely on the positioning to understand which chunk is moving where; for replicated pools I have yet to find a concept of a "replica ID" that can be used to match the acting and up sets and thus we attempt to reorder the up and acting sets so that their ordering is the same for any shared elements. I suspect the best fix will be for the sort to take into account the upmaps for the PG.

    A workaround in this case would be to ceph osd pg-upmap-items 1.38f 51 3 and then re-run cancel-backfill.

  3. k0ste commented on Jun 6, 2021

    @k0ste
    ContributorAuthor

    We will often manually ceph OSD rm-pg-upmap-items <pgid> in this case if we're about to cancel backfill anyway

    We too. As suggestion, my be pgremapper can handle this for like a exception and message to stdout, instead panic?🤔

  4. baergj commented on Jun 17, 2021

    @baergj
    Contributor

    Whew, sorry for the silence - been a busy couple weeks.

    Indeed, error handling can be improved in general in this area. I suspect that as we further improve the resilience of the upmap engine then the panics will disappear.

  5. baergj commented on Jun 17, 2021

    @baergj
    Contributor

    Fixed by #7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions