redict/tests/unit
Binbin cb17178658
Fix fork done handler wrongly update fsync metrics and enhance AOF_ FSYNC_ALWAYS (#11973)
This PR fix several unrelated bugs that were discovered by the same set of tests
(WAITAOF tests in #11713), could make the `WAITAOF` test hang. 

The change in `backgroundRewriteDoneHandler` is about MP-AOF.
That leftover / old code assumes that we started a new AOF file just now
(when we have a new base into which we're gonna incrementally write), but
the fact is that with MP-AOF, the fork done handler doesn't really affect the
incremental file being maintained by the parent process, there's no reason to
re-issue `SELECT`, and no reason to update any of the fsync variables in that flow.
This should have been deleted with MP-AOF (introduced in #9788, 7.0).
The damage is that the update to `aof_fsync_offset` will cause us to miss an fsync
in `flushAppendOnlyFile`, that happens if we stop write commands in `AOF_FSYNC_EVERYSEC`
while an AOFRW is in progress. This caused a new `WAITAOF` test to sometime hang forever.

Also because of MP-AOF, we needed to change `aof_fsync_offset` to `aof_last_incr_fsync_offset`
and match it to `aof_last_incr_size` in `flushAppendOnlyFile`. This is because in the past we compared
`aof_fsync_offset` and `aof_current_size`, but with MP-AOF it could be the total AOF file will be
smaller after AOFRW, and the (already existing) incr file still has data that needs to be fsynced.

The change in `flushAppendOnlyFile`, about the `AOF_FSYNC_ALWAYS`, it is follow #6053
(the details is in #5985), we also check `AOF_FSYNC_ALWAYS` to handle a case where
appendfsync is changed from everysec to always while there is data that's written but not yet fsynced.
2023-03-29 15:17:05 +03:00
..
cluster Add reply_schema to command json files (internal for now) (#10273) 2023-03-11 10:14:16 +02:00
moduleapi Module commands to have ACL categories. (#11708) 2023-03-21 10:07:11 -07:00
type Avoid assertion when MSETNX is used with the same key twice (CVE-2023-28425) (#11940) 2023-03-20 18:50:44 +02:00
acl-v2.tcl Unify ACL failure error messaging. (#11160) 2022-10-16 09:01:37 +03:00
acl.tcl Custom authentication for Modules (#11659) 2023-03-15 15:18:42 -07:00
aofrw.tcl Add reply_schema to command json files (internal for now) (#10273) 2023-03-11 10:14:16 +02:00
auth.tcl Fix incorrect error code for eval scripts and fix test error checking (#10575) 2022-04-14 11:18:32 +03:00
bitfield.tcl Fix command BITFIELD_RO and BITFIELD argument json file, add some test cases for them (#11445) 2022-11-02 15:15:12 +02:00
bitops.tcl Run large-memory tests as solo. (#10626) 2022-04-24 17:29:35 +03:00
client-eviction.tcl Add reply_schema to command json files (internal for now) (#10273) 2023-03-11 10:14:16 +02:00
dump.tcl Bump codespell from 2.1.0 to 2.2.1 in /.codespell (#11184) 2022-08-24 15:07:43 +03:00
expire.tcl Fix test and improve assert_replication_stream print the whole stream (#11793) 2023-03-08 22:39:54 +02:00
functions.tcl Tests: Add missing key declaration in scripts (#11134) 2022-08-16 22:04:22 +03:00
geo.tcl Add reply_schema to command json files (internal for now) (#10273) 2023-03-11 10:14:16 +02:00
hyperloglog.tcl Hyperloglog avoid allocate more than 'server.hll_sparse_max_bytes' bytes of memory for sparse representation (#11438) 2022-11-28 17:35:31 +02:00
info-command.tcl Make INFO command variadic (#6891) 2022-02-08 13:14:42 +02:00
info.tcl Fix error stats and failed command stats for blocked clients (#10309) 2022-02-21 11:20:41 +02:00
introspection-2.tcl Add COMMAND COUNT test to cover reply-schemas-validator test (#11971) 2023-03-26 08:39:04 +03:00
introspection.tcl Add needs:reset for the test (#11959) 2023-03-23 10:48:45 +02:00
keyspace.tcl String pattern matching had exponential time complexity on pathological patterns (CVE-2022-36021) (#11858) 2023-02-28 15:15:26 +02:00
latency-monitor.tcl Fix Uninitialised value error in createSparklineSequence (LATENCY GRAPH) (#11892) 2023-03-09 12:05:50 +02:00
lazyfree.tcl attempt to fix tracking test issue with external tests due to lazy free (#9722) 2021-11-02 16:42:53 +02:00
limits.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
maxmemory.tcl Make assert_refcount skip the OBJECT REFCOUNT check with needs:debug tag (#11487) 2022-11-22 16:38:27 +02:00
memefficiency.tcl Increase the threshold of the AOF loading defrag test (#11871) 2023-03-04 12:54:36 +02:00
multi.tcl Fix possible memory corruption in FLUSHALL when a client watches more than one key (#11854) 2023-02-28 12:02:55 +02:00
networking.tcl Add reply_schema to command json files (internal for now) (#10273) 2023-03-11 10:14:16 +02:00
obuf-limits.tcl Add reply_schema to command json files (internal for now) (#10273) 2023-03-11 10:14:16 +02:00
oom-score-adj.tcl Return 0 when config set out-of-range oom-score-adj-values (#10601) 2022-04-19 11:31:15 +03:00
other.tcl Add reply_schema to command json files (internal for now) (#10273) 2023-03-11 10:14:16 +02:00
pause.tcl Bump codespell to 2.2.4, fix typos and outupdated comments (#11911) 2023-03-16 08:50:32 +02:00
printver.tcl Print version info before running the test 2011-05-20 11:44:54 +02:00
protocol.tcl Add reply_schema to command json files (internal for now) (#10273) 2023-03-11 10:14:16 +02:00
pubsub.tcl Fix the bug that CLIENT REPLY OFF|SKIP cannot receive push notifications (#11875) 2023-03-12 17:50:44 +02:00
pubsubshard.tcl Fix the bug that CLIENT REPLY OFF|SKIP cannot receive push notifications (#11875) 2023-03-12 17:50:44 +02:00
querybuf.tcl Ignore resize threshold on idle qbuf resizing (#9322) 2021-08-06 20:50:34 +03:00
quit.tcl Add tests for OK on QUIT 2010-10-15 12:54:53 +02:00
replybufsize.tcl Introduce debug command to disable reply buffer resizing (#10360) 2022-03-01 14:40:29 +02:00
scan.tcl Listpack encoding for sets (#11290) 2022-11-09 19:50:07 +02:00
scripting.tcl Support for RM_Call on blocking commands (#11568) 2023-03-16 14:04:31 +02:00
shutdown.tcl Fix race in temp rdb delete shutdown test (#11840) 2023-03-21 17:51:47 +02:00
slowlog.tcl reprocess command when client is unblocked on keys (#11012) 2023-01-01 23:35:42 +02:00
sort.tcl Avoid integer overflows in SETRANGE and SORT (CVE-2022-35977) (#11720) 2023-01-16 13:49:30 +02:00
tls.tcl Add support for reading encrypted keyfiles. (#8644) 2021-03-22 13:27:46 +02:00
tracking.tcl Fix the bug that CLIENT REPLY OFF|SKIP cannot receive push notifications (#11875) 2023-03-12 17:50:44 +02:00
violations.tcl Run large-memory tests as solo. (#10626) 2022-04-24 17:29:35 +03:00
wait.tcl Fix fork done handler wrongly update fsync metrics and enhance AOF_ FSYNC_ALWAYS (#11973) 2023-03-29 15:17:05 +03:00