Skip to content

Fix failing v7 import#58

Open
rustybee42 wants to merge 2 commits intomainfrom
rb/fix-v7-import
Open

Fix failing v7 import#58
rustybee42 wants to merge 2 commits intomainfrom
rb/fix-v7-import

Conversation

@rustybee42
Copy link
Collaborator

@rustybee42 rustybee42 commented Mar 11, 2026

Fixes v7 import, which broke on 8.3 due to a double insert into the root_inode table.

@rustybee42 rustybee42 self-assigned this Mar 11, 2026
@rustybee42 rustybee42 requested a review from a team as a code owner March 11, 2026 10:15
Copy link
Member

@iamjoemccormick iamjoemccormick left a comment

Choose a reason for hiding this comment

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

Presuming one doesn't already exist, should we also add an integration test that exercises the full end-to-end v7 import? A fixture (v7 mgmtd data) that includes all importable data types (nodes, targets, buddy groups, pools, etc.) would complement the existing unit tests without needing to fully re-verify the imported values, just that the import succeeds without constraint errors and maybe sanity check node, target, quota, etc. counts match up.

Copy link
Member

Choose a reason for hiding this comment

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

todo: The target.rs:set_get_meta test should assert the root_inode contents after all targets are inserted, to ensure the first target is used as the root and not overwritten by subsequent insertions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a bit unrelated to this PR. I could add it nonetheless, but I don't really see the point as it's currently working and there is no change.

And the plan is to get rid of this db abstraction anyway long term and put tests on the handlers and other stuff instead.

Copy link
Member

Choose a reason for hiding this comment

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

I agree its technically unrelated to this PR, but since this isn't the first issue we've had related to setting the root inode, I was just generally looking at ways to improve our test coverage in this area.

@rustybee42 rustybee42 force-pushed the rb/fix-v7-import branch 2 times, most recently from 2f0b281 to 03bdcd2 Compare March 12, 2026 10:23
Copy link
Member

@iamjoemccormick iamjoemccormick left a comment

Choose a reason for hiding this comment

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

LGTM - though I would still recommend we find a way to increase our test coverage around v7 imports.

This let the import fail. We now call target::insert directly for meta
nodes which does not insert into root_inode.

Also remove target::insert_meta
Uses a v7 management data folder created with 7.4
#[test]
fn import_v7() {
// Setup
let tmp_dir = std::env::temp_dir().join(".beegfs_import_v7_test");
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: unless temp_dir does it automatically (it doesn't look like it does), I'd suggest adding some unique/random identifier to the test directory name. For example in case there are two test binary instances running concurrently on the same machine. This also ensures each test is always isolated and won't be affected by stale/leftover state from a previous test, for example if somehow the test was killed before remove_dir_all() executed.

This is a nitpick because it is unlikely in our current test environment, but more just a general testing best practice.

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