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

"tiup mirror clone _ nightly" does not download the actual nightly version of pump/drainer/br/dm/lightning etc. #1108

Closed
kennytm opened this issue Jan 28, 2021 · 3 comments · Fixed by #1128
Labels
type/bug Categorizes issue as related to a bug.
Milestone

Comments

@kennytm
Copy link

kennytm commented Jan 28, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?

First, clone the tiup mirror following https://docs.pingcap.com/tidb/dev/production-offline-deployment-using-tiup:

tiup mirror clone mirror2 nightly -o linux -a amd64

Then, get a list of components with nightly version but not properly filled in:

cd mirror2
grep -l '"nightly":"".*-nightly-' *.json
  1. What did you expect to see?

Empty list

  1. What did you see instead?
$ grep -l '"nightly":"".*-nightly-' *.json
267.dmctl.json
270.dm-worker.json
271.dm-master.json
446.dumpling.json
479.br.json
519.tidb-lightning.json
578.drainer.json
587.pump.json
590.pd-recover.json
  1. What version of TiUP are you using (tiup --version)?
$ tiup --version
v1.3.2 tiup
Go Version: go1.13
Git Branch: release-1.3
GitHash: 2d88460

The reason we get this is because #271 is incomplete.

// Some components version binding to TiDB
coreSuites := set.NewStringSet("tidb", "tikv", "pd", "tiflash", "prometheus", "grafana", "ctl", "cdc")

// Some TiUP components won't be bound version with TiDB, if cannot find
// selected version we download the latest version to as a alternative
if !found && !coreSuites.Exist(manifest.ID) {
// Use the latest stable versionS if the selected version doesn't exist in specific platform

Pump, Drainer, BR, DM and Lightning are not listed as a coreSuites, so when encountering the pseudo-version "nightly", it enters the branch in line 434 and get the latest stable version instead (v5.0.0-rc). This in turn yanks the true nightly version, and set the "nightly" field in the manifest to empty. So when we deploy a nightly cluster containing binlog using this local mirror, it fails with "component not found" error.

...
2021-01-29T01:37:13.252+0800    DEBUG   TaskFinish      {"task": "Download: component=drainer, version=nightly, os=linux, arch=amd64", "error": "version nightly on linux/amd64 for component drainer not found"}
2021-01-29T01:37:13.252+0800    DEBUG   TaskFinish      {"task": "Download: component=drainer, version=nightly, os=linux, arch=amd64", "error": "version nightly on linux/amd64 for component drainer not found"}
2021-01-29T01:37:13.257+0800    DEBUG   TaskFinish      {"task": "Download: component=pump, version=nightly, os=linux, arch=amd64", "error": "version nightly on linux/amd64 for component pump not found"}
2021-01-29T01:37:13.257+0800    DEBUG   TaskFinish      {"task": "Download: component=pump, version=nightly, os=linux, arch=amd64", "error": "version nightly on linux/amd64 for component pump not found"}
...

This bug can be worked-around by specifying the exact nightly version (e.g. using v5.0.0-nightly-20210128 instead of nightly everywhere).

@kennytm kennytm added the type/bug Categorizes issue as related to a bug. label Jan 28, 2021
@lucklove
Copy link
Member

lucklove commented Feb 4, 2021

I think it's not a good idea to clone nightly because many components don't have nightly version...

And I'm sure you can't run the single command tiup tidb at all because there is no stable version in that package.

@kennytm
Copy link
Author

kennytm commented Feb 4, 2021

The bug here is that components that do have nightly version aren't using nightly due to the whitelist. In particular this breaks pump/drainer cluster when using a mirror of nightly version.

@lucklove
Copy link
Member

lucklove commented Feb 5, 2021

The bug here is that components that do have nightly version aren't using nightly due to the whitelist. In particular this breaks pump/drainer cluster when using a mirror of nightly version.

For each mirror and each component, tiup need at least one stable version for that component (the component could be pre release but not nightly only). So clone nightly (even with v5.0.0-nightly-20210128) will result to a not working mirror.

The bug exists because we did't consider that someone will try to clone a nightly package, maybe we should forbid cloning nightly rather than support it?

BTW, what's your use case to clone a nightly version? Maybe we can find some way else.

lucklove added a commit to lucklove/tiup that referenced this issue Feb 5, 2021
@lucklove lucklove added this to the v1.3.3 milestone Feb 5, 2021
lucklove added a commit to lucklove/tiup that referenced this issue Feb 22, 2021
ti-chi-bot added a commit that referenced this issue Feb 22, 2021
…version (#1128)

* Fix the issue that the default selected version may be a preprelease version

Close #1119

Partly fix #1082

* Add test

* Test

* Fix nightly

* Fix test

* Fix nightly clone

Close #1108

Co-authored-by: Ti Chi Robot <71242396+ti-chi-bot@users.noreply.github.com>
lucklove added a commit to lucklove/tiup that referenced this issue Mar 4, 2021
…version (pingcap#1128)

* Fix the issue that the default selected version may be a preprelease version

Close pingcap#1119

Partly fix pingcap#1082

* Add test

* Test

* Fix nightly

* Fix test

* Fix nightly clone

Close pingcap#1108

Co-authored-by: Ti Chi Robot <71242396+ti-chi-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Categorizes issue as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants