-
Notifications
You must be signed in to change notification settings - Fork 442
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
Implement #372: Support session state tracking for GTIDs, schema, variables, TX state #373
Conversation
Please support other than SESSION_TRACK_GTIDS too. |
Hello, @methane. For whatever reason, I did not receive a notification of your reply. I will reload this page more often so that I don't miss any more notifications. Apologies for that. I want to make sure I understand your comment correctly. First, are you a contributor on this project, asking me to make a change before you'll accept this for merging? If so:
|
Yes, I am the only active maintainer of this project.
I have no plan to use this feature. My only concern is exposing the underlying API to users. |
Okay. I'll make these changes today/this weekend and update the pull request this weekend. Thanks for the review! Less back-and-forth this way. :-) |
…ma, variables, TX state Add several methods and two new types for session state tracking: - `session_state_changed` indicates whether session state has changed - `get_session_gtids` returns a list of GTIDs created by the just-committed transaction, if applicable - `get_session_new_schema` returns the new schema, if the schema changed - `get_session_changed_variables` returns any changed session variables, if any - `get_session_transaction_state` returns the transaction state, if any and available - `get_session_transaction_characteristics` returns the transaction characteristics, if any and available
fed53c9
to
be77e9d
Compare
Codecov Report
@@ Coverage Diff @@
## master #373 +/- ##
==========================================
+ Coverage 86.59% 87.15% +0.55%
==========================================
Files 12 13 +1
Lines 1537 1557 +20
==========================================
+ Hits 1331 1357 +26
+ Misses 206 200 -6
Continue to review full report at Codecov.
|
@methane: I have updated the pull request to support all facets of session tracking and to use |
Oh, I didn't mean adding bunch of APIs. I meant: infos = conn.get_session_track_info(MySQLdb.constants.session_state_type.SESSION_TRACK_GTIDS) Only one method is needed. |
Well, I looked at doing it that way, but the problem is that the session track info you get is all so different. Some of it is in different data formats than others. For some of it, you call In my opinion, that's all just two different to put in one method called There is another option that would be a fairly easy change and wouldn't muddy up the interface for |
I'm sorry but please notice I don't want to review and maintain much code I never use. I want to minimize the maintenance cost of this project.
What's wrong about
It looks no problem.
What is the problem of just returning list? |
I can understand that, but I hope you can likewise keep in mind that literally thousands of other projects use this library, and I'm trying to contribute the best-quality enhancement I can, not just the barest-metal enhancement I can. I am happily volunteering to maintain this specific contribution and fix any bugs that arise from it. I know maintaining open source software is hard, and I would not contribute this and then abandon it and expect you to maintain it in perpetuity. That's the spirit of open source software. :-)
It is a problem because it's not just about returning a list. It's about knowing whether to call just |
Of course. And you can keep in mind that most of the thousands of projects using this library doesn't need this feature.
Except DB-API 2.0 interface, I want to keep this library is "binding" of the libmysqlclient. So "barest-metal" is OK to me.
Caller must know the type of session track info. |
163bf70
to
200b4a8
Compare
I close this because I don't want to maintain this code forever. |
Add several methods and two new types for session state tracking:
session_state_changed
indicates whether session state has changedget_session_gtids
returns a list of GTIDs created by the just-committed transaction, if applicableget_session_new_schema
returns the new schema, if the schema changedget_session_changed_variables
returns any changed session variables, if anyget_session_transaction_state
returns the transaction state, if any and availableget_session_transaction_characteristics
returns the transaction characteristics, if any and availableManual testing output: