Skip to content

pgremapper: Consider upmaps when reordering up sets.#7

Merged
baergj merged 2 commits into
mainfrom
improve-replica-sorting
Jun 17, 2021
Merged

pgremapper: Consider upmaps when reordering up sets.#7
baergj merged 2 commits into
mainfrom
improve-replica-sorting

Conversation

@baergj
Copy link
Copy Markdown
Contributor

@baergj baergj commented Jun 17, 2021

Consider the following upmap entry:

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

And the following PG state:

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

Prior to this change, pgremapper would attempt to remap 66->19, which would conflict with the existing mapping 19->11. After this change, pgremapper is wise enough to use the upmap item to realize that 19 and 11 are paired and re-order the up set accordingly for proper processing.

baergj added 2 commits June 17, 2021 13:22
Consider the following upmap entry:
```
        {
            "pgid": "1.38f",
            "mappings": [
                {
                    "from": 51,
                    "to": 3
                },
                {
                    "from": 19,
                    "to": 11
                }
            ]
        },
```

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

Prior to this change, pgremapper would attempt to remap 66->19, which
would conflict with the existing mapping 19->11. After this change,
pgremapper is wise enough to use the upmap item to realize that 19 and
11 are paired and re-order the up set accordingly for proper processing.
@baergj
Copy link
Copy Markdown
Contributor Author

baergj commented Jun 17, 2021

This addresses #5.

@baergj baergj merged commit e545f91 into main Jun 17, 2021
@baergj baergj deleted the improve-replica-sorting branch June 17, 2021 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants