-
Notifications
You must be signed in to change notification settings - Fork 917
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 GetWorkflowExecution in PostgreSQL #3816
Fix GetWorkflowExecution in PostgreSQL #3816
Conversation
@@ -303,11 +303,11 @@ func (s *visibilitySuite) TestDeleteSelect() { | |||
s.NoError(err) | |||
s.Equal(0, int(rowsAffected)) | |||
|
|||
selectFilter := sqlplugin.VisibilitySelectFilter{ | |||
getFilter := sqlplugin.VisibilityGetFilter{ |
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.
Why are we using Get instead of Select here, now? Also, if we are doing that, we should rename the tests accordingly.
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.
Hm, I could just leave unchanged. SelectFilter with only namespace and run id will do a Get anyway under the hood.
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 think we should leave this unchanged, at least in this 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.
Actually, now I remember why I changed.
It's because in the new code, I made it not return an error in this case.
Currently, since Select calls Get in this case, it returns an error if the row is not found, which is kind of misleading because it's a Select.
Also, there's no actual use case of Select for the (namespace, run id) in the code, only in these tests.
I'll leave unchanged in this PR, and move to where I actually need this.
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.
Some questions
53db9ff
to
ee060ae
Compare
What changed?
In PostgreSQL, fix trimming run id in
GetWorkflowExecution
.Refactored some code, and added new unit tests to cover
GetWorkflowExeccution
function.Why?
In PostgreSQL, when doing
SELECT
, the run id has to be trimmed as it returns with trailing spaces. The existing select function is doing it, but theGetWorkflowExecution
was missing.How did you test it?
New unit tests.
Potential risks
None,
GetWorkflowExecution
is only used when removing SA and memo from mutable state is enabled (currently not used anywhere).Is hotfix candidate?
No.