julien-duponchelle / julien-duponchelle/python-mysql-replication

suggestion: little change about how log_file, log_pos works, improve readability of comment in BinLogStreamReader __init__()

Open
#513 0 comments 1 reaction 0 assignees View on GitHub
hacktoberfest
Dominant language
Python
Stars
2.4k
Forks
690
PR merge metrics
No merged PRs in 30d

Description

1.

In BinLogStreamReader __init__(), if log_file is specified by a user (which is not None), log_pos is not specified (which is None), __connect_to_stream() starts to send binlog events from the latest binlog file, not from the specified binlog file.

I want to modify __connect_to_stream() to send events from the specified binlog file, not events from the latest binlog file.


2.

I also want to improve readability of comment about some __init__() parameters: log_file, log_pos, resume_stream, and skip_to_timestamp, auto_position, is_mariadb.

for skip_to_timestamp, auto_position, is_mariadb: if skip_to_timestamp as true, but is_mariadb as true or auto_position as true, then skip_to_timesatmp does not work. skip_to_timestamp only works if skip_to_timestamp as true, auto_position as false, is_mariadb as false. users may expect skip_to_timestamp to work after only giving skip_to_timestamp True, actually it does not though.

for log_file and log_pos, for instance, about the same as the #1 case, users may expect __connect_to_stream() to send events from the latest binlog file, because they specified the binlog file, actually it does not though.


the #2 would be fine, but the #1 may affect users. so I opened this issue before submitting pull request.

Contributor guide

Open the contributing guide

Research direction

Start in BinLogStreamReader.__init__() and follow __connect_to_stream() to confirm how log_file is handled when log_pos is None. Review the comments for log_file, log_pos, resume_stream, skip_to_timestamp, auto_position, and is_mariadb. Done means the specified starting-file behavior is corrected and the parameter comments clearly document the skip_to_timestamp conditions.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, python
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.