Skip to content

auto-increment: change "continuous" to monotonic#3584

Merged
lilin90 merged 2 commits into
masterfrom
unknown repository
Aug 13, 2020
Merged

auto-increment: change "continuous" to monotonic#3584
lilin90 merged 2 commits into
masterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Aug 8, 2020

What is changed, added or deleted? (Required)

The AUTO_INCREMENT doc used the word "continuous" when it should be "monotonic". Continuous means "without any abrupt changes", i.e. at a constant rate (which could be up or down). Auto_increment is not really constant - since restarts could make values jump quite a bit. So could requesting a new batch of cached values.

Monotonic means "either never decreases or never increases". Which is the property it guarantees on a per-server basis.

The language will need version-specific changes because it says "30 thousand by default", but it needs to be 30 thousand explicitly for 2.1 which does not support AUTO_ID_CACHE.

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions): The file does not exist in the earlier three versions.
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Have version specific changes
  • Might cause conflicts

@ghost ghost requested a review from kolbe August 8, 2020 18:00
@ghost ghost added needs-cherry-pick-2.1 requires-version-specific-changes After cherry-picked, the cherry-picked PR requires further changes. status/PTAL This PR is ready for reviewing. labels Aug 8, 2020
Copy link
Copy Markdown
Contributor

@kolbe kolbe left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot
Copy link
Copy Markdown
Contributor

@kolbe,Thanks for your review. However, LGTM is restricted to Reviewers or higher roles.See the corresponding SIG page for more information. Related SIGs: docs(slack).

@ti-srebot
Copy link
Copy Markdown
Contributor

@kolbe, PTAL.

@lilin90 lilin90 self-requested a review August 13, 2020 03:07
Copy link
Copy Markdown
Member

@lilin90 lilin90 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 13, 2020
@lilin90 lilin90 added requires-followup This PR requires a follow-up task after being merged. and removed needs-cherry-pick-2.1 labels Aug 13, 2020
@lilin90
Copy link
Copy Markdown
Member

lilin90 commented Aug 13, 2020

@nullnotnil I suggest updating v3.1, v3.0, v2.1 in another PR. That would be easier.

@lilin90 lilin90 merged commit f6a4c02 into pingcap:master Aug 13, 2020
ti-srebot pushed a commit to ti-srebot/docs that referenced this pull request Aug 13, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Copy Markdown
Contributor

cherry pick to release-4.0 in PR #3647

ghost pushed a commit that referenced this pull request Aug 13, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

Co-authored-by: Null not nil <67764674+nullnotnil@users.noreply.github.com>
@ghost
Copy link
Copy Markdown
Author

ghost commented Aug 13, 2020

It looks like the auto-increment docs are not present in 3.1 and below. They are still relevant, but if nobody has requested docs for it yet - I will leave it at this PR + the 4.0 cherry pick.

@TomShawn TomShawn added the translation/doing This PR's assignee is translating this PR. label Aug 13, 2020
@lilin90 lilin90 removed the requires-followup This PR requires a follow-up task after being merged. label Aug 13, 2020
@lilin90
Copy link
Copy Markdown
Member

lilin90 commented Aug 13, 2020

It looks like the auto-increment docs are not present in 3.1 and below. They are still relevant, but if nobody has requested docs for it yet - I will leave it at this PR + the 4.0 cherry pick.

@nullnotnil I think that's ok.

@ghost ghost deleted the update-auto-inc branch August 24, 2020 19:48
@TomShawn TomShawn added translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. and removed translation/doing This PR's assignee is translating this PR. labels Sep 8, 2020
@tangenta
Copy link
Copy Markdown
Contributor

tangenta commented Sep 9, 2020

@nullnotnil Hi, I think the concept "monotonic" has been explained in the increment part.

This section does illustrate the "continuous" feature:

create table t (a int primary key AUTO_INCREMENT);
insert into t values (), (), (), ();
select * from t;
+---+
| a |
+---+
| 1 |
| 2 |
| 3 |
| 4 |
+---+

@ghost
Copy link
Copy Markdown
Author

ghost commented Sep 9, 2020

@nullnotnil Hi, I think the concept "monotonic" has been explained in the increment part.

This section does illustrate the "continuous" feature:

create table t (a int primary key AUTO_INCREMENT);
insert into t values (), (), (), ();
select * from t;
+---+
| a |
+---+
| 1 |
| 2 |
| 3 |
| 4 |
+---+

Thanks! I will attempt another PR to merge the two. It is better not to call it "continuous" still, because a user might rely on that behavior incorrectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires-version-specific-changes After cherry-picked, the cherry-picked PR requires further changes. status/LGT1 Indicates that a PR has LGTM 1. status/PTAL This PR is ready for reviewing. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants