julien-duponchelle / julien-duponchelle/python-mysql-replication
AssertionError: Result length not requested length
- Dominant language
- Python
- Stars
- 2.4k
- Forks
- 690
- PR merge metrics
- No merged PRs in 30d
Description
mysql:8.0.25
mysql-replication:0.28
python:3.8
error:
/Users/tu/Desktop/daily_demo/venv/bin/python /Users/tu/Desktop/daily_demo/mysql_binlog.py
=== RotateEvent ===
Position: 4
Next binlog file: mysql-bin.000001
=== FormatDescriptionEvent ===
Date: 2022-04-08T15:33:35
Log position: 125
Event size: 98
Read bytes: 0
Traceback (most recent call last):
File "/Users/tu/Desktop/daily_demo/mysql_binlog.py", line 7, in
for binlogevent in stream:
File "/Users/tu/Desktop/daily_demo/venv/lib/python3.8/site-packages/pymysqlreplication/binlogstream.py", line 496, in fetchone
binlog_event = BinLogPacketWrapper(pkt, self.table_map,
File "/Users/tu/Desktop/daily_demo/venv/lib/python3.8/site-packages/pymysqlreplication/packet.py", line 136, in __init__
self.event = event_class(self, event_size_without_header, table_map,
File "/Users/tu/Desktop/daily_demo/venv/lib/python3.8/site-packages/pymysqlreplication/event.py", line 197, in __init__
self._read_status_vars_value_for_key(status_vars_key)
File "/Users/tu/Desktop/daily_demo/venv/lib/python3.8/site-packages/pymysqlreplication/event.py", line 262, in _read_status_vars_value_for_key
db = self.packet.read_string()
File "/Users/tu/Desktop/daily_demo/venv/lib/python3.8/site-packages/pymysqlreplication/packet.py", line 481, in read_string
char = self.read(1)
File "/Users/tu/Desktop/daily_demo/venv/lib/python3.8/site-packages/pymysqlreplication/packet.py", line 157, in read
return self.packet.read(size)
File "/Users/tu/Desktop/daily_demo/venv/lib/python3.8/site-packages/pymysql/protocol.py", line 74, in read
raise AssertionError(error)
AssertionError: Result length not requested length:
Expected=1. Actual=0. Position: 86. Data Length: 86
Process finished with exit code 1
Contributor guide
Research direction
Reproduce the failure with mysql_binlog.py using MySQL 8.0.25, mysql-replication 0.28, and Python 3.8. Start at pymysqlreplication/event.py:262 and follow the reads through pymysqlreplication/packet.py and PyMySQL's protocol.py. Done means the reported binlog stream no longer raises the length assertion for this setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, python
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100