-
Notifications
You must be signed in to change notification settings - Fork 10
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
Changes in the installer script and the voyager code to upgrade golang version from 1.20 to 1.23.1 #1717
Conversation
installer_scripts/install-yb-voyager
Outdated
if [[ $version_ok -eq 1 ]] | ||
then | ||
output "Found golang=${gov}" | ||
return | ||
fi | ||
fi | ||
export GOROOT="/tmp/go" | ||
GO_VERSION="go1.20" | ||
GO_VERSION="go1.23.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShivanshGahlot, I think you should also include the changes in the code base required for upgrading in the same PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have included those changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShivanshGahlot please go through the change log of 1.23 release once.
Look at major changes - bug fixes, support for some new coding syntax removed/added.
Performance aspects etc...
Overall you can look from two perspective:
- If some existing syntax/feature got affected/unsupported.
- If some thing is new can make code better.
For the later you can create tickets, but 1 will be required in this PR.
Also please run tests including - gh, jenkins, and Perf tests for verification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM,
Change the PR title to mention that its upgrade for 1.23.1
not just installing.
Please wait till tomorrow for others to take a look also before merging.
@@ -36,5 +36,5 @@ jobs: | |||
- name: Run staticcheck | |||
run: | | |||
cd yb-voyager | |||
go install honnef.co/go/tools/cmd/staticcheck@2023.1.7 | |||
go install honnef.co/go/tools/cmd/staticcheck@2024.1.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mention in the description that this is also updated and reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
slices.SortFunc(allTables, func(a, b sqlname.NameTuple) int { | ||
if a.ForKey() < b.ForKey() { | ||
return -1 // a is less than b | ||
} else if a.ForKey() > b.ForKey() { | ||
return 1 // a is greater than b | ||
} | ||
return 0 // a is equal to b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why was it required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They have changed the syntax. The sorting function now needs to return int instead of boolean:
https://pkg.go.dev/slices#SortFunc
…g version from 1.20 to 1.23.1 (#1717)
### Jenkins Tests:
https://jenkins.dev.yugabyte.com/job/users/job/yb-voyager-testing/job/yb-voyager-testing-pipeline/3476/
https://jenkins.dev.yugabyte.com/job/users/job/yb-voyager-testing/job/yb-voyager-testing-pipeline/3475/
https://jenkins.dev.yugabyte.com/job/users/job/yb-voyager-testing/job/yb-voyager-testing-pipeline/3495/
https://jenkins.dev.yugabyte.com/job/users/job/yb-voyager-testing/job/yb-voyager-testing-pipeline/3494/
### Golang 1.21 new features:
### Golang 1.22 new features:
Previously, the variables declared by a “for” loop were created once and updated by each iteration. In Go 1.22, each iteration of the loop creates new variables, to avoid accidental sharing bugs.
“For” loops may now range over integers.
database/sql: The new Null[T] type provide a way to scan nullable columns for any column types.
slices:
### Golang 1.23 new features:
as range expressions. Calls of the iterator argument function produce the iteration values for the “for-range” loop. For details see the iter package documentation, the language spec, and the Range over Function Types blog post.
The new iter package provides the basic definitions for working with user-defined iterators.
The slices package adds several functions that work with iterators:
All returns an iterator over slice indexes and values.
Values returns an iterator over slice elements.
Backward returns an iterator that loops over a slice backward.
Collect collects values from an iterator into a new slice.
AppendSeq appends values from an iterator to an existing slice.
Sorted collects values from an iterator into a new slice, and then sorts the slice.
SortedFunc is like Sorted but with a comparison function.
SortedStableFunc is like SortFunc but uses a stable sort algorithm.
Chunk returns an iterator over consecutive sub-slices of up to n elements of a slice.
The maps package adds several functions that work with iterators:
All returns an iterator over key-value pairs from a map.
Keys returns an iterator over keys in a map.
Values returns an iterator over values in a map.
Insert adds the key-value pairs from an iterator to an existing map.
Collect collects key-value pairs from an iterator into a new map and returns it.
path/filepath¶: The new Localize function safely converts a slash-separated path into an operating system path.
slices¶: The Repeat function returns a new slice that repeats the provided slice the given number of times.
database/sql¶: Errors returned by driver.Valuer implementations are now wrapped for improved error handling during operations like DB.Query, DB.Exec, and DB.QueryRow.