Skip to content

Conversation

@samarabbas
Copy link
Contributor

@samarabbas samarabbas commented Jul 3, 2020

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.

@samarabbas samarabbas merged commit dd0857e into temporalio:master Jul 6, 2020
@samarabbas samarabbas deleted the upgrade-gocql branch July 6, 2020 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate why upgrading gocql breaks paging

2 participants