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

Sync of PD timestamps and timestamps computed when resolving a lock for parallel commit #21

Closed
nrc opened this issue Jun 18, 2020 · 5 comments
Assignees
Labels
question Further information is requested T-async-commit Topic: async commit

Comments

@nrc
Copy link
Collaborator

nrc commented Jun 18, 2020

@MyonKeminta believes there will be problems if and only if the computed ts is > PD's latest ts + 1. I'm not clear on the concrete problems this causes or if/how they can be mitigated.

@nrc nrc added question Further information is requested T-async-commit Topic: async commit labels Jun 18, 2020
@nrc
Copy link
Collaborator Author

nrc commented Jun 18, 2020

This is not a problem if we only use timestamps from PD as read ts, but might be a problem due to conflict_for_update_ts.

@sticnarf
Copy link
Contributor

sticnarf commented Jun 18, 2020

A simple workaround is recording whether a timestamp is allocated from PD or calculated. We can limit deriving a timestamp from a calculated timestamp.
In other words, if conflict_for_update_ts is a calculated timestamp, TiDB gets a new timestamp from PD and retry reading.

However, if the workload is to update the same key frequently, up to half of transactions need to get timestamps from PD, which makes performance a bit worse.

@MyonKeminta
Copy link
Contributor

@sticnarf I think we do not have any other better solution. We can adopt this solution for now, and in the scenario you said maybe it's better to disable parallel commit.

@youjiali1995
Copy link
Contributor

Agree.

@nrc
Copy link
Collaborator Author

nrc commented Sep 3, 2020

This is currently not a bug in the implementation, but is something we should bear in mind for future optimisations.

@nrc nrc closed this as completed Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested T-async-commit Topic: async commit
Projects
None yet
Development

No branches or pull requests

4 participants