Comments (12)
also, be informed that BinlogClient doesn't support reconnecting right now. I need some time to think about how to implement keep-alive feature properly
from mysqlcdc.
Hi,
Currently, it doesn't.
You could use FromGtid() method for GTID-based replication but currently, it doesn't implement GtidSet
Are you talking about a simple master-slave replication cluster configured manually or a complex tool like Galera Cluster for master-master replication and automatic failover?
from mysqlcdc.
The second. I want to be highly available.
from mysqlcdc.
In theory, GTID is designed for replication with failovers and allows to support multi-master setup.
I am going to implement GtidSet for MySQL 5.6+ later this week or by the end of the month.
But I have no idea how to integrate it with custom coordination software like Galera Cluster.
from mysqlcdc.
Hi,
I'm working on the task(GtidSet for MySQL 5.6-8.0).
I think it will be ready in two days.
If you need MariaDB let me know(as the fork has different Gtid list implementation)
from mysqlcdc.
For now,I only use MySQL.
It would be very helpful if it supports GtidSet.
from mysqlcdc.
Sorry,
still working on the task
from mysqlcdc.
Hi again,
I just finished GtidSet.
To properly support cluster replication failover please make sure you understand:
- GtidSet concept as well as
@@gtid_purged
and@@gtid_executed
. - Gtid replication
- Semy-sync replication mode that guarantees reliability.
So, BinlogClient
keeps the current replication state in the State
property and updates it on every transaction commit or rollback(see Q&A in the readme). It updates binlog filename, position and the GtidSet in Gtid mode. Think of BinlogClient as a slave whose @@gtid_executed is stored in State
and updated when each transaction is replicated.
Note: In order to guarantee consistency, the State
is updated only after your event callback was called and didn't throw an exception. Otherwise, your derived database(Elasticsearch, Redis) could end up in an inconsistent state.
In case of failover, you get the current position from State.GtidState
and connect to the new master
using the position as the starting point in FromGtid
.
And as I mentioned above, I have no idea how to integrate the library with orchestration software that performs failover & switchover automatically(like Galera, or other tools that elect the new master and tell other replicas to switch to it)
from mysqlcdc.
Excellent!
I have a question about whether the replication state of BinlogClient
can be persisted directly so that BinlogClient
can be restored to its previous state after being restarted.
from mysqlcdc.
yes, State.GtidState.ToString()
constructs string representation that you can parse GtidSet.Parse()
from mysqlcdc.
Hi, you just said
the State is updated only after your event callback was called and didn't throw an exception.
Can I just assume that when I throw an exception in the callback, the replication will retry?
from mysqlcdc.
Hi,
Basically, this behavior is designed to retry replication from the last failed position.
But as I mentioned before, retry(keep-alive) is not implemented right now, you should manually call again ReplicateAsync. This way replication will restart from the last committed State
(which was updated after last successful client callback).
from mysqlcdc.
Related Issues (20)
- support for binlog-do-db/binlog-ignore-db HOT 6
- There is a question about missing transactions HOT 13
- How to get the cells column name? HOT 8
- hope to support semi-sync-replication HOT 4
- MaxScale BinLog Server compatibility like maxwell discussion HOT 1
- Empty VARCHAR data column value and JSON data column inner string field value is parsed as null out of MySQL binlog. HOT 12
- Implement v2.0
- no UpdateRowsEvent\DeleteRowsEvent only QueryEvent HOT 2
- Is it possible to get the logs for a specific table? HOT 7
- [Question] TableMapEvent.TableMetaData.ColumnNames returns null HOT 7
- update row event,but ColumnsPresentBeforeUpdate and ColumnsPresentAfterUpdate is same ? HOT 2
- Could not receive a master heartbeat within the specified interval HOT 3
- binlog_row_metadata existence HOT 1
- Add support for USER_VAR_EVENT
- TableMetadata.ColumnNames is null HOT 2
- can't find TableId from INFORMATION_SCHEMA.TABLES. HOT 2
- Support Event To Detect Column Changes For Mysql:5.7 HOT 7
- Parsing opaque values in JSON
- Implement SSL strategies HOT 3
- use Production Environment HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mysqlcdc.