Skip to content

feat: enhance SMDClient with group membership caching and reverse indexing#109

Merged
alexlovelltroy merged 2 commits into
mainfrom
bugfix/smd-group-membership
Jun 11, 2026
Merged

feat: enhance SMDClient with group membership caching and reverse indexing#109
alexlovelltroy merged 2 commits into
mainfrom
bugfix/smd-group-membership

Conversation

@alexlovelltroy

Copy link
Copy Markdown
Member

Description

This pull request enhances the SMDClient implementation by improving concurrency safety, adding efficient reverse lookup indexes for node identification, and supporting group membership information for nodes. It also updates the tests to match these changes. The main improvements are grouped below:

Concurrency and Data Structure Improvements

  • Changed nodesMutex from a sync.Mutex to a sync.RWMutex throughout the codebase to allow multiple concurrent readers, improving performance for read-heavy workloads. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Added reverse lookup maps (ipToXname, macToXname, wgipToXname) to SMDClient for O(1) lookups by IP, MAC, or WGIP, and updated all relevant methods to use these indexes for faster node identification. [1] [2] [3] [4]

Node and Group Membership Enhancements

  • Updated the NodeMapping struct to include a Groups field, and modified PopulateNodes to fetch and store group membership information for each node. The GroupMembership method now returns cached group data instead of querying the server each time. [1] [2] [3] [4]

Test Updates

  • Updated tests to initialize the new reverse lookup maps and use sync.RWMutex. Enhanced test HTTP handlers to simulate group membership endpoints, ensuring group membership and reverse lookup logic are tested. [1] [2] [3] [4] [5] [6] [7]

These changes collectively improve the efficiency, scalability, and feature set of the SMDClient.

Checklist

  • My code follows the style guidelines of this project
  • I have added/updated comments where needed
  • I have added tests that prove my fix is effective or my feature works
  • I have run make test (or equivalent) locally and all tests pass
  • DCO Sign-off: All commits are signed off (git commit -s) with my real name and email
  • REUSE Compliance:
    • Each new/modified source file has SPDX copyright and license headers
    • Any non-commentable files include a <filename>.license sidecar
    • All referenced licenses are present in the LICENSES/ directory

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

For more info, see Contributing Guidelines.

…exing

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>

@travisbcotton travisbcotton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Lgtm

…mance tests

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
@alexlovelltroy alexlovelltroy merged commit feae7de into main Jun 11, 2026
5 checks passed
@synackd synackd deleted the bugfix/smd-group-membership branch June 11, 2026 21:19
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