Skip to content

FDB-735 reading overlay subtoc, do not check the current directory - #338

Open
danovaro wants to merge 3 commits into
developfrom
fix/FDB-735-wipe-overlay
Open

FDB-735 reading overlay subtoc, do not check the current directory #338
danovaro wants to merge 3 commits into
developfrom
fix/FDB-735-wipe-overlay

Conversation

@danovaro

@danovaro danovaro commented Aug 21, 2026

Copy link
Copy Markdown
Member

Description

reading a subtoc of a moved DB, if the subtoc file is stored with an absolute path, it might appear as not existing.
in that scenario, we look for it in the current directory

in case of FDB overlays, we use the subtoc mechanism to record the referred FDB database
In this case, we should not look into the current directory (infinite loop)

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

🌈🌦️📖🚧 Documentation FDB 🚧📖🌦️🌈
https://sites.ecmwf.int/docs/fdb/pull-requests/PR-338

@danovaro
danovaro requested review from caraghbiner and a balanced review from Copilot August 21, 2026 07:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Prevents moved overlay databases from recursively resolving missing overlay TOCs to their own directory.

Changes:

  • Excludes overlay toc files from moved-subtoc fallback.
  • Catches test exceptions by reference.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/fdb5/toc/TocHandler.cc Adjusts missing subtoc path resolution.
tests/fdb/api/test_auxiliary.cc Avoids copying caught exceptions.
Suppressed comments (1)

src/fdb5/toc/TocHandler.cc:692

  • Returning an empty path makes both preloadSubTocs() and readNext() silently skip a mounted overlay whose original TOC is unavailable. The requirement is only to avoid resolving an overlay to the current database's toc; preserve the missing absolute path instead so the normal open path reports the broken mount rather than returning incomplete results.
            else {
                absPath = "";

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +686 to +688
// the DB may have been moved, so try to find the subtoc in the current directory
// except in case of an overlay (subtoc name = "toc")
if (path.baseName() != "toc") {
@codecov-commenter

codecov-commenter commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 77.57%. Comparing base (ea5c9d3) to head (ec5e941).

Files with missing lines Patch % Lines
src/fdb5/toc/TocHandler.cc 83.33% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #338      +/-   ##
===========================================
+ Coverage    77.51%   77.57%   +0.06%     
===========================================
  Files          411      411              
  Lines        27553    27565      +12     
  Branches      2769     2769              
===========================================
+ Hits         21358    21384      +26     
+ Misses        6195     6181      -14     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@danovaro
danovaro force-pushed the fix/FDB-735-wipe-overlay branch 2 times, most recently from 2166744 to 1c49d3a Compare August 25, 2026 14:35
@danovaro
danovaro requested a review from simondsmart August 26, 2026 08:55
@danovaro
danovaro force-pushed the fix/FDB-735-wipe-overlay branch from aba062f to ec5e941 Compare August 31, 2026 15:42
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.

3 participants