Skip to content

tests: allow multiple MDSs in tests#751

Merged
lgsilva3087 merged 2 commits intodevfrom
tests-allow-multiple-mds
Feb 18, 2026
Merged

tests: allow multiple MDSs in tests#751
lgsilva3087 merged 2 commits intodevfrom
tests-allow-multiple-mds

Conversation

@lgsilva3087
Copy link
Contributor

@lgsilva3087 lgsilva3087 commented Feb 17, 2026

Extends the testing framework to support multiple active MDS instances in automated tests.
The change is intended for KV backends.

Related to: LS-340

@lgsilva3087 lgsilva3087 requested a review from Copilot February 17, 2026 12:10
@lgsilva3087 lgsilva3087 self-assigned this Feb 17, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @lgsilva3087, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the testing framework's ability to simulate and test environments with multiple active Metadata Server (MDS) instances, particularly for Key-Value (KV) backends. By refactoring configuration generation and introducing specific logic for multi-MDS setups, the changes streamline the process of setting up complex test scenarios, ensuring more robust testing of distributed file system metadata operations.

Highlights

  • Configuration Refactoring: The create_sfsmaster_master_cfg_ function was refactored into a new common function create_mds_common_cfg to encapsulate shared configuration logic for metadata servers.
  • Multi-MDS Configuration Support: A new function create_sfsmds_cfg_ was introduced to specifically handle configuration for multiple Metadata Server (MDS) instances, particularly for Key-Value (KV) backends like FDB.
  • Dynamic Port Assignment: The configuration now dynamically assigns ports for multiple MDS instances, with MDS 0 using global ports and other MDS instances using their own local ports for various communication channels.
  • Port Assignment Correction: A minor bug was fixed where the matots port was incorrectly assigned the matocs port value in the add_metadata_server_ function.
Changelog
  • tests/tools/saunafs.sh
    • Renamed create_sfsmaster_master_cfg_ to create_mds_common_cfg and extracted common configuration settings.
    • Added create_sfsmds_cfg_ to generate configuration for multiple MDS instances, including conditional port assignments.
    • Modified create_sfsmaster_master_cfg_ to call create_mds_common_cfg and include specific master configuration.
    • Updated add_metadata_server_ to use create_sfsmds_cfg_ when configuring FDB metadata servers.
    • Corrected the assignment of master${masterserver_id}_matots to use masterserver_matots_port.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request extends the testing framework to support multiple active MDS instances for KV backends. The changes involve refactoring the shell script for test setup to generate different configurations for multiple MDSs. The logic seems correct and aligns with the goal, and includes a good bug fix. I've found one area where the code can be improved for better maintainability by reducing duplication.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request extends the testing framework to support multiple active MDS (Metadata Server) instances for KV backends like FoundationDB. The changes refactor configuration generation to enable multiple MDS instances to coexist with different port assignments while sharing common configuration.

Changes:

  • Refactored configuration generation by extracting common MDS configuration into a reusable function
  • Added support for multiple MDS instances with FDB backend, where MDS 0 uses global ports and additional MDSs use their own local ports
  • Fixed a bug where the wrong port variable was being stored for the matots port

@lgsilva3087 lgsilva3087 force-pushed the tests-allow-multiple-mds branch from dddaa1b to 2ba4823 Compare February 17, 2026 12:50
@lgsilva3087 lgsilva3087 force-pushed the tests-allow-multiple-mds branch from 2ba4823 to 027fb20 Compare February 17, 2026 12:55
@lgsilva3087 lgsilva3087 marked this pull request as ready for review February 17, 2026 15:43
@lgsilva3087 lgsilva3087 force-pushed the tests-allow-multiple-mds branch from 027fb20 to 49ebc65 Compare February 17, 2026 18:31
The matocs port was used twice (for matocs and for matots) in the
function used to generate the master and shadows config files for
testing. Even if the TS module is deprecated, it should point to the
correct port.

Signed-off-by: guillex <guillex@leil.io>
Refactor metadata server configuration to support multiple MDS
instances in test environment:

- Extract common MDS configuration into create_mds_common_cfg()
  function to reduce code duplication
- Add create_sfsmds_cfg_() function for FDB-based MDS setup
- Support differentiated port allocation: MDS 0 uses global
  ports (like Master), additional MDSs use their own local ports
  (similar to Shadow servers)
- Update add_metadata_server_() to use new MDS configuration
  when FDB backend is enabled
- Standardize variable references using ${var} syntax in the modified
  sections

Signed-off-by: guillex <guillex@leil.io>
@lgsilva3087 lgsilva3087 force-pushed the tests-allow-multiple-mds branch from 49ebc65 to 0294021 Compare February 18, 2026 08:28
Copy link
Collaborator

@rolysr rolysr left a comment

Choose a reason for hiding this comment

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

LGTM.

@lgsilva3087 lgsilva3087 merged commit 557b4cc into dev Feb 18, 2026
11 of 13 checks passed
@lgsilva3087 lgsilva3087 deleted the tests-allow-multiple-mds branch February 18, 2026 15:26
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.

4 participants