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

Ensure that unavailable_nodes list is a subset of discovered_nodes #35

Merged
merged 3 commits into from
Oct 23, 2023

Conversation

arcusfelis
Copy link
Contributor

@arcusfelis arcusfelis commented Oct 5, 2023

Addresses "MIM-2054 CETS status: removed nodes from disco should not be listed in a list of unavailable nodes"

Changes:

  • Ensure that unavailable_nodes list is a subset of discovered_nodes
  • Add status_discovered_nodes testcase (a test for this field was missing)
  • Use ordsets in types for nodes (because they are ordsets)
  • Define DiscoOpts in tests instead of constructing the same map twice (small refactoring)

Nodes could be removed from the discovery_nodes table after some time.
After that point, the removed node should not appear in the systemInfo API.
But we currently we can have:

./_build/mim1/rel/mongooseim/bin/mongooseimctl cets systemInfo
{
  "data" : {
    "cets" : {
      "systemInfo" : {
        "unavailableNodes" : [
          "badnode@localhost"
        ],
        "discoveredNodes" : [
          "mongooseim2@localhost",
          "mongooseim3@localhost",
          "mongooseim@localhost"
        ],
        "availableNodes" : [
          "mongooseim@localhost",
          "mongooseim2@localhost",
          "mongooseim3@localhost"
        ]
        ....

We need to ensure that unavailableNodes is a subset of discoveredNodes before returning it to the user.

@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (def7da2) 97.38% compared to head (8fcd64b) 97.46%.
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #35      +/-   ##
==========================================
+ Coverage   97.38%   97.46%   +0.07%     
==========================================
  Files           9        9              
  Lines         612      630      +18     
==========================================
+ Hits          596      614      +18     
  Misses         16       16              
Files Coverage Δ
src/cets_discovery.erl 93.66% <100.00%> (+0.09%) ⬆️

... and 2 files with indirect coverage changes

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

@arcusfelis arcusfelis marked this pull request as ready for review October 5, 2023 21:31
Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

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

Looks good - I only added minor style-related comments.

test/cets_SUITE.erl Outdated Show resolved Hide resolved
test/cets_SUITE.erl Outdated Show resolved Hide resolved
@arcusfelis
Copy link
Contributor Author

added meck

Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

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

👌

@chrzaszcz chrzaszcz merged commit f131ac9 into main Oct 23, 2023
8 checks passed
@chrzaszcz chrzaszcz deleted the prune-unavailable-nodes-list branch October 23, 2023 05:34
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