Fix syntax issue introduced in #1188 NPE bugfix#1189
Closed
zcross wants to merge 1 commit intoAltinity:0.21.3from
zcross:zcross/bugfix-npe-issue-1187-syntax
Closed
Fix syntax issue introduced in #1188 NPE bugfix#1189zcross wants to merge 1 commit intoAltinity:0.21.3from zcross:zcross/bugfix-npe-issue-1187-syntax
zcross wants to merge 1 commit intoAltinity:0.21.3from
zcross:zcross/bugfix-npe-issue-1187-syntax
Conversation
Signed-off-by: Zach Cross <[email protected]>
Contributor
Author
|
Rebased to fix conflict ( |
zcross
commented
Jul 7, 2023
| continue | ||
| } | ||
|
|
||
| if !chi.GetStatus().HasNormalizedCHICompleted() { |
Contributor
Author
There was a problem hiding this comment.
GetStatus can return nil, so we could either:
if chi.GetStatus() == nil || !chi.GetStatus().HasNormalizedCHICompleted()if chi.EnsureStatus().HasNormalizedCHICompleted()
I picked the second option for brevity (and because I'm thinking there's no harm to just ensuring that the status struct is non-nil on access like this, i.e., because it is synchronized and can't "clobber" any other concurrent mutations to this state).
Member
|
The problem is already fixed, so this PR is not needed anymore |
Contributor
Author
|
Great, thanks @alex-zaitsev ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
While manually writing the fix in #1188 using a text editor, I misread the return type of the
GetNormalizedCHICompletedfunction as returning a bool rather than a pointer to a CHI. That broke the build of0.21.3once #1188 was merged.Now, this looks more similar to the original state of the code (just using getters instead of direct field access):
https://github.com/Altinity/clickhouse-operator/pull/1188/files#diff-6dd1bf383889aa0b3dde98cf3579859d84b90dd638c4829390596f9237e62f65L295
cc @sunsingerus
Important items to consider before making a Pull Request
Please check items PR complies to:
next-releasebranch, not intomasterbranch1. More info