"Neeraj Singh via GitGitGadget" [off-list ref] writes:
quoted hunk
From: Neeraj Singh <redacted>
Signed-off-by: Neeraj Singh <redacted>
---
environment.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/environment.c b/environment.c
index 3e23eafff80..27d5e11267e 100644
--- a/environment.c
+++ b/environment.c
@@ -43,7 +43,7 @@ const char *git_hooks_path;
int zlib_compression_level = Z_BEST_SPEED;
int core_compression_level;
int pack_compression_level = Z_DEFAULT_COMPRESSION;
-enum FSYNC_OBJECT_FILES_MODE fsync_object_files;
+enum FSYNC_OBJECT_FILES_MODE fsync_object_files = FSYNC_OBJECT_FILES_BATCH;
size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE;
size_t packed_git_limit = DEFAULT_PACKED_GIT_LIMIT;
size_t delta_base_cache_limit = 96 * 1024 * 1024;
Despite what the title of the change claims, this is not "enable for
testing", but "enable for everybody even in production", isn't it?
I'd prefer we do not do this, certainly not for "testing".
If setting the variable to "batch" were meant to eventually improve
performance for all different flavours of workload, I do not think
we would mind if we set it to "batch" for those who opt into the
"experimental" set of features by setting the feature.experimental
configuration variable to true. And after a few development cycles
when the feature proves to be useful for everybody, we may want to
apply this patch under a justification that is different from "for
testing".
On the other hand, if this is meant to help 85% of people while
degrading the remainder of workflow, I do not think we would want to
see this change without a warning that says something along the
lines of "under rare circumstances (e.g. if you employ such and such
workflow), the new default value used for the core.fsyncObjectFiles
configuration variable will hurt performance."
Since this is about answering the question "between performance and
crash resilience, where do you as an end user strike the balance for
your needs?", I do not think it falls into either of the above two
categories.
The only plausible justification I can think of to apply a "we
default to 'batch' for everybody" patch with is something like:
Now with the 'batch' setting for core.fsyncObjectFiles, unlike
'true' that paid very high overhead, the overhead to ensure our
writes hit the disk platters has so greatly been reduced that it
hurts the performance only negligibly. Let's switch the default
from the unsafe value of 'false' to safer and performant value
of 'batch'.
I however doubt with the current round of patches, we are there yet.
On Wed, Sep 15, 2021 at 9:21 AM Junio C Hamano [off-list ref] wrote:
"Neeraj Singh via GitGitGadget" [off-list ref] writes:
quoted
From: Neeraj Singh <redacted>
Signed-off-by: Neeraj Singh <redacted>
---
environment.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/environment.c b/environment.c
index 3e23eafff80..27d5e11267e 100644
--- a/environment.c
+++ b/environment.c
@@ -43,7 +43,7 @@ const char *git_hooks_path;
int zlib_compression_level = Z_BEST_SPEED;
int core_compression_level;
int pack_compression_level = Z_DEFAULT_COMPRESSION;
-enum FSYNC_OBJECT_FILES_MODE fsync_object_files;
+enum FSYNC_OBJECT_FILES_MODE fsync_object_files = FSYNC_OBJECT_FILES_BATCH;
size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE;
size_t packed_git_limit = DEFAULT_PACKED_GIT_LIMIT;
size_t delta_base_cache_limit = 96 * 1024 * 1024;
Despite what the title of the change claims, this is not "enable for
testing", but "enable for everybody even in production", isn't it?
I'd prefer we do not do this, certainly not for "testing".
If setting the variable to "batch" were meant to eventually improve
performance for all different flavours of workload, I do not think
we would mind if we set it to "batch" for those who opt into the
"experimental" set of features by setting the feature.experimental
configuration variable to true. And after a few development cycles
when the feature proves to be useful for everybody, we may want to
apply this patch under a justification that is different from "for
testing".
On the other hand, if this is meant to help 85% of people while
degrading the remainder of workflow, I do not think we would want to
see this change without a warning that says something along the
lines of "under rare circumstances (e.g. if you employ such and such
workflow), the new default value used for the core.fsyncObjectFiles
configuration variable will hurt performance."
Since this is about answering the question "between performance and
crash resilience, where do you as an end user strike the balance for
your needs?", I do not think it falls into either of the above two
categories.
The only plausible justification I can think of to apply a "we
default to 'batch' for everybody" patch with is something like:
Now with the 'batch' setting for core.fsyncObjectFiles, unlike
'true' that paid very high overhead, the overhead to ensure our
writes hit the disk platters has so greatly been reduced that it
hurts the performance only negligibly. Let's switch the default
from the unsafe value of 'false' to safer and performant value
of 'batch'.
I however doubt with the current round of patches, we are there yet.
Sorry for being unclear here (and perhaps including an improper patch).
This commit is mainly to ensure that we get coverage of batch mode on all
platforms in the CI infrastructure. I don't believe it should be included in
mainline git without significantly more discussion and experimentation.
However, I'd hope that Git for Windows would be able to adopt batch mode
by default when they pull this series in. They are currently enabling fsync
by default.
Batch mode does have more cost, particularly on rotational media.
I think git should eventually enable batch mode by default with the proviso that
maintainers and people running ephemeral CI infrastructure should turn
fsync off
if they care more about speed than durability.
Do you think that feature.experimental is a good place to put this right away,
or should we just leave this as an option that Git for Windows can pick up and
leave the other platforms alone?
Thanks,
Neeraj