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

pump/* add a api to get binlog by ts #449

Merged
merged 2 commits into from
Jan 24, 2019
Merged

pump/* add a api to get binlog by ts #449

merged 2 commits into from
Jan 24, 2019

Conversation

july2993
Copy link
Contributor

What problem does this PR solve?

add a api to get binlog by ts for debug
issue: https://internal.pingcap.net/jira/browse/TOOL-794

What is changed and how it works?

/debug/binlog/ to display the binlog info

Check List

Tests

  • Manual test (add detailed scripts or steps below)
    query the api by some ts
tp:Commit start_ts:405815340898189313 commit_ts:405815340898189314 prewrite_key:"mDDLJobHi\377story\000\000\000\374\000\000\000\000\000\000\000H" ddl_query:"create table a(id int)" ddl_job_id:32
start_ts:405815381361688577 prewrite_key:"t\200\000\000\000\000\000\000\037_r\200\000\000\000\000\000\000\006" prewrite_value:"\010\020\022\014\010\037\022\006\010\014\010\002\010\0028\000"
 PrewriteValue:
schema_version:16 mutations:<table_id:31 inserted_rows:"\010\014\010\002\010\002" sequence:Insert >

pump/server.go Outdated
tsStr := mux.Vars(r)["ts"]
ts, err := strconv.ParseInt(tsStr, 10, 64)
if err != nil {
w.Write([]byte("wrong ts param"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

invalid parameter ts

@july2993
Copy link
Contributor Author

@GregoryIan PTAL

@IANTHEREAL
Copy link
Collaborator

LGTM

@july2993
Copy link
Contributor Author

@WangXiangUSTC PTAL

@WangXiangUSTC
Copy link
Contributor

I think it's hard to know the commit ts when we debug, can we select by range?

@july2993
Copy link
Contributor Author

I think it's hard to know the commit ts when we debug, can we select by range?

ts is a key point, we just want to dump the specified ts binlog.
but we can add a another api using the PullCommitBinlog for your use case, but don't change the PullComitBinlog api, you can just cancel the context when you get enough binlogs you want

@WangXiangUSTC
Copy link
Contributor

I mean we may can't get the ts information when we debug, need get binlog by range.

Copy link
Contributor

@WangXiangUSTC WangXiangUSTC left a comment

Choose a reason for hiding this comment

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

LGTM

@july2993 july2993 merged commit 9cc779b into master Jan 24, 2019
@july2993 july2993 deleted the hjh/pump_get_binlog branch January 24, 2019 05:14
july2993 added a commit that referenced this pull request Jan 24, 2019
* pump/* add a api to get binlog by ts
july2993 added a commit that referenced this pull request Jan 24, 2019
* pump/* add a api to get binlog by ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants