Skip to content

panic: pg 18.48: conflicting mapping(s) found when trying to map from 72 to 527 #10

Closed

Description

@timureh

Hi!
What I've done:

drained osd
waited all active+clean
did norebalance, nobackfill flags
stopped this osd
did ceph osd purge for this osd
I got remapped pgs
When I tried to do a cancell-backfill I got a panic:

./pgremapper cancel-backfill --verbose
'--yes' is not provided, running in report mode

** executing: ceph osd dump -f json
** executing: ceph pg dump pgs_brief -f json
** executing: ceph osd dump -f json
** executing: ceph pg dump pgs_brief -f json
** executing: ceph osd dump -f json
** executing: ceph osd dump -f json
panic: pg 18.48: conflicting mapping(s) found when trying to map from 72 to 527

goroutine 82 [running]:
main.(*mappingState).remap(0xc0000123f0, 0xc000e5d605, 0x5, 0x48, 0x20f)
	/pgremapper/mappingstate.go:76 +0x7a5
main.calcPgMappingsToUndoBackfill.func3(0xc00094a000, 0xc000012300, 0xc0000126c0, 0xc000182cc0, 0xc000948000, 0xc000948010, 0xc001240040)
	/pgremapper/main.go:703 +0x3d3
created by main.calcPgMappingsToUndoBackfill
	/pgremapper/main.go:646 +0x1a5

All dumps are needed in the attachment
dump.zip

Activity

  1. baergj commented on Aug 13, 2021

    @baergj
    Contributor

    Thanks for your report! I just got back from some time off and am looking at this now.

    Here's the current upmap entry for the given PG:

        {
          "pgid": "18.48",
          "mappings": [
            {
              "from": 72,
              "to": 606
            }
          ]
        },

    And the current PG state:

        {
          "pgid": "18.48",
          "state": "active+remapped+backfilling",
          "up": [
            72,
            165,
            606
          ],
          "acting": [
            165,
            606,
            527
          ],
          "up_primary": 72,
          "acting_primary": 165
        },

    That existing mapping is stale (72->606 is obviously ignored given that both are in the up set). pgremapper will need to learn how to automatically clean up stale upmap items (something that Ceph should probably be doing itself, but alas).

    To work around this, you can ceph osd rm-pg-upmap-items 18.48 for now.

  2. timureh commented on Aug 16, 2021

    @timureh
    Author

    yes it solved the problem.
    Thank you!

    please clarify whether you plan to teach the pgremapper to detect such a situation and delete it automatically?

  3. baergj commented on Aug 16, 2021

    @baergj
    Contributor

    We definitely plan to fix this!

  4. reopened this on Aug 16, 2021
  5. k0ste commented on Sep 1, 2021

    @k0ste
    Contributor

    Hope this fixable... Because sometimes this upmaps blocks pgremapper work not only 1-2 times 🥺

       54  2021-09-01 11:35:07 ./upmap_cancel_backfill.sh
       55  2021-09-01 11:35:32 ceph osd rm-pg-upmap-items 47.fec
       56  2021-09-01 11:35:34 ./upmap_cancel_backfill.sh
       57  2021-09-01 11:35:41 ceph osd rm-pg-upmap-items 47.fbb
       58  2021-09-01 11:35:42 ./upmap_cancel_backfill.sh
       59  2021-09-01 11:35:49 ceph osd rm-pg-upmap-items 47.eed
       60  2021-09-01 11:35:50 ./upmap_cancel_backfill.sh
       61  2021-09-01 11:35:57 ceph osd rm-pg-upmap-items 47.eb1
       62  2021-09-01 11:35:58 ./upmap_cancel_backfill.sh
       63  2021-09-01 11:36:05 ceph osd rm-pg-upmap-items 47.599
       64  2021-09-01 11:36:08 ./upmap_cancel_backfill.sh
       65  2021-09-01 11:36:15 ceph osd rm-pg-upmap-items 47.367
       66  2021-09-01 11:36:17 ./upmap_cancel_backfill.sh
       67  2021-09-01 11:36:23 ceph osd rm-pg-upmap-items 47.e8
       68  2021-09-01 11:36:24 ./upmap_cancel_backfill.sh
       69  2021-09-01 11:36:30 ceph osd rm-pg-upmap-items 47.221
       70  2021-09-01 11:36:31 ./upmap_cancel_backfill.sh
       71  2021-09-01 11:36:37 ceph osd rm-pg-upmap-items 47.27a
       72  2021-09-01 11:36:39 ./upmap_cancel_backfill.sh
       73  2021-09-01 11:36:45 ceph osd rm-pg-upmap-items 47.6ce
       74  2021-09-01 11:36:46 ./upmap_cancel_backfill.sh
       75  2021-09-01 11:36:51 ceph osd rm-pg-upmap-items 47.9b6
       76  2021-09-01 11:36:53 ./upmap_cancel_backfill.sh
  6. k0ste commented on Oct 14, 2021

    @k0ste
    Contributor

    @baergj any plan to fix this in code? The problem occurs too often for pgremapper satisfaction, I think to add handler in script, like panic: pg ${pgid}: conflicting mapping(s) found ; do rm-pg-upmap-items...

     1536  2021-10-14 13:05:44 ceph osd rm-pg-upmap-items 1.561
     1538  2021-10-14 13:05:52 ceph osd rm-pg-upmap-items 3.34b
     1540  2021-10-14 13:06:01 ceph osd rm-pg-upmap-items 3.310
     1542  2021-10-14 13:06:08 ceph osd rm-pg-upmap-items 3.2f9
     1544  2021-10-14 13:06:20 ceph osd rm-pg-upmap-items 1.14b
     1546  2021-10-14 13:06:28 ceph osd rm-pg-upmap-items 1.147
     1548  2021-10-14 13:06:37 ceph osd rm-pg-upmap-items 3.136
     1550  2021-10-14 13:06:44 ceph osd rm-pg-upmap-items 1.db
     1552  2021-10-14 13:06:51 ceph osd rm-pg-upmap-items 1.c6
     1554  2021-10-14 13:07:00 ceph osd rm-pg-upmap-items 1.a7
     1556  2021-10-14 13:07:07 ceph osd rm-pg-upmap-items 3.4f
     1558  2021-10-14 13:07:16 ceph osd rm-pg-upmap-items 2.73
     1560  2021-10-14 13:07:23 ceph osd rm-pg-upmap-items 1.187
     1562  2021-10-14 13:07:32 ceph osd rm-pg-upmap-items 3.1e9
     1564  2021-10-14 13:07:39 ceph osd rm-pg-upmap-items 3.23e
     1566  2021-10-14 13:07:47 ceph osd rm-pg-upmap-items 1.252
     1568  2021-10-14 13:07:55 ceph osd rm-pg-upmap-items 3.266
     1570  2021-10-14 13:08:03 ceph osd rm-pg-upmap-items 3.273
     1572  2021-10-14 13:08:11 ceph osd rm-pg-upmap-items 3.28f
     1574  2021-10-14 13:08:18 ceph osd rm-pg-upmap-items 1.2a2
     1576  2021-10-14 13:08:27 ceph osd rm-pg-upmap-items 1.62f
     1578  2021-10-14 13:08:34 ceph osd rm-pg-upmap-items 1.739
     1580  2021-10-14 13:08:41 ceph osd rm-pg-upmap-items 1.79f
     1582  2021-10-14 13:08:47 ceph osd rm-pg-upmap-items 1.7f8
  7. baergj commented on Oct 14, 2021

    @baergj
    Contributor

    Yeah, sorry for the delay. We'll get to it, but not sure when yet; maybe someone in the community will beat us to it. :)

  8. k0ste commented on Oct 18, 2021

    @k0ste
    Contributor

    @baergj thanks, make a hack for this issue for us 🙂

    #!/bin/bash
    
    CHECK=$1
    PG_REMAPPER="/opt/ceph-scripts2/upmap/pgremapper"
    
    until ${PG_REMAPPER} cancel-backfill --verbose > /dev/null 2>&1
      do
        pg=$(${PG_REMAPPER} cancel-backfill --verbose 2>&1 >/dev/null | \
    grep panic | tr -d '\n' | awk '{print $3}' | sed 's|:||g')
        echo -e "Fix pgremapper panic for PG ${pg}"
        ceph osd rm-pg-upmap-items "${pg}"
        sleep 1s
      done
    
    if [[ ${CHECK} != "--yes" ]]
      then
        echo -e "\n'--yes' is not provided, running in report mode\n"
        MODE=""
      else
        MODE="${CHECK}"
    fi
    
    ${PG_REMAPPER} cancel-backfill --verbose "${MODE}"
  9. baergj commented on Oct 28, 2021

    @baergj
    Contributor

    This issue should be addressed by #17. Please let us know (probably with a new issue and dump) if you see future issues of this kind. Thanks!

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