powersync-ja / powersync-service

Other
123 stars 9 forks source link

MySQL Type Consolidation #115

Closed Rentacookie closed 1 day ago

Rentacookie commented 5 days ago

This changeset addresses some issues which were found during further testing of the MySQL alpha release:

Type Discrepancies:

Some differences in the values read from the MySQL replication stream and values read directly from the database during snapshots were detected. These mismatches were addressed by consolidating the type handling into in the powersync service only. Previously some type mappings were already happening upstream in the Zongji Binlog Listener.

Duplicate ServerIds:

MySQL expects replication clients to have unique ServerIds. Previously we were using the default value of 1. This proved to be a problem when deploying new sync rules since for a brief time both the old and the new replication were active causing one of the replication instances to throw an error. This was resolved by generating a random ServerId on startup based off of the current syncRuleId. Since we use GTID based replication and keep track of our position in the binlog ourself, it doesn't matter that the serverId changes regularly.

Enabled unit tests in CI:

Added the configuration so that the MySQL unit tests run as part of the build.

changeset-bot[bot] commented 5 days ago

🦋 Changeset detected

Latest commit: 04b0fdda44814d855b6e1800857f9266a4b7ad44

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | ------------------------------- | ----- | | @powersync/service-module-mysql | Minor | | @powersync/service-image | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Rentacookie commented 1 day ago

Thanks for the review guys 🙏