Repository navigation
Conversation
Details: rootDirs in DiskBlockManagerSuite doesn't get full path from rootDir0, rootDir1
Its same issue as Jira 1527 - fixed it to use absolute path instead of relative
|
Can one of the admins verify this patch? |
|
Jenkins, test this please. |
|
Merged build triggered. |
|
Merged build started. |
|
Merged build finished. |
|
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/14472/ |
|
Mind changing the name? I created a new JIRA for this: Also - the fix as-is doesn't seem to compile. |
There was a problem hiding this comment.
Shouldn't this be new File(file.toString).getCanonicalPath ?
There was a problem hiding this comment.
(Removed my earlier incorrect comment) @techaddict is correct since the value file is a String. Niraj your two new versions are either create a String argument where a File is needed or call File methods on a String. I think the correct invocation is simply deleteBroadcastFile(new File(file)). Everything else would be superfluous. (And this too would simplify if the set of values contained Files not Strings of paths.)
There was a problem hiding this comment.
Sure Sean, I think I agree with you cause hashSet entries are string:
private val files = new TimeStampedHashSet[String]
and I am making it to deleteBroadcastFile(new File(file)) as per your
suggestion.
Niraj
On Thu, Apr 24, 2014 at 10:52 PM, Sean Owen [email protected]:
In core/src/main/scala/org/apache/spark/broadcast/HttpBroadcast.scala:
@@ -229,7 +229,7 @@ private[spark] object HttpBroadcast extends Logging {
val (file, time) = (entry.getKey, entry.getValue)
if (time < cleanupTime) {
iterator.remove()
deleteBroadcastFile(new File(file.toString))deleteBroadcastFile(new File(file.getCanonicalPath))(Removed my earlier incorrect comment) @techaddicthttps://github.com/techaddictis correct since the value
file is a String. Niraj your two new versions are either create a Stringargument where a
File is needed or call File methods on a String. I think the correct
invocation is simply deleteBroadcastFile(new File(file)). Everything else
would be superfluous. (And this too would simplify if the set of values
contained Files not Strings of paths.)—
Reply to this email directly or view it on GitHubhttps://github.com//pull/546/files#r11983954
.
|
Hi Patrick, By changing the name..I suppose you meant.."Assignee Name". I have assigned Please correct me if i am wrong. On Thu, Apr 24, 2014 at 8:13 PM, Patrick Wendell
|
|
@nsuthar ah I wasn't clear - I meant change the title of this pull request to have SPARK-1623 at the front of the title. |
|
@nsuthar pretty sure he meant the name of the PR, to something like |
|
OK, Sorry I misunderstood it. did it. On Thu, Apr 24, 2014 at 10:44 PM, Sean Owen [email protected]:
|
SPARK-1623. Broadcast cleaner should use getCanonicalPath when deleting files by name
|
fixed it to get abs path....jira 1623 |
|
could someone pls verify this patch. Thanks. Niraj |
|
Jenkins, test this please. |
There was a problem hiding this comment.
not required to wrap it in another File.
|
Are you actually seeing problems or is this a cleanup exercise to use appropriate api ? If we are not seeing any actual issues, I would rather not go down the path of fixing this. |
|
getAbsolutePath() would also resolve both issues as far as I can tell, For HttpBroadcast, see how the file names are retrieved with (Is the I/O going to matter though? These are executed once.) On Sun, Apr 27, 2014 at 3:06 PM, Mridul Muralidharan
|
|
It goes back to the problem we are trying to solve. If it is in context of a specific usecase - then it becomes function of that : do we need canonical names or are the path always constructed using common patterns which are consistent (always relative to cwd or specified w.r.t some root (which can be symlink). In any case, getAbsolutePath/File does not buy us anything much. |
|
Agree and that leads to the changes. For example |
|
Just fly-by-commenting here, but the performance cost of doing a few directory traversals is not relevant in this code path. It gets called only once in the lifetime of a broadcast variable. It think the bigger issues are around correctness and consistency... |
|
It is not about a few uses here or there - either spark codebase as a whole moves to a) canonical path always; or always sticks to b) paths relative to cwd and/or what is returned by File.createTempFile - there is no middle ground IMO. Btw, regarding cost - we do quite a lot of path manipulations elsewhere (block management, shuffle, etc) - which adds to the cost. Trying to carefully cordon off different sections of the code to different idioms is just asking for bugs as the codebase evolves. As we are apparently already hitting ! |
|
Just my 2 bits, but using getCanonicalPath() is usually a code smell; unless it's explicitly necessary (i.e. you know you have a symlink and you want to remove the actual file it references), it's generally better to use getAbsolutePath(). (Not that I think this applies here, but just commenting on the choice of API.) |
|
First, note SPARK-1527 (https://issues.apache.org/jira/browse/SPARK-1527) and its PR (#436). @advancedxy says that was a real issue, and I think it is fixed by the PR, which uses I think that is slightly preferable to the change in this PR. There is a separate issue addressed in this PR / SPARK-1623. That is that the set Whether it happens to all work out because the arguments happen to always be absolute, I think it's probably nicer to resolve this by a) calling So I suggest:
|
|
Sorry for being late for this conversation. I am busy with my own project. First, I agree with @srowen. SPARK-1527 was discovered when there were untracked files in my spark git dir after running tests. In DiskBlockManagerSuite, files were created using file.getName as parent folds, which was a relative path to cwd. The cleanup code deletes the original temp dir. This is a problem or a bug I prefer because it doesn't do it tends to do. In SPARK-1527, srowen suggested that Back in this pr, as @srowen said,
There is a problem. @mridulm I think you are right, we are at case b)paths relative to cwd and/or what is returned by Files.createTempFile, and I think we should stick to this case. But, we need to review the codebase to make sure path manipulation are correct. So I suggest(like @srowen said):
what do you think? |
Add a walk-around for missing ``started`` time in case k8s cluster failed to setup. Also copy full cluster setup logs to logdir for better debuging. Related-Bug: theopenlab/openlab#257
### What changes were proposed in this pull request? Thirteen open rows of milestone 6 move to milestone 7, on the owner's decision of 2 October 2026 after the review of the milestone's open rows before its close. Each was read against the milestone's done-when list (`PLAN_MILESTONE_6.md` 1.3) and against the size-control rows, the goal set on 30 September, and none bears on either: - **180**, promotion, continuously: a cadence (the cross-posts, a findings post every two weeks, a living benchmark page) rather than a task the milestone could close; carried, as decided on 1 October. - **182**, extending Spark's own benchmarks: it was milestone 7's item 8, and returns to it. - **207 and 208**, two measured micro-optimisations of the range-set kernel. - **213**, the warm-up choosing which drivers to compile from statistics. - **214 to 217 and 224**, the rest of the Java port - the time, condition and chrono families, the facade, and the benchmark harness adapter with `VarkaEmitDump` - mechanical, and meant for an agent. - **218**, optional research into why the loop predicate cycles. - **222**, structural hashing of IR nodes, a compile-time cost. - **231**, the fallback path's row loops reading columns through the batch's vectors. The moves follow the precedent of 15 and 21 September (milestone 5's rows into items 15 and 39): every row keeps its text and number in `PLAN_MILESTONE_6.md` with a "Moved to milestone 7" note at its head, so every citation still resolves; sections 2.8 and 2.9, the design sections of 182 and 180, carry a note under their headings; section 8 lists the thirteen; and `SCOPE_MILESTONE_7.md` item 81 tables them with where each design is and why each left. Row 181, the second post, published on 1 October, is marked done, the way row 210 was for the first. What is left open in milestone 6 after this and the pull requests in flight (apache#544 closing 233, apache#546 closing 235, apache#547 closing 223 and adding 239): the two size-control rows, 236 (plan a kernel's size before building it) and 239 (locals a loop method stores and never reads). ### Why are the changes needed? So that milestone 6 can close on what it set out to do, and the moved work keeps its place and its reasons. ### Does this PR introduce _any_ user-facing change? No. Two planning documents. ### How was this patch tested? `dev/varka_quote_check.py` reports zero orphans and `dev/varka_precommit.sh` no findings. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5)
### What changes were proposed in this pull request? Task 235, the first of the rows to resolve before milestone 6 closes: the IR fuzzer now draws `NarrowLane`, the root every `TIME` kernel ends in, so its narrowing store is checked against the reference evaluator on random kernels instead of only on the emitter suite's fixed shapes. **The mechanism.** `NarrowLane` is admitted at an output root only, so it can't be an arm of the grammar's `value` recursion. `LongShapes.root(depth)` draws a value tree as before and, where its magnitude bound fits an int, wraps it in a `NarrowLane` one time in three - only there, because the narrowing truncates with no overflow check, as the compiler builds it only over values proven to fit. `drawLongShape`, `drawWideLongShape` and the long-lane reach test draw their value roots through it. The long-lane differential test reads a narrowing root's output at the store's four bytes a row, sign-extended against the evaluator's 64-bit answer, so a value that did not fit would show as a difference rather than be truncated on both sides. Since the emitter requires all of a kernel's outputs to share one emission lane, and a narrowing root's is its child's, a drawn kernel can now hold a narrowing root beside plain long roots - the case no fixed shape covered. **The reach tests.** The long-lane test no longer excludes `NarrowLane`. The int-lane test keeps its exclusion: `NarrowLane` takes a long child, and nothing in the IR widens an int lane, so no int shape can hold one; the reason in the comment now says so. **What moved with the corpus.** Each shape draws from its own seeded `Random`, so only shapes with a root whose bound fits 32 bits change. Still, the long corpus moves: - `emitted_bytes.json`: all 100 `fuzz_long` blocks at both widths and the `option_arms` digests; every int-lane block and every curated shape is byte-identical. - The cost model's price tables (`VarkaEmitCostTable.java`, `VarkaEmitCostRegister.java`) are fitted over that corpus, so they are refitted, and `emit_cost_audit.json` regenerated after them. The refit moves no default emission: `emitted_bytes.json`, regenerated under the old prices, passes unchanged under the new ones. - `VarkaEmitCostSuite`'s pinned list of wide shapes that gain a loop method under `predictGrouping` (off by default) names new shapes. **Results** (`PLAN_TASK_235.md` 9): - 455 of the first 10,000 long shapes carry a narrowing root, 379 of them beside a plain root; the long-lane fuzz finds no mismatch at 300 iterations or at 10,000. - No conclusion of `PLAN_TASK_199.md` 9 moves: the fitted model's error at 2000 bytes and over is still 2.2% at the median and 12.4% at the 99th percentile. - Two findings for task 236's planner: at 8000 bytes and over the fitted model under-predicts 94.7% of methods, by at most 4.9%, so a planner trusting it near the budget needs that margin; and two of the new pinned shapes gain their loop method by a prediction erring high - the weights build once, yet the prediction closes a group early - where the recorded case is a prediction erring low. Row 235 is marked done in `PLAN_MILESTONE_6.md`. ### Why are the changes needed? A fuzz run says nothing about a node the generator never builds, and `NarrowLane` is in every `TIME` kernel. ### Does this PR introduce _any_ user-facing change? No. Test code, regenerated test oracles and price tables, and the plans; no default emission changes. ### How was this patch tested? `VarkaIrFuzzSuite` at its defaults and the long-lane test at 10,000 iterations; every other consumer of the long-lane draw and the cost corpus - `VarkaEmittedBytesSuite`, `VarkaEmitCostAuditSuite`, `VarkaEmitCostSuite`, `VarkaEmitterDriverTableSuite`, `VarkaEmitterBudgetSuite`, `VarkaExactGroupingSuite`, `VarkaGroupingBoundSuite`, `VarkaLaneTypeSuite`, `VarkaRangeAnalysisSuite` - 92 tests passed, one opt-in test canceled as designed. `dev/varka_quote_check.py` reports zero orphans and `dev/varka_precommit.sh` no findings. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5)
Brings apache#546 (task 235: the long draws take a NarrowLane root). Its refit and this branch's both regenerated VarkaEmitCostTable.java, emit_cost_audit.json and emitted_bytes.json, so the three conflicted; each is regenerated on the merged tree (VARKA_COST_REGEN on VarkaEmitCostSuite, then on VarkaEmitCostAuditSuite, then VARKA_BYTES_REGEN), and the cost, audit, bytes, arithmetic, driver-table, budget, fuzz and grouping-bound suites pass against them. The register is unchanged by the refit. PLAN_TASK_223.md and row 223 now quote the merged audit: 155 methods of 8000 bytes and over against master's 169, where they said 139 against 161; section 9.1 says its long-lane rows were counted on the corpus before task 235. Generated-by: Claude Code (Claude Opus 5.5)
Getting absloute path instead of relative path. : Its a same bug as Jira 1527