{"action":"created","issue":{"url":"https://api.github.com/repos/iterative/dvc/issues/881","repository_url":"https://api.github.com/repos/iterative/dvc","labels_url":"https://api.github.com/repos/iterative/dvc/issues/881/labels{/name}","comments_url":"https://api.github.com/repos/iterative/dvc/issues/881/comments","events_url":"https://api.github.com/repos/iterative/dvc/issues/881/events","html_url":"https://github.com/iterative/dvc/issues/881","id":340714532,"node_id":"MDU6SXNzdWUzNDA3MTQ1MzI=","number":881,"title":"[Question] Can I recover previous version of a data file that was already reproduced?","user":{"login":"andrethrill","id":25300892,"node_id":"MDQ6VXNlcjI1MzAwODky","avatar_url":"https://avatars1.githubusercontent.com/u/25300892?v=4","gravatar_id":"","url":"https://api.github.com/users/andrethrill","html_url":"https://github.com/andrethrill","followers_url":"https://api.github.com/users/andrethrill/followers","following_url":"https://api.github.com/users/andrethrill/following{/other_user}","gists_url":"https://api.github.com/users/andrethrill/gists{/gist_id}","starred_url":"https://api.github.com/users/andrethrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrethrill/subscriptions","organizations_url":"https://api.github.com/users/andrethrill/orgs","repos_url":"https://api.github.com/users/andrethrill/repos","events_url":"https://api.github.com/users/andrethrill/events{/privacy}","received_events_url":"https://api.github.com/users/andrethrill/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-07-12T16:39:39Z","updated_at":"2018-07-13T09:55:45Z","closed_at":null,"author_association":"NONE","body":"Here's a sequence of commands I executed:\r\n\r\n```shell\r\n# dvc --version\r\ndvc 0.11.0+c63658\r\n# mkdir test_repo\r\n# cd test_repo/\r\n# git init\r\nInitialized empty Git repository in /workspace/schedulers/andre/test_repo/.git/\r\n# dvc init\r\n# echo aeiou > file.txt\r\n# dvc add file.txt\r\n# git status                                         #here the content of file.txt is \"aeiou\"\r\nOn branch master\r\n\r\nInitial commit\r\n\r\nChanges to be committed:\r\n  (use \"git rm --cached <file>...\" to unstage)\r\n\r\n        new file:   .dvc/.gitignore\r\n        new file:   .dvc/config\r\n\r\nUntracked files:\r\n  (use \"git add <file>...\" to include in what will be committed)\r\n\r\n        .gitignore\r\n        file.txt.dvc\r\n\r\n# git add .dvc/.gitignore\r\n# git add .dvc/config\r\n# git add .gitignore\r\n# git add file.txt.dvc\r\n# git commit -m \"firt commit\"\r\n# echo aaeiou > file.txt\r\n# less file.txt\r\n# dvc status\r\nfile.txt.dvc\r\n        outs\r\n                changed:  file.txt\r\n# dvc repro file.txt.dvc\r\nReproducing 'file.txt.dvc'\r\nVerifying data sources in 'file.txt.dvc'.               #here the content of file.txt is \"aaeiou\"\r\n\r\n# git status\r\nOn branch master\r\nChanges not staged for commit:\r\n  (use \"git add <file>...\" to update what will be committed)\r\n  (use \"git checkout -- <file>...\" to discard changes in working directory)\r\n\r\n        modified:   file.txt.dvc\r\n\r\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\r\n\r\n# git checkout file.txt.dvc\r\n# dvc checkout\r\nCorrupted cache file .dvc/cache/67/6d4898a0811e140ee237952d860def\r\nCache '676d4898a0811e140ee237952d860def' not found. File 'file.txt' won't be created.\r\n```\r\n\r\n\r\nShouldn't I be able to, somehow, recover the original file with the content \"aeiou\"?"},"comment":{"url":"https://api.github.com/repos/iterative/dvc/issues/comments/404786395","html_url":"https://github.com/iterative/dvc/issues/881#issuecomment-404786395","issue_url":"https://api.github.com/repos/iterative/dvc/issues/881","id":404786395,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDc4NjM5NQ==","user":{"login":"andrethrill","id":25300892,"node_id":"MDQ6VXNlcjI1MzAwODky","avatar_url":"https://avatars1.githubusercontent.com/u/25300892?v=4","gravatar_id":"","url":"https://api.github.com/users/andrethrill","html_url":"https://github.com/andrethrill","followers_url":"https://api.github.com/users/andrethrill/followers","following_url":"https://api.github.com/users/andrethrill/following{/other_user}","gists_url":"https://api.github.com/users/andrethrill/gists{/gist_id}","starred_url":"https://api.github.com/users/andrethrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrethrill/subscriptions","organizations_url":"https://api.github.com/users/andrethrill/orgs","repos_url":"https://api.github.com/users/andrethrill/repos","events_url":"https://api.github.com/users/andrethrill/events{/privacy}","received_events_url":"https://api.github.com/users/andrethrill/received_events","type":"User","site_admin":false},"created_at":"2018-07-13T09:55:45Z","updated_at":"2018-07-13T09:55:45Z","author_association":"NONE","body":"Thank you once again @efiop \r\n\r\nWhat about my last question (that I guess you missed because it was an edit I did):\r\n> Assuming yes, would the corrupted file still be kept in cache on the side or would it be overwritten?\r\n\r\n---\r\n\r\nSorry for insisting but I was thinking further and now my head is spinning eheh\r\nConsider the following scenario:\r\n\r\nThe same DAG as before: `file1_v1.txt --> [script1.py] --> file1_v2.txt --> [script2.py] --> file1_v3.txt`.\r\nAfter this there are 3 files in cache, when for each original `.txt`. Assume here I `git commit -m \"commit1\"`\r\n\r\nNow I want to improve, let's say, script2.py and I start experimenting with it. While I'm experimenting (without git commiting or DVC reproing), each run writes to `file1_v3.txt` and thus to the cache.\r\n\r\nOnce I reach a stable state that I feel confortable with, I will `dvc repro file1_v3.txt.dvc`. At this point, I guess, a new cache file for `file1_v3.txt` is created. So there will be two cache files for this `file1_v3.txt`: the first one which is now corrupted and the new one which is coherent with the current state.\r\n\r\nNow I `git commit -m \"commit2\"`\r\n\r\nNow there is no way to checkout to `commit1` and get into a coherent state without rerunning `script2.py` because the cache is corrupted, right?\r\n\r\n\r\nI'm just thinking in cases where the scripts take a long time to run and I want to avoid running them as much as possible.\r\n\r\n---\r\n\r\nIs the scenario above correct?\r\nMaybe the way I describe above is not the best way to include DVC in my workflow, any input would be much appreciated.\r\n\r\nThanks is advance,\r\nAndré"}}
{"actor":{"display_login":"andrethrill"}}