Uh oh!
There was an error while loading. Please reload this page.
CON-328 Add manual mergePrimaryAndSecondary route for testing - #3685
Conversation
| // Error if this node is not primary for user | ||
| if (userReplicaSet[0] !== selfEndpoint) { | ||
| throw new Error(`Failure - this node is not primary for user`) | ||
| } |
There was a problem hiding this comment.
😬 this should have been locked down earlier
There was a problem hiding this comment.
check out my comment below and lmk what you think. we should fetch this data from chain vs discovery
SidSethi
commented
Aug 15, 2022
@theoilie tagged since this impacts your orphaned data recovery work (see PR desc) |
dmanjunath
left a comment
There was a problem hiding this comment.
thanks for putting out this fix, had a few comments about the primarySyncFromSecondary flow
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| // Error if this node is not primary for user | ||
| if (userReplicaSet[0] !== selfEndpoint) { | ||
| throw new Error(`Failure - this node is not primary for user`) | ||
| } |
There was a problem hiding this comment.
check out my comment below and lmk what you think. we should fetch this data from chain vs discovery
dmanjunath
left a comment
There was a problem hiding this comment.
fixing the chain pull in a fast follow. approving this for now
theoilie
left a comment
There was a problem hiding this comment.
LGTM! I'll play around with this route for orphaned data recovery later today
Uh oh!
There was an error while loading. Please reload this page.
## Changelog - 2022-08-16 [87ed35a] [PLAT-289] Add endpoint for playlist tracks (#3697) [Raymond Jacobson] - 2022-08-16 [18e908a] Log stack traces of update-replica-set errors (#3702) [Theo Ilie] - 2022-08-16 [1536f99] Add playlist metadata timestamp type (#3701) [Isaac Solo] - 2022-08-16 [c581870] Remove playlist is occupied API (#3700) [Isaac Solo] - 2022-08-16 [1f7241d] New optimizely flag for push notifs (#3699) [Michael Piazza] - 2022-08-16 [56a12d1] Add entity manager contract ABI (#3698) [Isaac Solo] - 2022-08-16 [07cf9af] [C-785] Add request sorters to hist/fav/tracks (#3665) [Raymond Jacobson] - 2022-08-15 [e3d752f] Add entity manager for playlist actions (#3400) [Hareesh Nagaraj] - 2022-08-15 [14ec490] CON-328 Add manual mergePrimaryAndSecondary route for testing (#3685) [Sid Sethi] - 2022-08-15 [4b8d48d] Allow previously abusive users to redeem themselves for next relays (#3687) [Saliou Diallo] - 2022-08-12 [97dd5d3] Add to push notifs list (#3690) [Michael Piazza] - 2022-08-12 [1a38384] Add custom headers to all axios calls to health check in content node (#3688) [Dheeraj Manjunath] - 2022-08-12 [82dcf35] Bump sdk to v0.0.34 [audius-infra]
## Changelog - 2022-08-16 [87ed35a] [PLAT-289] Add endpoint for playlist tracks (#3697) [Raymond Jacobson] - 2022-08-16 [18e908a] Log stack traces of update-replica-set errors (#3702) [Theo Ilie] - 2022-08-16 [1536f99] Add playlist metadata timestamp type (#3701) [Isaac Solo] - 2022-08-16 [c581870] Remove playlist is occupied API (#3700) [Isaac Solo] - 2022-08-16 [1f7241d] New optimizely flag for push notifs (#3699) [Michael Piazza] - 2022-08-16 [56a12d1] Add entity manager contract ABI (#3698) [Isaac Solo] - 2022-08-16 [07cf9af] [C-785] Add request sorters to hist/fav/tracks (#3665) [Raymond Jacobson] - 2022-08-15 [e3d752f] Add entity manager for playlist actions (#3400) [Hareesh Nagaraj] - 2022-08-15 [14ec490] CON-328 Add manual mergePrimaryAndSecondary route for testing (#3685) [Sid Sethi] - 2022-08-15 [4b8d48d] Allow previously abusive users to redeem themselves for next relays (#3687) [Saliou Diallo] - 2022-08-12 [97dd5d3] Add to push notifs list (#3690) [Michael Piazza] - 2022-08-12 [1a38384] Add custom headers to all axios calls to health check in content node (#3688) [Dheeraj Manjunath] - 2022-08-12 [82dcf35] Bump sdk to v0.0.34 [audius-infra]
Description
POST /merge_primary_and_secondary?wallet=<user_wallet>&endpoint=<secondary_endpoint>to be able to manually issue a sync of modeMERGE_PRIMARY_AND_SECONDARYfrom_manual_routeparam to secondary sync overridemergePrimaryAndSecondaryEnabledflagprimarySyncFromSecondaryflow to only work on user's primaryNote:
primarySyncFromSecondary()currently works if called withendpointthat is not a user secondary. We should maybe lock this down a bit but it'll also be required for Orphaned Data RecoveryNits: add
npm run buildstep and addbuild/dir to.gitignoreTests
Existing test coverage
Manual tests for
POST /merge_primary_and_secondary:walletorendpointnot passed inprimarySyncFromSecondary()fails if called on node that is not primary forwalletprimarySyncFromSecondary()succeeds if called withendpointthat is not secondary for userprimarySyncFromSecondary()succeeds in happy pathMonitoring - How will this change be monitored? Are there sufficient logs / alerts?
Check for calls to
/merge_primary_and_secondary, check metrics foraudius_cn_issue_sync_request_duration_secondswithsync_mode="merge_primary_and_secondary"