Repository navigation
Conversation
…/downloading file outputs. - This addresses a subtle race condition when chaining together tasks with plain files. - Update commentary in several places to clarify understanding of file->state.
|
@btovar @JinZhou5042 @colinthomas-z80 this is a tricky one that may affect more than the immediate bug problem. Please take a close look and give me your thoughts on whether this fits our broader concepts around file handling. I think the philosophical change here is that while a |
| A file in the CREATED state does not necessarily have a replica yet. | ||
| However, a task that needs it can be scheduled, because a replica either exists | ||
| or can be created from an available source. | ||
| - A file is PENDING if the contents of the file are not available, |
There was a problem hiding this comment.
These two cases as described here seem to overlap. Once says that the contents could be created, the other says that they will be created. What is the real difference?
There was a problem hiding this comment.
I have the same question too. I think the difference should be whether the producing task has succeeded, CREATED means it has and PENDING means it hasn't.
There was a problem hiding this comment.
Hmm, the distinction is subtle but I think my explanation is not good enough yet.
Both files and replicas have state, but they mean different things.
The state of a file describes its logical existence.
- A file that is PENDING does not exist anywhere yet, because it is the output of some task that has not yet run. The manager cannot materialize the file, except by scheduling the task that creates it. The metadata of this file (such as the size) are unknown, because it has never been created.
- A file that is CREATED has the contents available such that the manager can deliver it to a task when scheduled. A FILE exists if its contents are stored at the manager. A TEMP if its contents are on a worker somewhere. A URL and a MINI_TASK are always in the CREATED state because they can be delivered on demand. The metadata of this file (such as the size) are known, because it has been "seen" in the wild.
However, the state of a file is orthogonal to the state of its replicas:
- A normal FILE may be CREATED because it exists I the manager's filesystem, and yet not have any replicas on workers, because they simply haven't been transferred yet.
- A TEMP file (with this patch) will briefly have a replica (when a cache-update is received) and yet still be in the PENDING state because we have not yet processed the completion of the corresponding task. Once we determine that the task succeeded and iterate over its outputs, we declare the file CREATED and available for use by other tasks.
Does that help?
There was a problem hiding this comment.
Yes, that makes a lot more sense to me.
A file that is CREATED has the contents available such that the manager can deliver it to a task when scheduled. A FILE exists if its contents are stored at the manager. A TEMP if its contents are on a worker somewhere
But in the fix a TEMP is CREATED not only when the contents are on a worker somewhere, but also when the producing task is marked as complete by the manager. So should it be that both FILE and TEMP is CREATED when the corresponding producing task is complete?
There was a problem hiding this comment.
I think you could make an argument in favor handling the replica file type in one place and the file type in the other place. But that sort of disparate handling makes me concerned for maintainability. I split them up so that cache-update is primarily about handling replica status, and vine_manager_get_output_files handles file contents and status.
Is there a substantial benefit to marking (only)TEMP files as immediately CREATED when the cache-update arrives?
There was a problem hiding this comment.
I think I'm still confused with:
A file that is CREATED has the contents available such that the manager can deliver it to a task when scheduled. A FILE exists if its contents are stored at the manager. A TEMP if its contents are on a worker somewhere.
What does exists mean? That is CREATED or it is a different thing. If a TEMP file was created but lost all of its replicas, does it go back to pending?
Created is tripping me for files. It makes sense for replicas? For files I would say AVAILABLE or PENDING?
There was a problem hiding this comment.
I like PENDING -> AVAILABLE, let me take a crack at that.
There was a problem hiding this comment.
Ok with this terminology now?
| if (f) { | ||
| /* We know it exists and how large it is now. */ | ||
| f->state = VINE_FILE_STATE_CREATED; | ||
| /* We now know the size of the file. */ |
There was a problem hiding this comment.
How do we know the size of the file but it is not created? Do we need better names created vs pending? file met once vs never met? Is that the difference?
There was a problem hiding this comment.
Indeed this is a little strange. If the file did not already exist, then the cache-update is the way that we discover the file size and other metadata.
|
Let me know if my understanding is wrong. In the original implementation, a file is |
|
An alternative idea may be to keep the existing states and modify the task dispatch to allow a peer transfer from the worker it was created on before it exists on the manager. If peer transfers are disabled or fail it will allow another cycle of the main loop which will likely download the file. This could accelerate workflows which are impeded by manager downloads. |
|
Following up on our discussion from the lab meeting last week. |
Proposed Changes
Merge Checklist
The following items must be completed before PRs can be merged.
Check these off to verify you have completed all steps.
make testRun local tests prior to pushing.make formatFormat source code to comply with lint policies. Note that some lint errors can only be resolved manually (e.g., Python)make lintRun lint on source code prior to pushing.