* [PATCH] reftable: document an alternate cleanup method on Windows
@ 2021-04-12 19:12 Han-Wen Nienhuys via GitGitGadget
2021-04-12 21:31 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-12 19:12 UTC (permalink / raw)
To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys
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(-)
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] reftable: document an alternate cleanup method on Windows
2021-04-12 19:12 [PATCH] reftable: document an alternate cleanup method on Windows Han-Wen Nienhuys via GitGitGadget
@ 2021-04-12 21:31 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2021-04-12 21:31 UTC (permalink / raw)
To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys
"Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:
> 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.
>
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-12 21:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12 19:12 [PATCH] reftable: document an alternate cleanup method on Windows Han-Wen Nienhuys via GitGitGadget
2021-04-12 21:31 ` Junio C Hamano
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).