Skip to content

Support Percona MySQL 8 #13

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
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pparshin
Copy link

This MR updates mysql submodule, fixes some compilation/linking errors

@Totktonada
Copy link
Member

To be honest, it is hard to review due to lots of code style changes. I would extract them into a separate commit(s).

@pparshin
Copy link
Author

@Totktonada, reverted code style changes

@ligurio
Copy link
Member

ligurio commented Sep 22, 2020

@ParshinPavel, we are fixed CI in a master. Could you rebase your patch?

@pparshin
Copy link
Author

@ligurio, done

@ligurio
Copy link
Member

ligurio commented Sep 23, 2020

@ParshinPavel I still see changes for Travis in your patch - https://patch-diff.githubusercontent.com/raw/tarantool/libslave/pull/13.patch And GH also warns about conflicts in this PR (see at the bottom of PR page).

@pparshin
Copy link
Author

@ligurio , i have no idea why github generates patch including all commits. If you open tab "Files changed", you see the real diff.
And i don't see any unresolved confilcts.

image

If you wish, I can just squash all commits and force push

@ligurio
Copy link
Member

ligurio commented Sep 23, 2020

@ParshinPavel perhaps that happens because you did a merge and not a rebase: see commits in your own branch - https://github.com/ParshinPavel/libslave/commits/support-mysql8 You should drop your travis-related commits from a branch and then push updated commits with --force. See documentation: https://git-scm.com/docs/git-rebase

@pparshin pparshin force-pushed the support-mysql8 branch 3 times, most recently from 5c10617 to 3b9d523 Compare October 7, 2020 09:08
@pparshin
Copy link
Author

pparshin commented Oct 7, 2020

Hope it's better now

@ligurio ligurio self-requested a review October 8, 2020 09:23
Copy link
Member

@ligurio ligurio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is definitely better, thank you!

I have some comments regarding your changes. Please check them inline and below:

  • You have mixed several changes in a single commit (formatting changes in .travis.yml and CMakeLists.txt, changes in a build infrastructure and changes related to support of Percona 8). It's a bad practice. I would ask you to split changes for a several commits and probably remove formatting changes when you don't need to change code (although it's up to you).
  • You have bumped a submodule version to a branch with 8th version. I'm not sure it's a good idea. I would ask you to stick module to a fixed tag or commit to have predictable result each time when we will rebuild library.
    We can stick it to a commit of a latest tag in 8th series:
$ git tag | grep Percona-Server-8.0 | tail -1
Percona-Server-8.0.20-11
$ git rev-list -n 1 Percona-Server-8.0.20-11
5b5a5d2584af8e47a66248218be0288164a69cb7

@@ -41,7 +41,7 @@ before_install:
before_script:
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release ..
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not related to PR with Percona 8 support. Please remove it.

@ligurio ligurio self-requested a review October 8, 2020 10:17
@Totktonada
Copy link
Member

This raises the question: can we support different mysql versions in future? How about mariadb? Can we support different versions in one build with appropriate runtime checks?

@ligurio
Copy link
Member

ligurio commented Oct 8, 2020

@Totktonada

This raises the question: can we support different mysql versions in future? How about mariadb? Can we support different versions in one build with appropriate runtime checks?

MariaDB has incompatible replication protocol [1]. It was never supported in libslave. If you (or any user) wants MariaDB support
then create a ticket about it.

  1. https://mariadb.com/kb/en/mariadb-vs-mysql-compatibility/#replication-compatibility

@@ -117,7 +117,7 @@ const char* Field_decimal::unpack(const char *from)
int value_length = decimal_string_size(&dec);
char buffer[ value_length ];

if (::decimal2string(&dec, (char*)&buffer, &value_length, zerofill ? precision : 0, scale, '0') != E_DEC_OK) {
if (::decimal2string(&dec, (char*)&buffer, &value_length, zerofill ? precision : 0, scale) != E_DEC_OK) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are at least two supported versions of MySQL: 5.7 and 8.0 [1] [2]. This change will add compatibility with 8.x and will broke compatibility with 5.7. Perhaps we need to introduce a compilation flag (for example MYSQL57, MYSQL80) and pass it to cmake before a build.

  1. https://www.mysql.com/support/supportedplatforms/database.html
  2. https://www.percona.com/services/policies/percona-software-support-lifecycle

-DCMAKE_BUILD_TYPE=Release
-DDISABLE_SHARED=1
-DENABLED_PROFILING=0
-DWITHOUT_SERVER=1
-DWITH_CLIENT_PROTOCOL_TRACING=0
-DWITH_DEFAULT_FEATURE_SET=0
-DWITH_SSL=bundled
-DWITH_SSL=system
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the reasons to change it?

mysqlclient_build
WORKING_DIRECTORY ${MYSQL_BIN}
DEPENDS mysql_configure
COMMAND ${CMAKE_COMMAND} --build . --target perconaserverclient
binlogevents_build
WORKING_DIRECTORY ${MYSQL_BIN}
DEPENDS mysql_configure
COMMAND ${CMAKE_COMMAND} --build . --target binlogevents_static
)

ADD_CUSTOM_TARGET (
binlogevents_build
WORKING_DIRECTORY ${MYSQL_BIN}
DEPENDS mysql_configure
COMMAND ${CMAKE_COMMAND} --build . --target binlogevents_static
mysql_client_build
WORKING_DIRECTORY ${MYSQL_BIN}
DEPENDS binlogevents_build
COMMAND ${CMAKE_COMMAND} --build . --target perconaserverclient
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems it's a formatting change and it is not related to Percona 8 support. Please remove it.

ADD_LIBRARY (slave ${LINK_TYPE} ${SRC})
TARGET_LINK_LIBRARIES (slave ${MYSQL_LIBS} -lpthread)
TARGET_LINK_LIBRARIES (slave PUBLIC libmysql ssl crypto Threads::Threads m rt dl)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the reasons to remove MYSQL_LIBS here?

START_5_7_ENCRYPTION_EVENT = 159,

MARIA_EVENTS_BEGIN = 160,

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libslave has a unit test (test/unit_test.cpp) that covers different types of events. It would be good to add new testcases for a new event types.

@@ -381,6 +381,9 @@ bool read_log_event(const char* buf, uint event_len, Basic_event_info& bei, Even
case TRANSACTION_CONTEXT_EVENT:
case VIEW_CHANGE_EVENT:
case XA_PREPARE_LOG_EVENT:
case PARTIAL_UPDATE_ROWS_EVENT:
case START_5_7_ENCRYPTION_EVENT:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like event MYSQL_END_EVENT added to slave_log_event.h is missed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants