upgrade gocql to latest release #498
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changed?
Upgrade gocql to latest release
Why?
Fixes #140
We had to pin gocql to very old bits due to failures in running persistence unit test on upgrade.
I chased these failures were caused by this change in gocql. The behavior changed where byte arrays are no longer copied before returning back to the caller. If a buffer is passed in to read byte buffer from database then gocql will write the value in the preallocated buffer instead of allocating a new buffer for each value. This requires a change in the caller pattern when they are passing in slices as if multiple values are read in the same buffer then it would cause the previous value to be overwritten resulting in corruption of payload.
Updated all call locations to make sure new buffer is allocated when reading multiple values from database.
Similar situation was happening with page token getting corrupted before being returned back to the user. Pagination logic in GetClusterMembers was completely broken resulting in caller to cycle on results if last page has less items then the page size.
How did you test it?
ran unit and integration tests
Potential risks
Could impact interaction with Cassandra persistence.