fix(ctl): entry info fields silently falling back to default values#319
Open
iamjoemccormick wants to merge 1 commit intomainfrom
Open
fix(ctl): entry info fields silently falling back to default values#319iamjoemccormick wants to merge 1 commit intomainfrom
iamjoemccormick wants to merge 1 commit intomainfrom
Conversation
The new errors surfaced when using the `GetEntryInfoV2` ioctl and subsequent changes in #317 prompted the realization that `beegfs entry info` only worked before because `newEntry()` was never checking if `entryInfo msg.GetEntryInfoResponse` actually contained valid data (based on `entryInfo.Result`). At best this returned misleading output in CTL, at worst there are other places that make assumptions based on the validity of that data. Before when GetEntryInfoResponse failed (e.g., OpsErr_INODELOCKED during chunk rebalancing), fields derived from that response previously defaulted to Go zero values, causing consumers like 'beegfs entry info' to silently display misleading data (e.g., Chunksize: 0, Reading: 0, Writing: 0). This change extracts Pattern, Remote, NumSessionsRead, NumSessionsWrite, and FileState into a new EntryDetails struct. Entry.Details is a pointer that is nil when EntryInfoPopulated != SUCCESS, so: - Display functions gate all response-derived output behind a single nil check, showing (unavailable) instead of zero values. - Backend consumers (set, migrate, create, RST) get explicit nil guards that surface errors instead of silently operating on empty data. - Future fields added to EntryDetails are automatically handled by the display layer without requiring frontend changes. Also introduces ErrEntryDetailsUnavailable in the migrate/chooser path, replacing the previous behavior where a locked inode silently produced zero-value fields that triggered ErrEntryHasNoTargets. Assisted-by: Claude:claude-opus-4-6
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do / why do we need it?
Required for all PRs.
The new errors surfaced when using the
GetEntryInfoV2ioctl and subsequent changes in #317 prompted the realization thatbeegfs entry infoonly worked before becausenewEntry()was never checking ifentryInfo msg.GetEntryInfoResponseactually contained valid data (based onentryInfo.Result). At best this returned misleading output in CTL, at worst there are other places that make assumptions based on the validity of that data.Before when GetEntryInfoResponse failed (e.g., OpsErr_INODELOCKED during chunk rebalancing), fields
derived from that response previously defaulted to Go zero values, causing consumers like 'beegfs
entry info' to silently display misleading data (e.g., Chunksize: 0, Reading: 0, Writing: 0).
This change extracts Pattern, Remote, NumSessionsRead, NumSessionsWrite, and FileState into a new
EntryDetails struct. Entry.Details is a pointer that is nil when EntryInfoPopulated != SUCCESS, so:
(unavailable) instead of zero values.
of silently operating on empty data.
requiring frontend changes.
Also introduces ErrEntryDetailsUnavailable in the migrate/chooser path, replacing the previous
behavior where a locked inode silently produced zero-value fields that triggered
ErrEntryHasNoTargets.
Assisted-by: Claude:claude-opus-4-6
Related Issue(s)
Required when applicable.
Where should the reviewer(s) start reviewing this?
Only required for larger PRs when this may not be immediately obvious.
Are there any specific topics we should discuss before merging?
Not required.
What are the next steps after this PR?
Not required.
Checklist before merging:
Required for all PRs.
When creating a PR these are items to keep in mind that cannot be checked by GitHub actions:
For more details refer to the Go coding standards and the pull request process.