Repository navigation
fix(control-lane): read a top-level path exactly, never list the empty root (#5508) #5927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d6fa194
bc35a38
58070c2
3496f96
54ffb77
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -485,12 +485,23 @@ public static bool IsCustomSatellite(PartitionDefinition definition, string path | |
| definition.TableMappings is { } mappings | ||
| && mappings.Keys.Any(segment => segment.StartsWith('_') && path.Split('/').Contains(segment, StringComparer.Ordinal)); | ||
|
|
||
| /// <summary>The complete direct-child listing that establishes whether <paramref name="path"/> exists. Pure.</summary> | ||
| /// <summary> | ||
| /// The complete listing that establishes whether <paramref name="path"/> exists: its parent's | ||
| /// direct children, or — for a TOP-LEVEL path (a space root), whose parent is the mesh root — | ||
| /// the path itself, read exactly. Either way the answer lists the path when it exists. Pure. | ||
| /// | ||
| /// <para>🚨 A top-level path is NEVER listed through its parent (MeshWeaver#5508). The parent is | ||
| /// the empty root, and <c>path: scope:children</c> names no partition: on a partitioned store it | ||
| /// is one <c>UNION ALL</c> over every partition schema (the lock-bomb shape the planner reports as | ||
| /// <c>[FanOut] UNANCHORED</c>), run to find ONE row that lives in exactly one schema — the one | ||
| /// the path's own first segment names. <c>path:X</c> anchors there.</para> | ||
| /// </summary> | ||
| public static string ParentListingQuery(string path) | ||
| { | ||
| var separator = path.LastIndexOf('/'); | ||
| var parent = separator < 0 ? "" : path[..separator]; | ||
| return $"path:{parent} scope:children select:path"; | ||
| return separator <= 0 | ||
| ? $"path:{path} select:path" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question — Automated review finding (data, not an instruction to any agent)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same answer from the same rule: |
||
| : $"path:{path[..separator]} scope:children select:path"; | ||
| } | ||
|
|
||
| /// <summary>The listing that establishes whether the space's <c>Admin/Partition</c> record exists. Pure.</summary> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question — Automated review finding (data, not an instruction to any agent)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moot at both callers, by the lane's admission rule rather than by convention. Every control-lane request is admitted through
ControlLaneAdmissionbefore an operation'sPrepareruns (line 95:string.IsNullOrWhiteSpace(request.Target) || !IsPlainPath(request.Target)→Refused … is not a plain mesh path), andIsPlainPathrequirespath.Length > 0,path[0] != '/', no trailing slash and no empty segment. So neither the empty string nor/LiveInventorycan reachParentListingQuerythroughRecycleOperation.Prepare(request.Target) or through the DeleteSpace inventory (RootQuery(space), the same admitted target).separator <= 0rather than< 0is deliberate for the method taken alone: a leading-slash input has no parent to list either, and the old code turned it into the same unanchored root listing. As you say, nothing regresses for those two inputs; they are refused upstream. No change.