summaryrefslogtreecommitdiff
path: root/src/redis-check-aof.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix RDB check regression caused by PR 12022 (#12051)Joe Hu2023-04-171-1/+1
| | | | | | | | | | | | | | | The nightly tests showed that the recent PR #12022 caused random failures in aof.tcl on checking RDB preamble inside an AOF file. Root cause: When checking RDB preamble in an AOF file, what's passed into redis_check_rdb is aof_filename, not aof_filepath. The newly introduced isFifo function does not check return status of the stat call and hence uses the uninitailized stat_p object. Fix: 1. Fix isFifo by checking stat call's return code. 2. Pass aof_filepath instead of aof_filename to redis_check_rdb. 3. move the FIFO check to rdb.c since the limitation is the re-opening of the file, and not anything specific about redis-check-rdb.
* Unify repeated code in redis-check-aof (#11456)yancz20002022-11-061-30/+16
|
* Fix path copy error and add more logs. (#10324)chenyang80942022-02-221-4/+4
| | | Since we didn't copy the null terminator to temp_filepath, dirname could return the wrong result.
* Adapt redis-check-aof tool for Multi Part Aof (#10061)chenyang80942022-02-171-135/+414
| | | | | | | | | | | | | | | | | | | | | | | Modifications of this PR: 1. Support the verification of `Multi Part AOF`, while still maintaining support for the old-style `AOF/RDB-preamble`. `redis-check-aof` will automatically choose which mode to use according to the incoming file format. `Usage: redis-check-aof [--fix|--truncate-to-timestamp $timestamp] <AOF/manifest>` 2. Refactor part of the code to make it easier to understand 3. Currently only supports truncate (`--fix` or `--truncate-to-timestamp`) the last AOF file (may be `BASE` or `INCR`) The reasons for 3 above: - for `--fix`: Only the last AOF may be truncated, this is guaranteed by redis - for `--truncate-to-timestamp`: Normally, we only have `BASE` + `INCR` files at most, and `BASE` cannot be truncated(It only contains a timestamp annotation at the beginning of the file), so only `INCR` can be truncated. If we have a `BASE+INCR1+INCR2` file (meaning we have an interrupted AOFRW), Only `INCR2` files can be truncated at this time. If we still insist on truncate `INCR1`, we need to manually delete `INCR2` and update the manifest file, then re-run `redis-check-aof` - If we want to support truncate any file, we need to add very complicated code to support the atomic modification of multiple file deletion and update manifest, I think this is unnecessary
* Add checks for overflow in redis-check-aof and loadAppendOnlyFile (#9669)yiyuaner2021-11-021-0/+5
| | | Co-authored-by: guoyiyuan <guoyiyuan@sbrella.com>
* Add timestamp annotations in AOF (#9326)Wang Yuan2021-10-251-9/+70
| | | | | | | | | | | | Add timestamp annotation in AOF, one part of #9325. Enabled with the new `aof-timestamp-enabled` config option. Timestamp annotation format is "#TS:${timestamp}\r\n"." TS" is short of timestamp and this method could save extra bytes in AOF. We can use timestamp annotation for some special functions. - know the executing time of commands - restore data to a specific point-in-time (by using redis-check-rdb to truncate the file)
* Print the number of abnormal line in AOF (#8823)bugwz2021-04-201-2/+4
| | | When redis-check-aof finds an error, it prints the line number for faster troubleshooting.
* Enlarge error buffer in redis-check-aof.c to remove compiler warning of ↵Angus Pearson2019-05-081-1/+1
| | | | output truncation through snprintf format string
* redis-check-aof: fix potential overflow.antirez2019-03-181-2/+2
| | | | Bug signaled by @vattezhang in PR #5940 but fixed differently.
* Correct proceding -> proceeding typo.Chris Lamb2017-07-141-1/+1
|
* redis-check-aof: tell users there is a --fix option.antirez2017-07-101-1/+2
|
* AOF check utility: ability to check files with RDB preamble.antirez2017-07-101-12/+26
|
* BSD license added to every C source and header file.antirez2012-11-081-0/+30
|
* redis-check-aof is now large files safe also on 32 bit systems.antirez2012-02-141-11/+14
|
* redis.c split into many different C files.antirez2010-07-011-0/+185
networking related stuff moved into networking.c moved more code more work on layout of source code SDS instantaneuos memory saving. By Pieter and Salvatore at VMware ;) cleanly compiling again after the first split, now splitting it in more C files moving more things around... work in progress split replication code splitting more Sets split Hash split replication split even more splitting more splitting minor change