-
Notifications
You must be signed in to change notification settings - Fork 111
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
Prevent extra unnecessary reconfig events #3671
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch! Looks good to me but will let @SidSethi give the ✅ as well because i'm not as familiar with this flow as he is
...r-node/src/services/stateMachineManager/stateReconciliation/updateReplicaSet.jobProcessor.ts
Outdated
Show resolved
Hide resolved
...r-node/src/services/stateMachineManager/stateReconciliation/updateReplicaSet.jobProcessor.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huge find 💪
few small things, otherwise looks great
const oldSecondary1SpId = | ||
ContentNodeInfoManager.getCNodeEndpointToSpIdMap()[secondary1] | ||
const oldSecondary2SpId = | ||
ContentNodeInfoManager.getCNodeEndpointToSpIdMap()[secondary2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
const {
primary: oldPrimarySpId,
secondary1: oldSecondary1SpId,
secondary2: oldSecondary2SpId
} = ContentNodeInfoManager.getCNodeEndpointToSpIdMap()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we can do this? getCNodeEndpointToSpIdMap returns an object with keys as the endpoints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah my b, i meant this
const {
[primary]: oldPrimarySpId,
[secondary1]: oldSecondary1SpId,
[secondary2]: oldSecondary2SpId
} = ContentNodeInfoManager.getCNodeEndpointToSpIdMap()
also like, this is a nit haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh wow lol I didnt know this was possible! ok ill update it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah its dope
) | ||
|
||
response.issuedReconfig = true | ||
logger.info( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit can we make this logger.warn or .error for easier loggly filtering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm I feel like this shouldn't be a warn or error log though? like if this update reconfig happens successfully, then all is well? we should be filtering by the log instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops i meant to put this comment on line 527
logger.info(
`[_issueUpdateReplicaSetOp] skipping _updateReplicaSet as reconfig already occurred for userId=${userId} wallet=${wallet}`
)
...r-node/src/services/stateMachineManager/stateReconciliation/updateReplicaSet.jobProcessor.ts
Outdated
Show resolved
Hide resolved
...r-node/src/services/stateMachineManager/stateReconciliation/updateReplicaSet.jobProcessor.ts
Show resolved
Hide resolved
...r-node/src/services/stateMachineManager/stateReconciliation/updateReplicaSet.jobProcessor.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk if blocked on my re-approval but this is good to go, all my comments are your call, can merge either way
## Changelog - 2022-08-12 [c38a6a8] Update @solana/spl-token to 0.1.8 (#3689) [Marcus Pasell] - 2022-08-12 [587b38e] CON-327 Miscellaneous secondarySyncFromPrimary() improvements to logic + metric tracking (#3678) [Sid Sethi] - 2022-08-12 [1afa5d5] [CON-324] Add orphaned data recovery queue (#3680) [Theo Ilie] - 2022-08-12 [10599f4] Handle zero error code (#3686) [Saliou Diallo] - 2022-08-12 [2346960] Use abuse error codes in relay (#3683) [Raymond Jacobson] - 2022-08-12 [c3f578e] populate save_count in feed endpoint (#3684) [Steve Perkins] - 2022-08-11 [5e6217f] Revert "[PLAT-259] Upgrade EthereumTx version (#3606)" (#3682) [Raymond Jacobson] - 2022-08-11 [a44aad2] Fix bad notifs (#3681) [Saliou Diallo] - 2022-08-11 [23a6c3b] [PAY-485][PAY-491] Handle premium content signature (#3610) [Saliou Diallo] - 2022-08-11 [a478a1d] [PAY-459] Add dethroned notifications on Identity (#3674) [Michael Piazza] - 2022-08-11 [8fb6084] Add a log before force resync happen (#3677) [vicky :)] - 2022-08-11 [47f55f4] [PAY-506] Exposes AAO error code (#3662) [Reed] - 2022-08-11 [4bc58cf] Filter out notifications from bad initiators (#3676) [Saliou Diallo] - 2022-08-11 [e01c91c] Prevent extra unnecessary reconfig events (#3671) [vicky :)] - 2022-08-11 [cff11a9] Fix downgrades (#3667) [Joseph Lee] - 2022-08-11 [424ff50] Add disable flag to logspout (#3672) [Dheeraj Manjunath] - 2022-08-11 [bac7669] Bump sdk to v0.0.33 [audius-infra]
## Changelog - 2022-08-12 [c38a6a8] Update @solana/spl-token to 0.1.8 (#3689) [Marcus Pasell] - 2022-08-12 [587b38e] CON-327 Miscellaneous secondarySyncFromPrimary() improvements to logic + metric tracking (#3678) [Sid Sethi] - 2022-08-12 [1afa5d5] [CON-324] Add orphaned data recovery queue (#3680) [Theo Ilie] - 2022-08-12 [10599f4] Handle zero error code (#3686) [Saliou Diallo] - 2022-08-12 [2346960] Use abuse error codes in relay (#3683) [Raymond Jacobson] - 2022-08-12 [c3f578e] populate save_count in feed endpoint (#3684) [Steve Perkins] - 2022-08-11 [5e6217f] Revert "[PLAT-259] Upgrade EthereumTx version (#3606)" (#3682) [Raymond Jacobson] - 2022-08-11 [a44aad2] Fix bad notifs (#3681) [Saliou Diallo] - 2022-08-11 [23a6c3b] [PAY-485][PAY-491] Handle premium content signature (#3610) [Saliou Diallo] - 2022-08-11 [a478a1d] [PAY-459] Add dethroned notifications on Identity (#3674) [Michael Piazza] - 2022-08-11 [8fb6084] Add a log before force resync happen (#3677) [vicky :)] - 2022-08-11 [47f55f4] [PAY-506] Exposes AAO error code (#3662) [Reed] - 2022-08-11 [4bc58cf] Filter out notifications from bad initiators (#3676) [Saliou Diallo] - 2022-08-11 [e01c91c] Prevent extra unnecessary reconfig events (#3671) [vicky :)] - 2022-08-11 [cff11a9] Fix downgrades (#3667) [Joseph Lee] - 2022-08-11 [424ff50] Add disable flag to logspout (#3672) [Dheeraj Manjunath] - 2022-08-11 [bac7669] Bump sdk to v0.0.33 [audius-infra]
* prevent extra unnecessary reconfig events * update err msg to not double print logs * update err log * lower health check cache ttl * add a shouldReconfig check * fix test * rename to canReconfig * use Logger instead of any * update fetch spIDs
[4a26077] [C-2678] Add Stems and Source Files Modal (#3671) Andrew Mendelsohn [6a3342a] Bump android version to 1.1.391 to fix play-store build (#3678) Dylan Jeffers [2064212] [C-2813] Catch collectibles runtime errors (#3675) Dylan Jeffers [29233ea] [C-2808] Improve storageNodeSelector usage and perf (#3674) Dylan Jeffers [2de2035] Fix mobile image uri (#3670) Dylan Jeffers [55a6089] [C-2807] Add ModalField subforms with cancellation (#3664) Andrew Mendelsohn [e26986f] [C-2812] Use storageNodeSelector in libs, fix mobile images (#3667) Dylan Jeffers [5daea08] Enable playlist updates on prod (#3668) Dylan Jeffers [d90c369] [PAY-1541] Autofocus textinput on mobile search users screen (#3666) Reed [194f894] [PAY-1542][PAY-1539][PAY-1537] Mobile chats QA improvements (#3665) Reed [58b9028] [C-2798] Fix playlist button overlap (#3662) Dylan Jeffers [a935588] [PAY-1538] Fix autocorrect behavior (#3661) Michael Piazza [1a8a6e7] [PAY-1518] DMs: Align the overflow menu bottom center (#3654) Marcus Pasell [c880b2a] [plat-1085] disable fav and repost on hidden tracks in play bar (#3653) sabrina-kiam [d80617e] [PAY-1529] Add initial types for usdc purchases (#3651) Randy Schott [68e87ff] [C-2787] Reregister device-token on app startup (#3660) Dylan Jeffers [ddfa510] [C-2802] Move embed to client monorepo! (#3659) Raymond Jacobson [6a2f008] Add Sentry error logging to Audius query C-2800 (#3656) nicoback2 [79213de] Add Amplitude events to new Write OAuth flows C-2801 (#3657) nicoback2 [6576ae4] Fix android chat message cut off at top (#3658) Reed [160b325] [C-2677] Remix Settings Modal layout complete (#3647) Andrew Mendelsohn [c01c022] [C-2790] Add private DogEar to desktop playlist cards (#3655) Dylan Jeffers [50e8f4e] [PAY-1522][PAY-1451] Fix issues with DMs notification dot (#3649) Michael Piazza [1658810] [PAY-1530] adds usdc feature flag and hooks for fetching it (#3645) Randy Schott
Description
There were unnecessary reconfig events being made. To prevent this from happening, we have to pass in the old replica set and call the fn that requires passing in the old replica set.
Tests
Monitoring - How will this change be monitored? Are there sufficient logs / alerts?
See logs surrounding
_issueUpdateReplicaSetOp
.Followups