Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PBM-1311: PBM fails to do PITR slicing when RS doesn't have a majority #940

Merged
merged 6 commits into from
May 8, 2024

Conversation

boris-ilijic
Copy link
Member

@boris-ilijic boris-ilijic commented May 7, 2024

Fix for https://perconadev.atlassian.net/browse/PBM-1311

When doing PITR slicing PBM relies on majorityOpTime to define slicing intervals:

db.isMaster()
{
  ...
  lastWrite: {
    opTime: { ts: Timestamp({ t: 1715079500, i: 1 }), t: Long('1') },
    lastWriteDate: ISODate('2024-05-07T10:58:20.000Z'),
    majorityOpTime: { ts: Timestamp({ t: 1715079500, i: 1 }), t: Long('1') },
    majorityWriteDate: ISODate('2024-05-07T10:58:20.000Z')
  },
 ...

When cluster doesn't have majority majorityOpTime is stale, so it contains last value when majority was present.

This PR fixes that using approach: when write concern is below majority, PBM uses opTime instead of majorityOpTime to define PITR slicing intervals.

... to determine if majority is requested in current setup
... for the case when cluster doesn't have majority
@boris-ilijic boris-ilijic marked this pull request as ready for review May 7, 2024 14:57
@boris-ilijic boris-ilijic requested a review from defbin as a code owner May 7, 2024 14:57
Co-authored-by: Dmytro Zghoba <[email protected]>
@boris-ilijic boris-ilijic merged commit 744857d into dev May 8, 2024
23 of 27 checks passed
@boris-ilijic boris-ilijic deleted the PBM-1311-pitr-slicing-without-majority-fix branch May 8, 2024 13:46
@defbin defbin modified the milestones: 2.6.0, 2.5.0 Aug 9, 2024
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