Skip to content

Conversation

@kezhuw
Copy link
Member

@kezhuw kezhuw commented Feb 11, 2022

Descriptions of the changes in this PR:

Motivation

Currently, in LedgerHandle.unsetSuccessAndSendWriteRequest,
LedgerHandle.sendAddSuccessCallbacks could be called by
PendingAddOp.unsetSuccessAndSendWriteRequest before all pending
adds evaluated. This will make entries which met ack requirement in old
ensemble but have not evaluated yet succeed in new ensemble.

Changes

Check succeeded entries after unsetting all pending entries in ensemble change unsetting.

Master Issue: #3005

Further thoughts

PendingAddOp.writeComplete calls LedgerHandle.sendAddSuccessCallbacks in completed branch.

Currently, LedgerHandle.sendAddSuccessCallbacks will not be called if failed bookies overlap with all pending write ensembles. So, the code in PendingAddOp.writeComplete sounds help.

But after changed, LedgerHandle.sendAddSuccessCallbacks will be called unconditionally after all pending adds complete unsetting. So I think the snippet in PendingAddOp.writeComplete does not help anymore. Can it be dropped ? I am not that confident. Post my thoughts here for evaluation.

@kezhuw
Copy link
Member Author

kezhuw commented Feb 11, 2022

@fpj @sijie @ivankelly Could you please take time to evaluate this ?

// completes.
//
// We call sendAddSuccessCallback after unsetting all pending adds to cover this case.
sendAddSuccessCallbacks();
Copy link
Member

@StevenLuMT StevenLuMT Jul 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for multiple pendingAddOps requests, just call sendAddSuccessCallbacks once time?
is it right? @kezhuw

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sendAddSuccessCallbacks has loop itself, it is unnecessary to call it multiple times after we unset all pending operations.

The keypoint this pr trying to solve is that eager sendAddSuccessCallbacks per pendingAddOp could make later pendingAddOps, which have not been unset, complete spuriously.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok,nice

Copy link
Member

@StevenLuMT StevenLuMT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@StevenLuMT
Copy link
Member

rerun failure checks or rebase the master new code,it fix some failed checks
@kezhuw

@kezhuw kezhuw force-pushed the fix-ack-broken-entry-succeed-in-ensemble-changing-unset branch from 8ae5036 to 5c1014a Compare July 30, 2022 03:02
@hangc0276 hangc0276 modified the milestones: 4.16.0, 4.17.0 Aug 1, 2022
@StevenLuMT
Copy link
Member

fix old workflow,please see #3455 for detail

Currently, in `LedgerHandle.unsetSuccessAndSendWriteRequest`,
`LedgerHandle.sendAddSuccessCallbacks` could be called by
`PendingAddOp.unsetSuccessAndSendWriteRequest` **before** all pending
adds evaluated. This will make entries which met ack requirement in old
ensemble but have not evaluated yet succeed in new ensemble.

Fixes apache#3005.
@kezhuw kezhuw force-pushed the fix-ack-broken-entry-succeed-in-ensemble-changing-unset branch from 5c1014a to fa22562 Compare August 24, 2022 11:20
@StevenLuMT
Copy link
Member

rerun failure checks

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants