{"thread":{"id":"55482","subject":"[PATCH] reftable: document an alternate cleanup method on Windows","startedAt":"2021-04-12T19:12:42Z","lastAt":"2021-04-12T21:31:28Z","messageCount":2,"participants":["Han-Wen Nienhuys via GitGitGadget","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"421752","messageId":"pull.1001.git.git.1618254757074.gitgitgadget@gmail.com","threadId":"55482","inReplyTo":null,"subject":"[PATCH] reftable: document an alternate cleanup method on Windows","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-12T19:12:36Z","receivedAt":"2021-04-12T19:12:42Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nThe new method uses the update_index counter, which isn't susceptible to clock\ninaccuracies.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n    reftable: document an alternate cleanup method on Windows\n    \n    The new method uses the update_index counter, which isn't susceptible to\n    clock inaccuracies.\n    \n    Signed-off-by: Han-Wen Nienhuys hanwen@google.com\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1001%2Fhanwen%2Fwindows-2-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1001/hanwen/windows-2-v1\nPull-Request: https://github.com/git/git/pull/1001\n\n Documentation/technical/reftable.txt | 9 +++++++--\n 1 file changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/technical/reftable.txt b/Documentation/technical/reftable.txt\nindex 3ef169af27d8..d7c3b645cfb0 100644\n--- a/Documentation/technical/reftable.txt\n+++ b/Documentation/technical/reftable.txt\n@@ -1011,8 +1011,13 @@ reftable stack, reload `tables.list`, and delete any tables no longer mentioned\n in `tables.list`.\n \n Irregular program exit may still leave about unused files. In this case, a\n-cleanup operation can read `tables.list`, note its modification timestamp, and\n-delete any unreferenced `*.ref` files that are older.\n+cleanup operation should proceed as follows:\n+\n+* take a lock `tables.list.lock` to prevent concurrent modifications\n+* refresh the reftable stack, by reading `tables.list`\n+* for each `*.ref` file, remove it if\n+** it is not mentioned in `tables.list`, and\n+** its max update_index is not beyond the max update_index of the stack\n \n \n Alternatives considered\n\nbase-commit: 89b43f80a514aee58b662ad606e6352e03eaeee4\n-- \ngitgitgadget\n"},{"id":"421814","messageId":"xmqqfszvb36e.fsf@gitster.g","threadId":"55482","inReplyTo":"pull.1001.git.git.1618254757074.gitgitgadget@gmail.com","subject":"Re: [PATCH] reftable: document an alternate cleanup method on Windows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-04-12T21:31:21Z","receivedAt":"2021-04-12T21:31:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Han-Wen Nienhuys via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> The new method uses the update_index counter, which isn't susceptible to clock\n> inaccuracies.\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>     reftable: document an alternate cleanup method on Windows\n>     \n>     The new method uses the update_index counter, which isn't susceptible to\n>     clock inaccuracies.\n>     \n>     Signed-off-by: Han-Wen Nienhuys hanwen@google.com\n\nThanks, will queue.\n\n\n\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1001%2Fhanwen%2Fwindows-2-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1001/hanwen/windows-2-v1\n> Pull-Request: https://github.com/git/git/pull/1001\n>\n>  Documentation/technical/reftable.txt | 9 +++++++--\n>  1 file changed, 7 insertions(+), 2 deletions(-)\n>\n> diff --git a/Documentation/technical/reftable.txt b/Documentation/technical/reftable.txt\n> index 3ef169af27d8..d7c3b645cfb0 100644\n> --- a/Documentation/technical/reftable.txt\n> +++ b/Documentation/technical/reftable.txt\n> @@ -1011,8 +1011,13 @@ reftable stack, reload `tables.list`, and delete any tables no longer mentioned\n>  in `tables.list`.\n>  \n>  Irregular program exit may still leave about unused files. In this case, a\n> -cleanup operation can read `tables.list`, note its modification timestamp, and\n> -delete any unreferenced `*.ref` files that are older.\n> +cleanup operation should proceed as follows:\n> +\n> +* take a lock `tables.list.lock` to prevent concurrent modifications\n> +* refresh the reftable stack, by reading `tables.list`\n> +* for each `*.ref` file, remove it if\n> +** it is not mentioned in `tables.list`, and\n> +** its max update_index is not beyond the max update_index of the stack\n>  \n>  \n>  Alternatives considered\n>\n> base-commit: 89b43f80a514aee58b662ad606e6352e03eaeee4\n"}]}