Message ID | 220715.86bktqzdb8.gmgdl@evledraar.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | ab/squelch-empty-fsync-traces & hx/unpack-streaming bug (was: What's cooking in git.git (Jul 2022, #04; Wed, 13)) | expand |
CC: Johannes Schindelin On Fri, Jul 15, 2022 at 10:18 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote: > > I hadn't had time to look at this until now. There's some interesting > behavior here. > > The code to check the hardware flush was added in aaf81223f48 > (unpack-objects: use stream_loose_object() to unpack large objects, > 2022-06-11) (that series is now on master). > > But as my ab/squelch-empty-fsync-traces notes we always add this to the > event, so the: > > grep fsync/hardware-flush trace2.txt && > > Is equivalent to: > > true && > > I.e. it's not testing worthwhile at all. The reason you're seeing a > failure is deu to 412e4caee38 (tests: disable fsync everywhere, > 2021-10-29), i.e. our tests disable fsync(). What you have queued will > pass as: > > GIT_TEST_FSYNC=true ./t5351-unpack-large-objects.sh > > But I think that would be meaningless, since we'll write out that on > FSYNC_HARDWARE_FLUSH whether we actually support "bulk" or not. AFAICT > the way to detect if we support "bulk" at all is to check for > fsync/writeout-only. > > *Except* that we we unconditionally increment the "writeout only" > counter, even if we don't actually support that "bulk" mode. We're just > doing a regular fsync(). > Agree with you. In fact, since stream_loose_object() only works with objects of type *blob*, the rest objects of *commit* and *tree* will still use write_loose_object(), so "grep fsync/hardware-flush trace2.txt" did not check for the changes in stream_loose_object() at all. I haven't found any reference cases in the existing tests. Perhaps, we need more efficient "fsync" test cases? Thanks. -Han Xin
diff --git a/t/t5351-unpack-large-objects.sh b/t/t5351-unpack-large-objects.sh index 8ce8aa3b147..29cab843eb9 100755 --- a/t/t5351-unpack-large-objects.sh +++ b/t/t5351-unpack-large-objects.sh @@ -53,8 +53,12 @@ BATCH_CONFIGURATION='-c core.fsync=loose-object -c core.fsyncmethod=batch' test_expect_success 'unpack big object in stream (core.fsyncmethod=batch)' ' prepare_dest 1m && GIT_TRACE2_EVENT="$(pwd)/trace2.txt" \ + GIT_TEST_FSYNC=true \ git -C dest.git $BATCH_CONFIGURATION unpack-objects <pack-$PACK.pack && - grep fsync/hardware-flush trace2.txt && + grep fsync/ trace2.txt >wo.txt && + sed -e "s/.*value\":\"//" -e "s/\".*//" <wo.txt >actual && + test_write_lines 6 1 >expect && + test_cmp expect actual && test_dir_is_empty dest.git/objects/pack && git -C dest.git cat-file --batch-check="%(objectname)" <obj-list >current && cmp obj-list current