-
Notifications
You must be signed in to change notification settings - Fork 21
[MySQL] Automatic schema change handling #287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Rentacookie
wants to merge
48
commits into
main
Choose a base branch
from
feat/mysql-schema-change-handling
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
e5db119
Removed zongji type mappings which are now provided by the Zongji pac…
Rentacookie d03360e
Moved most of the binlog event handling logic to a separate BinlogLis…
Rentacookie 924ecd8
Updated the BinLogStream to use the new BinLogListener
Rentacookie 404dcde
Renamed BinlogListener to BinLogListener
Rentacookie b1b8c30
Added changeset
Rentacookie 16c1235
Merge branch 'main' into mysql-binlog-backpressure-handling
Rentacookie 126f9b3
Simplified BinLogListener stopping mechanism
Rentacookie a03260f
Corrected BinLogListener name.
Rentacookie e147318
Supply port for binlog listener connections.
Rentacookie 999a8dc
Only set up binlog heartbeat once the listener is fully started up.
Rentacookie 782b43c
Merge branch 'main' into mysql-binlog-backpressure-handling
Rentacookie 07201e8
Updated changeset
Rentacookie 079a2f5
Changed binlog backpressure mechanism to be based on processing queue…
Rentacookie 59afb33
Merge branch 'main' into mysql-binlog-backpressure-handling
Rentacookie 286ba16
Changed binlog backpressure mechanism to be based on processing queue…
Rentacookie 9a00b8b
Added optional columns field to SourceEntityDescriptor
Rentacookie 3aebffd
Cleanup unused imports
Rentacookie bf481c8
Ensure column values are preserved when available Report 0 storage me…
Rentacookie b673609
Added basic schema change handling for MySQL
Rentacookie f707e2b
Revert columns field addition to SourceEntityDescriptor
Rentacookie 74adb22
Added schema change handling for the MySQL binlog replication.
Rentacookie 1270939
Include powersync core version in metrics metadata
Rentacookie 7500bed
Code analysis cleanup
Rentacookie add2590
Merge branch 'main' into feat/mysql-schema-change-handling
Rentacookie 54e6a9d
Merge conflicts
Rentacookie a5582b1
Fixed parser import
Rentacookie d34f8fa
Fixed mysql->sqlite rows parsing that would filter out columns with n…
Rentacookie fa327ae
Cleaned up SchemaChange handling in BinLogListener
Rentacookie 1d1e945
Added schema change tests
Rentacookie dd0119a
Merge branch 'main' into feat/mysql-schema-change-handling
Rentacookie ce8cb9c
Change binlog event receive log message to debug
Rentacookie 2411f21
Revert and fix mysql->sqlite row conversion for null value columns
Rentacookie cd8ef3e
Added conditional skip of mysql schema test for syntax that does not …
Rentacookie 18e0865
Merge branch 'main' into feat/mysql-schema-change-handling
Rentacookie 3adea04
Fixed version checking for mysql 5.7 incompatible test
Rentacookie 79bd14e
Fix skip test on mysql 5.7 schema change
Rentacookie 81b437f
Reverted mysql dev docker compose
Rentacookie b8e631b
Moved schema change handling to processing queue
Rentacookie ac96801
Fixed bug where multiple zongji listeners could be started if multipl…
Rentacookie 301345c
Extended node-sql-parser type definitions
Rentacookie 3898db7
- Simplified schema change types
Rentacookie a339ec8
Removed unused constant
Rentacookie f472dd6
Merge branch 'main' into feat/mysql-schema-change-handling
Rentacookie 5df001b
Skip unsupported schema test for MySQL 5.7
Rentacookie 57fcfec
Added error handling for zongji emitted schema errors
Rentacookie e624081
Added changeset
Rentacookie 462e08d
Typo fixes from pr feedback
Rentacookie e9a6569
Merge branch 'main' into feat/mysql-schema-change-handling
Rentacookie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
'@powersync/service-module-postgres-storage': minor | ||
'@powersync/service-module-mongodb-storage': minor | ||
'@powersync/service-core-tests': minor | ||
'@powersync/service-module-postgres': minor | ||
'@powersync/service-module-mongodb': minor | ||
'@powersync/service-core': minor | ||
'@powersync/service-module-mysql': minor | ||
'@powersync/service-sync-rules': minor | ||
--- | ||
|
||
MySQL: | ||
- Added schema change handling | ||
- Except for some edge cases, the following schema changes are now handled automatically: | ||
- Creation, renaming, dropping and truncation of tables. | ||
- Creation and dropping of unique indexes and primary keys. | ||
- Adding, modifying, dropping and renaming of table columns. | ||
- If a schema change cannot handled automatically, a warning with details will be logged. | ||
- Mismatches in table schema from the Zongji binlog listener are now handled more gracefully. | ||
- Replication of wildcard tables is now supported. | ||
- Improved logging for binlog event processing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
export * from './check-source-configuration.js'; | ||
export * from './get-replication-columns.js'; | ||
export * from './get-tables-from-pattern.js'; | ||
export * from './schema-utils.js'; | ||
export * from './mysql-to-sqlite.js'; | ||
export * from './read-executed-gtid.js'; | ||
export * from './ReplicatedGTID.js'; |
44 changes: 0 additions & 44 deletions
44
modules/module-mysql/src/common/get-tables-from-pattern.ts
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rkistner I am not 100% sure if this is the correct place to fix it, but I found that without this, columns with null values would not be added to sqliterow and added to the storage.
There is a schema change test that adds a column that exposed that this might be a problem.