threads / patch / 55482

patchreftable: document an alternate cleanup method on Windows

Subject: [PATCH] reftable: document an alternate cleanup method on Windows

## tl;dr

2 messages between Apr 12, 2021 and Apr 12, 2021. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Han-Wen Nienhuys via GitGitGadget· Apr 12, 2021, 19:12 UTC · lore
From: Han-Wen Nienhuys <hanwen@google.com>

The new method uses the update_index counter, which isn't susceptible to clock inaccuracies.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
    reftable: document an alternate cleanup method on Windows
    
    The new method uses the update_index counter, which isn't susceptible to
    clock inaccuracies.
    
    Signed-off-by: Han-Wen Nienhuys hanwen@google.com
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1001%2Fhanwen%2Fwindows-2-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1001/hanwen/windows-2-v1
Pull-Request: https://github.com/git/git/pull/1001
 Documentation/technical/reftable.txt | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
Show changes to Documentation/technical/reftable.txt +7 −2
diff --git a/Documentation/technical/reftable.txt b/Documentation/technical/reftable.txt
index 3ef169af27d8..d7c3b645cfb0 100644
--- a/Documentation/technical/reftable.txt
+++ b/Documentation/technical/reftable.txt
@@ -1011,8 +1011,13 @@ reftable stack, reload `tables.list`, and delete any tables no longer mentioned
 in `tables.list`.
 
 Irregular program exit may still leave about unused files. In this case, a
-cleanup operation can read `tables.list`, note its modification timestamp, and
-delete any unreferenced `*.ref` files that are older.
+cleanup operation should proceed as follows:
+
+* take a lock `tables.list.lock` to prevent concurrent modifications
+* refresh the reftable stack, by reading `tables.list`
+* for each `*.ref` file, remove it if
+** it is not mentioned in `tables.list`, and
+** its max update_index is not beyond the max update_index of the stack
 
 
 Alternatives considered

base-commit: 89b43f80a514aee58b662ad606e6352e03eaeee4
-- 
gitgitgadget
Junio C Hamano· Apr 12, 2021, 21:31 UTC · re: Han-Wen Nienhuys via GitGitGadget · lore

Re: [PATCH] reftable: document an alternate cleanup method on Windows

"Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 13 quoted lines
> From: Han-Wen Nienhuys <hanwen@google.com>
>
> The new method uses the update_index counter, which isn't susceptible to clock
> inaccuracies.
>
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>     reftable: document an alternate cleanup method on Windows
>     
>     The new method uses the update_index counter, which isn't susceptible to
>     clock inaccuracies.
>     
>     Signed-off-by: Han-Wen Nienhuys hanwen@google.com
Thanks, will queue.
Show 30 quoted lines
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1001%2Fhanwen%2Fwindows-2-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1001/hanwen/windows-2-v1
> Pull-Request: https://github.com/git/git/pull/1001
>
>  Documentation/technical/reftable.txt | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/technical/reftable.txt b/Documentation/technical/reftable.txt
> index 3ef169af27d8..d7c3b645cfb0 100644
> --- a/Documentation/technical/reftable.txt
> +++ b/Documentation/technical/reftable.txt
> @@ -1011,8 +1011,13 @@ reftable stack, reload `tables.list`, and delete any tables no longer mentioned
>  in `tables.list`.
>  
>  Irregular program exit may still leave about unused files. In this case, a
> -cleanup operation can read `tables.list`, note its modification timestamp, and
> -delete any unreferenced `*.ref` files that are older.
> +cleanup operation should proceed as follows:
> +
> +* take a lock `tables.list.lock` to prevent concurrent modifications
> +* refresh the reftable stack, by reading `tables.list`
> +* for each `*.ref` file, remove it if
> +** it is not mentioned in `tables.list`, and
> +** its max update_index is not beyond the max update_index of the stack
>  
>  
>  Alternatives considered
>
> base-commit: 89b43f80a514aee58b662ad606e6352e03eaeee4

← back to recent threads