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

fix(upgrade): check commit SHA to find running dgraph version #8923

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dgraphtest/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ func AllUpgradeCombos() []UpgradeCombo {
}

mainCombos := []UpgradeCombo{
{"v23.0.1", "local", BackupRestore},
{"v23.0.1", "local", InPlace},
{"v23.0.1", localVersion, BackupRestore},
{"v23.0.1", localVersion, InPlace},
}

if os.Getenv("DGRAPH_UPGRADE_MAIN_ONLY") == "true" {
Expand Down
4 changes: 2 additions & 2 deletions dgraphtest/local_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -781,15 +781,15 @@ func (c *LocalCluster) checkDgraphVersion(containerID string) error {
if err != nil {
return errors.Wrapf(err, "error during checkDgraphVersion for container [%v]", containerID)
}
index := strings.Index(contLogs, "Dgraph version : ")
index := strings.Index(contLogs, "Commit SHA-1 : ")
running := strings.Fields(contLogs[index : index+70])[3] // 70 is arbitrary
chash, err := getHash(c.GetVersion())
if err != nil {
return errors.Wrapf(err, "error while getting hash for %v", c.GetVersion())
}
rhash, err := getHash(running)
if err != nil {
return errors.Wrapf(err, "error while getting hash for %v", c.GetVersion())
return errors.Wrapf(err, "error while getting hash for %v", running)
}
if chash != rhash {
return errors.Errorf("found different dgraph version than expected [%v]", c.GetVersion())
Expand Down