Repository navigation
Skip replication pings in hashexpire monitor tests - #5437
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #5437 +/- ##
============================================
+ Coverage 81.71% 81.81% +0.09%
============================================
Files 203 203
Lines 105998 105998
============================================
+ Hits 86614 86717 +103
+ Misses 19384 19281 -103 🚀 New features to boost your workflow:
|
…ranch's (#168) The first PRs into unstable (valkey-io/valkey#5437, valkey-io/valkey#5440, valkey-io/valkey#5443) showed the release branch agent's notes as if they were about unstable ("Nothing was built or run here", "I could not read its copy of the test"), right under the line saying the fix passed there. They now have their own section, named for the release branch. Every published fix also carried the plan the agent is given, "Code checks your change with `<command>`: ...", next to the line saying what that command did. Only what ran is published now, with the plan's notes (a stand-in for the job, a run_solo file). The agent and the reviewer still get the plan, and a fix nothing can run still says so. docs/backport.md said a fix for unstable passes at least 10 loops. Under valgrind it is the 4 that are planned. Signed-off-by: Sarthak Aggarwal <[email protected]>
The failure message shows the three monitor lines the test collected were "ping" (db 0, from the primary at 127.0.0.1:21641), HSET and HPEXPIREAT, so the pattern *HSET*myhash*f1*f2*f3*HDEL*myhash*f2* did not match. The ping is the one replicationCron() in src/replication.c feeds to replicas every repl-ping-replica-period, and a replica's MONITOR shows it. In this run it arrived at 09:22:14.885, right after the full sync finished and just before HSET. read_monitor_output filtered only INFO and SELECT lines, so the ping took a slot and the HDEL line was never read. A ping in the replication stream is correct server behaviour, and its timing relative to the test is not something the test controls, so this is a test bug. Skipping ping lines in read_monitor_output removes the cause without loosening the check: the test still requires HSET followed by an HDEL of only the expired field. The harness already does the same in assert_replication_stream in tests/test_helper.tcl. The change is one condition in a helper used only by the two monitor tests in this block, so the sibling test 'HDEL replication includes only actually expired fields not non-existent ones' gets the same protection. Backport-Source-PR: 5437
The failure message shows the three monitor lines the test collected were "ping" (db 0, from the primary at 127.0.0.1:21641), HSET and HPEXPIREAT, so the pattern *HSET*myhash*f1*f2*f3*HDEL*myhash*f2* did not match. The ping is the one replicationCron() in src/replication.c feeds to replicas every repl-ping-replica-period, and a replica's MONITOR shows it. In this run it arrived at 09:22:14.885, right after the full sync finished and just before HSET. read_monitor_output filtered only INFO and SELECT lines, so the ping took a slot and the HDEL line was never read. A ping in the replication stream is correct server behaviour, and its timing relative to the test is not something the test controls, so this is a test bug. Skipping ping lines in read_monitor_output removes the cause without loosening the check: the test still requires HSET followed by an HDEL of only the expired field. The harness already does the same in assert_replication_stream in tests/test_helper.tcl. The change is one condition in a helper used only by the two monitor tests in this block, so the sibling test 'HDEL replication includes only actually expired fields not non-existent ones' gets the same protection. Backport-Source-PR: 5437
xdk-amz
left a comment
There was a problem hiding this comment.
LGTM. Skipping "ping" the same way assert_replication_stream does is the right fix, and it doesn't loosen the match: skipped lines don't take a slot, and none of the HSET/HDEL lines the tests check can contain "ping". Locally I forced a ping into the stream before the HSET: without this change both monitor tests fail with the same mismatch as CI, and with it both pass (plus 15 normal loops green).
Needs DCO
| # Skip lines with INFO commands | ||
| if {[regexp {\"info\"} $curr_read] || [regexp {\"SELECT\"} $curr_read]} { | ||
| # Skip lines with INFO and SELECT commands, and the pings the | ||
| # primary sends at regular intervals in the replication stream. |
There was a problem hiding this comment.
Nit: the ping in the CI failure is actually the one-off ping replicaStartCommandStream() sends right after the first full sync to move the offset off zero (it's in db 0), not the periodic one. The filter catches both, but the comment could say so, like assert_replication_stream does: "...and the pings the primary feeds into the replication stream, both the periodic ones and the one sent when a replica first comes online." Also, the # These tests are flaky, probably monitor output should be filtered comment at L4512 is now stale and could go in this PR.
There was a problem hiding this comment.
Agreed. The comment should cover the initial replicaStartCommandStream() ping too, and the stale "These tests are flaky" note at L4512 should go.
The failure message shows the three monitor lines the test collected were "ping" (db 0, from the primary at 127.0.0.1:21641), HSET and HPEXPIREAT, so the pattern *HSET*myhash*f1*f2*f3*HDEL*myhash*f2* did not match. The ping is the one replicationCron() in src/replication.c feeds to replicas every repl-ping-replica-period, and a replica's MONITOR shows it. In this run it arrived at 09:22:14.885, right after the full sync finished and just before HSET. read_monitor_output filtered only INFO and SELECT lines, so the ping took a slot and the HDEL line was never read. A ping in the replication stream is correct server behaviour, and its timing relative to the test is not something the test controls, so this is a test bug. Skipping ping lines in read_monitor_output removes the cause without loosening the check: the test still requires HSET followed by an HDEL of only the expired field. The harness already does the same in assert_replication_stream in tests/test_helper.tcl. The change is one condition in a helper used only by the two monitor tests in this block, so the sibling test 'HDEL replication includes only actually expired fields not non-existent ones' gets the same protection. Backport-Source-PR: 5437
madolson
left a comment
There was a problem hiding this comment.
Looks good. Needs DCO sign-off.
|
Suggested description, since it becomes the squash message: A replica's MONITOR shows the pings the primary feeds into the replication stream, both the periodic ones and the one sent when a replica first comes online. read_monitor_output in tests/unit/hashexpire.tcl only skipped INFO and SELECT, so a ping could take one of the three slots the two HDEL replication tests read and make them fail. Skip ping lines too, as assert_replication_stream in tests/test_helper.tcl already does. |
The agent's commits were made as valkeyrie-bot[bot], a name with no GitHub account behind it, and most had no DCO sign-off. Its own fixes and repair commits had none, and a backport kept only what its upstream commit carried: sometimes nothing, sometimes a sign-off under another email than its author's. The DCO check therefore fails on the sweep pull requests (valkey-io/valkey#5619, valkey-io/valkey#5499), on the CI-sweep pull requests (valkey-io/valkey#5441) and on the fixes opened into unstable (valkey-io/valkey#5437, valkey-io/valkey#5440, valkey-io/valkey#5443), and a maintainer has to override it. Every commit the agent makes is now committed and signed off by valkeyrie-ops[bot], the App that opens its pull requests. The identity and the sign-off line are in scripts/common/identity.py, and proc.set_commit_identity gives them to a clone. - A commit the agent writes (a CI fix, a sweep's repair commit, a revert, a release cut) has the App as its author. - A commit it cherry-picks (a backport, an upstream fix ported to a backport branch) keeps its author and its own sign-off, and gets the App's as its committer. The DCO check takes a sign-off from a commit's author or its committer. - An open sweep branch from before this is signed off once, the next time it is rebased. Other open pull requests keep their commits. The pull requests the CI-fix bot opens now say that their commit carries the bot's sign-off and that a maintainer adds their own before merging. Nothing checks for the maintainer's. The registry edit that onboards a release branch is unchanged: it is github-actions[bot]'s commit and is already signed off. Signed-off-by: Sarthak Aggarwal <[email protected]>
73a37e0 to
e412b3a
Compare
The failure message shows the three monitor lines the test collected were "ping" (db 0, from the primary at 127.0.0.1:21641), HSET and HPEXPIREAT, so the pattern *HSET*myhash*f1*f2*f3*HDEL*myhash*f2* did not match. The ping is the one replicationCron() in src/replication.c feeds to replicas every repl-ping-replica-period, and a replica's MONITOR shows it. In this run it arrived at 09:22:14.885, right after the full sync finished and just before HSET. read_monitor_output filtered only INFO and SELECT lines, so the ping took a slot and the HDEL line was never read. A ping in the replication stream is correct server behaviour, and its timing relative to the test is not something the test controls, so this is a test bug. Skipping ping lines in read_monitor_output removes the cause without loosening the check: the test still requires HSET followed by an HDEL of only the expired field. The harness already does the same in assert_replication_stream in tests/test_helper.tcl. The change is one condition in a helper used only by the two monitor tests in this block, so the sibling test 'HDEL replication includes only actually expired fields not non-existent ones' gets the same protection. Signed off on behalf of valkeyrie-ops[bot]. Signed-off-by: Sarthak Aggarwal <[email protected]>
e412b3a to
c95e750
Compare
* Sign off every commit the agent makes as valkeyrie-ops The agent's commits were made as valkeyrie-bot[bot], a name with no GitHub account behind it, and most had no DCO sign-off. Its own fixes and repair commits had none, and a backport kept only what its upstream commit carried: sometimes nothing, sometimes a sign-off under another email than its author's. The DCO check therefore fails on the sweep pull requests (valkey-io/valkey#5619, valkey-io/valkey#5499), on the CI-sweep pull requests (valkey-io/valkey#5441) and on the fixes opened into unstable (valkey-io/valkey#5437, valkey-io/valkey#5440, valkey-io/valkey#5443), and a maintainer has to override it. Every commit the agent makes is now committed and signed off by valkeyrie-ops[bot], the App that opens its pull requests. The identity and the sign-off line are in scripts/common/identity.py, and proc.set_commit_identity gives them to a clone. - A commit the agent writes (a CI fix, a sweep's repair commit, a revert, a release cut) has the App as its author. - A commit it cherry-picks (a backport, an upstream fix ported to a backport branch) keeps its author and its own sign-off, and gets the App's as its committer. The DCO check takes a sign-off from a commit's author or its committer. - An open sweep branch from before this is signed off once, the next time it is rebased. Other open pull requests keep their commits. The pull requests the CI-fix bot opens now say that their commit carries the bot's sign-off and that a maintainer adds their own before merging. Nothing checks for the maintainer's. The registry edit that onboards a release branch is unchanged: it is github-actions[bot]'s commit and is already signed off. Signed-off-by: Sarthak Aggarwal <[email protected]> * Pass the App's identity with each commit command A sweep commits in the clone its validation builds and tests in, and git took the committer, and the name `commit -s` signs with, from that clone's config, set once after cloning. A test that rewrote the config changed whose commit and sign-off the next one was. Every git command that commits now gets the identity in its environment (proc.commit_env), which git reads before any config, and a clone is no longer given one. A cherry-pick, a rebase and an amend still keep the commit's author. A CI fix written before the sign-offs keeps its unsigned commit when its CI-sweep branch is rebuilt. The docs now say so. Signed-off-by: Sarthak Aggarwal <[email protected]> --------- Signed-off-by: Sarthak Aggarwal <[email protected]>
Multiple expired hash fields are replicated as single HDEL command to replicafailed intest-sanitizer-undefined (clang)on9.1(run). No change onunstablefixes it. The fix made there applies here as it is: it is made here first, and backported to9.1once it merges.Root cause: The failure message shows the three monitor lines the test collected were "ping" (db 0, from the primary at 127.0.0.1:21641), HSET and HPEXPIREAT, so the pattern HSETmyhashf1f2f3HDELmyhashf2* did not match. The ping is the one replicationCron() in src/replication.c feeds to replicas every repl-ping-replica-period, and a replica's MONITOR shows it. In this run it arrived at 09:22:14.885, right after the full sync finished and just before HSET. read_monitor_output filtered only INFO and SELECT lines, so the ping took a slot and the HDEL line was never read. The failure is flaky.
The fix: A ping in the replication stream is correct server behaviour, and its timing relative to the test is not something the test controls, so this is a test bug. Skipping ping lines in read_monitor_output removes the cause without loosening the check: the test still requires HSET followed by an HDEL of only the expired field. The harness already does the same in assert_replication_stream in tests/test_helper.tcl. The change is one condition in a helper used only by the two monitor tests in this block, so the sibling test 'HDEL replication includes only actually expired fields not non-existent ones' gets the same protection.
What the bot checked
The fix applies to
unstableat180283c3f217, and was run there too.With the fix, this command passed 40 loops:
The agent's own notes
Nothing was run here. The default branch does not have this fix: none of the upstream commits to tests/unit/hashexpire.tcl listed in upstream-changes.md touches read_monitor_output, so it most likely shares the flake and needs the same change. None of the port candidates addresses it (they concern listpack encoding, COPY TTLs, FUNCTION RESTORE and expired field tracking), and the 9.0 bot commits in other-release-branches.md (ports of #4785 and #5092) do not touch this helper either, so there was no commit to follow. The existing comment above the tests saying they are flaky and that monitor output should probably be filtered was left in place to keep the diff minimal; a maintainer may want to drop it.
What the bot checked on
9.1Existing fixes found:
c80da010b57eListpack encoding for Hash field expiration (Listpack encoding for Hash field expiration #3212) (port candidate);caf5f2bfc20dDeflake COPY Preserves TTLs test under libc malloc (Deflake COPY Preserves TTLs test under libc malloc #4785) (port candidate);9c4c8739da2eApply the library load timeout to FUNCTION RESTORE (Apply the library load timeout to FUNCTION RESTORE #5181) (port candidate);45ec67c30745Fix HSETEX and HGETEX when the key is named "fields" (Fix HSETEX and HGETEX when the key is named "fields" #4945) (already ported as 4a3f130);7f72724dc2c9Fix untracked expired hash fields after listpack-to-hashtable conversion (Fix untracked expired hash fields after listpack-to-hashtable conversion #4894) (port candidate)Code checks your change: the build must pass and the failing test must run and pass, once and then looped (up to 40 loops, fewer when one loop is slow):
No change on the default branch was found to fix this failure, so this fix was written for this branch: the default branch does not have it.
With the fix, this command passed 40 loops:
Review: The log supports the diagnosis: the replica's MONITOR output began with a db 0 "ping" from the primary at 14.885400, the same millisecond the monitor client was accepted and just after the full sync finished at 14.884, so the ping took one of the three slots and the HDEL line was never read. One detail is not established: the full resync started at offset 0, so this ping may be the one replicaStartCommandStream() sends when the replication stream is empty, not the periodic replicationCron() one the author names. That does not change the verdict, because both are legitimate pings in the replication stream and the filter handles either. Skipping ping lines does not loosen the check, since the test still requires HSET followed by an HDEL of only the expired field, and no line it cares about contains "ping". It mirrors what assert_replication_stream in tests/test_helper.tcl already does. The change is one condition in a helper used only by the two monitor tests, the comment describes the code without history, and the author's 40 loops passed. A maintainer may want the comment to mention the initial ping as well, and to drop the stale 'These tests are flaky' note.
Prepared by the CI-fix bot, which never merges. This PR's CI and a maintainer's review decide. Its commit has no DCO sign-off: whoever takes the change over signs it off.