← Back to Pull requests

fix(alluxio): avoid index out of range in MasterPodName #6284

Open
unknown opened this pull request with 278 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 21, 2026 14:01 UTC
Author

Ⅰ. Describe what this PR does

AlluxioFileUtils.MasterPodName() parses the output of alluxio fsadmin report. It reads str[1] after checking len(str) < 1, and data[2] after checking len(data) < 2:

str := strings.Split(stdout, "\n")
if len(str) < 1 { ... return error }

data := strings.Fields(str[1])
if len(data) < 2 { ... return error }
address := strings.Split(data[2], ":")[0]

strings.Split never returns an empty slice, so the first check never fires, and the second one lets a line with exactly two fields through. When the command succeeds but its output does not have the master address on the second line (empty output, a single line, or Master Address: without a value), the function panics with index out of range instead of returning the error it was written to return. MasterPodName() is called from generateDataBackupValueFile in pkg/ddc/alluxio/backup_data.go.

This PR checks for the lengths that are actually indexed (< 2 and < 3). Output in the expected format is handled as before.

Ⅱ. Does this pull request fix one issue?

NONE. I found this by reading the code, not on a running cluster. I searched issues and PRs for MasterPodName, fsadmin report and index out of range and found nothing for it. #5984 adds a comment above the same test function; this PR only appends cases at the end of the function body.

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

Four unexpected-output cases added to TestAlluxioFileUtils_MasterPodName (empty output, summary line only, empty second line, Master Address: without a value). Each must return an error.

Ⅳ. Describe how to verify it

go test -gcflags=all=-l ./pkg/ddc/alluxio/operations/ -run TestAlluxioFileUtils_MasterPodName

On master the new cases fail with panic: runtime error: index out of range [1] with length 1 at base.go:487. With the fix the whole pkg/ddc/alluxio/operations package passes locally. I did not run the linter or e2e locally.

Ⅴ. Special notes for reviews

Disclosure: I used an AI assistant to help find and write this change. I have read and tested it myself and will answer review comments.

Diff: 278 lines (+208 / -70) across 3 files Reviewer: cheyang Review duration: 1784m
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.40) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 278 lines diff across 3 files
0.40
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.337
Real PR Conversation Timeline
1 comments
"Review active on #6284"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 39.6% (MEDIUM) · Higher = larger blast radius
39.6%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 21.1% · Safe to merge
21.1%