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

Add startUpScriptVersion for pd spec #4379

Merged
merged 2 commits into from Jan 20, 2022
Merged

Conversation

july2993
Copy link
Contributor

What problem does this PR solve?

for version >= v.5.0.5, the nslookup version is changed in the image.

if nameserver in /etc/resolv.conf contains not only coredns cluster ip, PD pod will fail to start since the startup script use nslookup and the behavior of nslookup is different from general resolver.

ref: https://serverfault.com/a/398854
coredns/coredns#3835 (comment)

https://github.com/isc-projects/bind9/blob/808d0b07b00244de735be68ce85b2652e4e0efec/bin/dig/dighost.c#L4128-L4162

  if ((msg->rcode == dns_rcode_servfail && !l->servfail_stops) ||
(check_ra && (msg->flags & DNS_MESSAGEFLAG_RA) == 0 && l->recurse))

we will hit the check_ra&&。。 condition here, and nslookup will try the next nameserver, and the next nameserver will return NXDOMAIN(since it is not the coredns)

What is changed and how does it work?

support add startUpScriptVersion as v1 to use dig to wait dns can be
resolved:
...
pd:
startUpScriptVersion: "v1"
...

Code changes

  • Has Go code change
  • Has CI related scripts change

Tests

  • Manual test
  • deploy cluster using master version
  • upgrade operator as version of the PR
  • check will not trigger update of PD

  • set startUpScriptVersion as v1
  • check PD start success and startup script is using the v1

apply some invalid value

The TidbCluster "basic" is invalid: spec.pd.startUpScriptVersion: Unsupported value: "v11": supported values: "", "v1"

Side effects

  • Breaking backward compatibility
  • Other side effects:

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release Notes

Please refer to Release Notes Language Style Guide before writing the release note.


support add startUpScriptVersion as v1 to use dig to wait dns can be
resolved:
...
pd:
  startUpScriptVersion: "v1"
...
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jan 19, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • DanielZhangQD
  • csuzhangxc

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@july2993 july2993 requested review from csuzhangxc and removed request for handlerww January 19, 2022 09:40
@codecov-commenter
Copy link

codecov-commenter commented Jan 19, 2022

Codecov Report

Merging #4379 (3ffd0bf) into master (589a445) will increase coverage by 9.08%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master    #4379      +/-   ##
==========================================
+ Coverage   62.63%   71.72%   +9.08%     
==========================================
  Files         184      188       +4     
  Lines       19573    21960    +2387     
==========================================
+ Hits        12260    15750    +3490     
+ Misses       6167     5080    -1087     
+ Partials     1146     1130      -16     
Flag Coverage Δ
e2e 59.60% <50.00%> (?)
unittest 62.62% <50.00%> (-0.02%) ⬇️

Copy link
Contributor

@DanielZhangQD DanielZhangQD left a comment

Choose a reason for hiding this comment

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

LGTM

@DanielZhangQD
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 3ffd0bf

@ti-chi-bot ti-chi-bot merged commit ea8e787 into pingcap:master Jan 20, 2022
@july2993 july2993 deleted the dns branch January 20, 2022 03:24
ti-srebot pushed a commit to ti-srebot/tidb-operator that referenced this pull request Feb 15, 2022
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-1.2 in PR #4411

DanielZhangQD added a commit that referenced this pull request Feb 16, 2022
* cherry pick #4379 to release-1.2

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

* fix ci

Co-authored-by: july2993 <july2993@gmail.com>
Co-authored-by: DanielZhangQD <zhanghailong810@aliyun.com>
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.

None yet

6 participants