dragonflydb / dragonflydb/dragonfly
test_heartbeat_eviction_propagation
Open
Nobody has claimed this yet.
failing-test
iouring
- Dominant language
- C++
- Stars
- 31.6k
- Forks
- 1.3k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 137
Description
Automated regression triage opened this issue.
- Test:
dragonfly/replication_specific_test.py::test_heartbeat_eviction_propagation[df_factory0] - Backend: iouring
- Commit: 05abfddc5d90733369aaa7f74526870e573653aa
- Run: https://github.com/dragonflydb/dragonfly/actions/runs/31883683950
- Marker: run/31883683950/attempt/1
Reason: AssertionError: assert equals failed
_______________ test_heartbeat_eviction_propagation[df_factory0] _______________
df_factory = Factory({})
async def test_heartbeat_eviction_propagation(df_factory):
master, [replica], c_master, [c_replica] = await setup_replication(
df_factory,
master_args={
"proactor_threads": 1,
"cache_mode": "true",
"maxmemory": "256mb",
"enable_heartbeat_eviction": "false",
},
replica_args={"proactor_threads": 1},
connect=False,
)
# fill the master to use about 233mb > 256mb * 0.9, which will trigger heartbeat eviction.
await c_master.execute_command("DEBUG POPULATE 233 size 1048576")
await start_replication(c_replica, master.port)
# now enable heart beat eviction
await c_master.execute_command("CONFIG SET enable_heartbeat_eviction true")
while True:
info = await c_master.info("stats")
evicted_1 = info["evicted_keys"]
time.sleep(2)
info = await c_master.info("stats")
evicted_2 = info["evicted_keys"]
if evicted_2 == evicted_1:
break
else:
print("waiting for eviction to finish...", end="\r", flush=True)
await check_all_replicas_finished([c_replica], c_master)
keys_master = await c_master.execute_command("keys *")
keys_replica = await c_replica.execute_command("keys *")
> assert set(keys_master) == set(keys_replica)
E AssertionError: assert equals failed
E 'size:206', 'size:206',
E 'size:207', 'size:207',
E 'size:208', 'size:208',
E 'size:209', 'size:209',
E 'size:21', 'size:21',
E 'size:210',
E 'size:212', 'size:212',
E 'size:213', 'size:213',
E 'size:214', 'size:214',
E 'size:215', 'size:215',
E 'size:216', 'size:216',
c_master = <redis.asyncio.client.Redis(<redis.asyncio.connection.ConnectionPool(<redis.asyncio.connection.Connection(db=0,usernam...tocol=2,host=localhost,port=40243,socket_connect_timeout=None,socket_keepalive=None,socket_keepalive_options=None)>)>)>
c_replica = <redis.asyncio.client.Redis(<redis.asyncio.connection.ConnectionPool(<redis.asyncio.connection.Connection(db=0,usernam...tocol=2,host=localhost,port=35731,socket_connect_timeout=None,socket_keepalive=None,socket_keepalive_options=None)>)>)>
df_factory = Factory({})
evicted_1 = 18
evicted_2 = 18
info = {'batch_read_commands_bytes': 0, 'batch_read_commands_total': 0, 'batch_write_commands_bytes': 0, 'batch_write_commands_total': 0, ...}
keys_master = ['size:222', 'size:18', 'size:163', 'size:186', 'size:24', 'size:57', ...]
keys_replica = ['size:222', 'size:18', 'size:163', 'size:186', 'size:24', 'size:57', ...]
master = :40243
replica = :35731
dragonfly/replication_specific_test.py:151: AssertionError
----------------------------- Captured stdout call -----------------------------
waiting for eviction to finish...
----------------------------- Captured stderr call -----------------------------
[2026-08-15 12:25:39,708: INFO/MainProcess] Starting /__w/dragonfly/dragonfly/build/dragonfly --proactor_threads=1 --cache_mode=true --maxmemory=256mb --enable_heartbeat_eviction=false --dbfilename= --noversion_check --vmodule=dragonfly_connection=1,db_slice=1,listener_interface=1,main_service=1,rdb_save=1,rdb_load=1,rep
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running dragonfly/replication_specific_test.py::test_heartbeat_eviction_propagation[df_factory0] with the iouring backend and the referenced commit. Read the setup_replication and eviction assertions in dragonfly/replication_specific_test.py, then trace why the master and replica key sets differ after heartbeat eviction. Done means the regression test passes with matching key sets.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python
- Domain
- databases, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100