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

feat(MOS): support OpenMedia's hot standby #1169

Merged
merged 9 commits into from
Dec 11, 2024

Conversation

olzzon
Copy link
Contributor

@olzzon olzzon commented Mar 21, 2024

About the Contributor

This PR is made on behalf of BBC

Type of Contribution

This is a Feature

Current Behavior

Currently the Primary and Secondary MOS connection are expected to be online at the same time.

New Behavior

OpenMedia treats the Secondary server as a Hot Standby, so it's not connected while Primary server is connected.
To handle this, a "Hot Spare" option is added in settings to the Secondary server.

When hot spare is activated, status messages are:

  • GOOD - When running on Primary, the status of Secondary is ignored.
  • GOOD - When running on Secondary the status of Primary is is ignored.
  • BAD - If neither Primary or Secondary is connected.

Testing Instructions

Connect MOS gateway to a 2 server OpenMedia setup.

Time Frame

We intend to finish the development on this feature in two weeks time.

Other Information

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

@jstarpl jstarpl changed the title Feat/mos openmedia hot standby feat(MOS): support OpenMedia's hot standby Mar 22, 2024
@jstarpl jstarpl added the Contribution from BBC Contributions sponsored by BBC (bbc.co.uk) label Jun 13, 2024
Copy link

codecov bot commented Aug 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.29%. Comparing base (11ddc3a) to head (685862b).
Report is 46 commits behind head on release52.

Additional details and impacted files
@@              Coverage Diff              @@
##           release52    #1169      +/-   ##
=============================================
- Coverage      61.31%   61.29%   -0.02%     
=============================================
  Files            468      468              
  Lines          82107    82107              
  Branches        4684     5352     +668     
=============================================
- Hits           50340    50327      -13     
+ Misses         31674    31636      -38     
- Partials          93      144      +51     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@Julusian Julusian left a comment

Choose a reason for hiding this comment

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

I'm not keen on the name 'hot standby', I find that confusing.
I would expect the 'hot standby' mode to be the one where there is a 'hot spare' connection maintained the whole time, not when the connection is 'cold' except when the primary is down.
I would prefer that the field was renamed to be more descriptive to how the connection will behave, and the description could include something like For OpenMedia Hot Standby to make it clear it should be used with this

packages/mos-gateway/src/mosHandler.ts Outdated Show resolved Hide resolved
@olzzon olzzon requested a review from Julusian September 24, 2024 11:40
@olzzon olzzon marked this pull request as ready for review October 8, 2024 10:50
@olzzon olzzon requested a review from a team as a code owner October 8, 2024 10:50
Copy link
Member

@jstarpl jstarpl left a comment

Choose a reason for hiding this comment

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

I think it would be nice if we grouped these out-of-spec behavior flags into some sort of an options object.

packages/mos-gateway/src/CoreMosDeviceHandler.ts Outdated Show resolved Hide resolved
packages/mos-gateway/src/coreHandler.ts Outdated Show resolved Hide resolved
@@ -482,6 +488,11 @@ export class MosHandler {
deviceOptions.primary.heartbeatInterval =
deviceOptions.primary.heartbeatInterval || DEFAULT_MOS_HEARTBEAT_INTERVAL

if (deviceOptions.secondary?.id && this._openMediaHotStandby[deviceOptions.secondary.id]) {
//@ts-expect-error this is not yet added to the official mos-connection
deviceOptions.secondary.openMediaHotStandby = true
Copy link
Member

Choose a reason for hiding this comment

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

Does this mean that this PR is not mergable yet? Because there needs to be an update to mos-connection before?

Copy link
Member

@Julusian Julusian Dec 10, 2024

Choose a reason for hiding this comment

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

Yes, it appears so.
The PR nrkno/sofie-mos-connection#105 has been merged in that repository, but v4.2.0 has only been half created, so cannot be referenced here yet.
It sounds like there are some more changes waiting in mos-connection

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

That was the PR, but there are some additional fixes without a PR yet

@jstarpl jstarpl changed the base branch from release51 to release52 October 23, 2024 15:39
@jstarpl jstarpl merged commit b69478f into nrkno:release52 Dec 11, 2024
45 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribution from BBC Contributions sponsored by BBC (bbc.co.uk) Contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants