Skip to content
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

sessionctx/variable: set log bin #9310

Closed
wants to merge 7 commits into from

Conversation

yangwenmai
Copy link
Contributor

@yangwenmai yangwenmai commented Feb 14, 2019

What problem does this PR solve?

impl #9201

3.Support close or enable binlog by set log_bin

Check List

Tests

  • Unit test

Code changes

  • Has exported variable/fields change

@yangwenmai yangwenmai changed the title sessionctx/variable: set log bin [WIP]sessionctx/variable: set log bin Feb 14, 2019
@codecov-io
Copy link

codecov-io commented Feb 14, 2019

Codecov Report

Merging #9310 into master will decrease coverage by 0.0476%.
The diff coverage is 16.2162%.

@@               Coverage Diff                @@
##             master      #9310        +/-   ##
================================================
- Coverage   67.2278%   67.1801%   -0.0477%     
================================================
  Files           381        381                
  Lines         79839      79906        +67     
================================================
+ Hits          53674      53681         +7     
- Misses        21379      21434        +55     
- Partials       4786       4791         +5

@morgo
Copy link
Contributor

morgo commented Feb 14, 2019

I have a request for MySQL compatibility:

  • log_bin can work on a session/global basis
  • sql_log_bin should work on a session-only basis (sql_log_bin should not be available globally at all.. due to history).
  • Updates to one variable name should be reflected in the other variable (like an alias).

@zz-jason zz-jason added contribution This PR is from a community contributor. component/session labels Feb 15, 2019
@yangwenmai yangwenmai force-pushed the set_log_bin branch 2 times, most recently from 67f6b2b to cbd406a Compare February 21, 2019 00:10
@yangwenmai yangwenmai changed the title [WIP]sessionctx/variable: set log bin sessionctx/variable: set log bin Feb 21, 2019
@yangwenmai yangwenmai changed the title sessionctx/variable: set log bin *: support close or enable binlog by set log_bin Feb 21, 2019
@yangwenmai
Copy link
Contributor Author

@WangXiangUSTC PTAL

@yangwenmai yangwenmai changed the title *: support close or enable binlog by set log_bin sessionctx/variable: set log bin Feb 21, 2019
sessionctx/binloginfo/binloginfo.go Outdated Show resolved Hide resolved
sessionctx/binloginfo/binloginfo.go Outdated Show resolved Hide resolved
session/session.go Outdated Show resolved Hide resolved
@yangwenmai yangwenmai force-pushed the set_log_bin branch 3 times, most recently from e45e389 to 1a8b49d Compare March 16, 2019 00:05
@yangwenmai
Copy link
Contributor Author

@WangXiangUSTC PTAL

sessionctx/binloginfo/binloginfo.go Outdated Show resolved Hide resolved
sessionctx/binloginfo/binloginfo.go Show resolved Hide resolved
sessionctx/binloginfo/binloginfo.go Outdated Show resolved Hide resolved
@yangwenmai
Copy link
Contributor Author

@WangXiangUSTC PTAL

}
SetPumpsClient(client)
}
pumpsClientLock.RUnlock()
Copy link
Contributor

Choose a reason for hiding this comment

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

you means Unlock()?

} else {
var err error
client, err = CreatePumpsClient()
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

need unlock before return

var binlogCli *pumpcli.PumpsClient
var err error
if ShouldEnableBinlog() {
atomic.StoreUint32(&variable.ProcessGeneralLog, 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

why change this variable?

@yangwenmai yangwenmai force-pushed the set_log_bin branch 2 times, most recently from 41b30e4 to d8439ea Compare March 18, 2019 15:40
@WangXiangUSTC
Copy link
Contributor

@yangwenmai don't need support set log_bin now, I will close this pr. Thanks for your contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/session contribution This PR is from a community contributor.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants