Skip to content
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

bazel: nogo does not seem to catch all deprecation errors #84877

Closed
rickystewart opened this issue Jul 21, 2022 · 1 comment · Fixed by #87327 or #92783
Closed

bazel: nogo does not seem to catch all deprecation errors #84877

rickystewart opened this issue Jul 21, 2022 · 1 comment · Fixed by #87327 or #92783
Assignees
Labels
A-build-system C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-dev-inf

Comments

@rickystewart
Copy link
Collaborator

rickystewart commented Jul 21, 2022

Found in TC run for #84590 at a8c77d7ad18cadba1310c04e526cd845e2a090c6:

        pkg/util/netutil/net.go:140:52: ne.Temporary has been deprecated since Go 1.18 because it shouldn't be used: Temporary errors are not well-defined. Most "temporary" errors are timeouts, and the few exceptions are surprising. Do not use this method.  (SA1019)
    lint_test.go:1765:
        pkg/util/netutil/net.go:173:11: netError.Temporary has been deprecated since Go 1.18 because it shouldn't be used: Temporary errors are not well-defined. Most "temporary" errors are timeouts, and the few exceptions are surprising. Do not use this method.  (SA1019)

nogo did not raise this.

Epic CRDB-8349

Jira issue: CRDB-17922

@rickystewart rickystewart added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-build-system T-dev-inf labels Jul 21, 2022
craig bot pushed a commit that referenced this issue Sep 6, 2022
87271: sql: change when txn is checked refresh materialized views r=rafiss a=e-mbrown


Due to the transaction being checked during planning
and not during execution, refresh materialized views
would fail from the client. Now the transaction is checked
during execution .

Release justification: Bug fix for refresh materialized views

Release note: None

87327: bazel: detect go standard library deprecation errors r=rickystewart a=healthy-pod

Previously, `staticcheck` only raised deprecation errors
from non-stdlib packages because the analysis pass used
by the deprecation analyzer is created by `nogo` which doesn't
analyze the standard library packages.

This code change patches `staticcheck` to let it detect deprecation
errors from the standard library and raise them. It also removes two
uses of `tls.Config.PreferServerCipherSuites` because it's deprecated
since Go 1.18 and is a legacy field that is ignored and has no effect.

Closes #84877

Release justification: Non-production code change
Release note: None

87426: sql: disable agg funcs in costfuzz and unoptimized query oracle r=mgartner a=mgartner

The false-positives of costfuzz and unoptimized-query-oracle caused by
aggregate functions are overwhelming. This commit prevents aggregate
functions from being generated for these tests.

Informs #87353

Release justification: This is a test-only change.

Release note: None

87431: server: mark testDrainContext assertion methods as test helpers r=nvanbenschoten a=nvanbenschoten

The error messages in cases like #86974 are not useful otherwise. This change allows us to see where the assertion method was called from.

Release justification: testing only.

Co-authored-by: e-mbrown <[email protected]>
Co-authored-by: healthy-pod <[email protected]>
Co-authored-by: Marcus Gartner <[email protected]>
Co-authored-by: Nathan VanBenschoten <[email protected]>
@craig craig bot closed this as completed in 90a0126 Sep 6, 2022
@rickystewart
Copy link
Collaborator Author

We've seen something like this again -- #92760 fixes a failure that was not caught in Bazel CI and was only seen in GitHub CI. Reverting the commit I see that I can successfully build with bazel build pkg/ccl/streamingccl/streamclient:all and no error is thrown by nogo.

@rickystewart rickystewart reopened this Nov 30, 2022
craig bot pushed a commit that referenced this issue Dec 2, 2022
92713: sql: fix left semi and left anti virtual lookup joins r=yuzefovich a=yuzefovich

This commit fixes the execution of the left semi and left anti virtual
lookup joins. The bug was that we forgot to project away the looked up
columns (coming from the "right" side) which could then lead to wrong
columns being used higher up the tree. The bug was introduced during
22.1 release cycle where we added the optimizer support for generating
plans that could contain left semi and left anti virtual lookup joins.
This commit fixes that issue as well as the output columns of such joins
(I'm not sure whether there is a user facing impact of having incorrect
"output columns").

Additionally, this commit fixes the execution of these virtual lookup
joins to correctly return the input row only once. Previously, for left
anti joins we'd be producing an output row if there was a match (which
is wrong), and for both left semi and left anti we would emit an output
row every time there was a match (but this should be done only once).
(Although I'm not sure whether it is possible for virtual indexes to
result in multiple looked up rows.)

Also, as a minor simplification this commit makes it so that the output
rows are not added into the row container for left semi and left anti
and the container is not instantiated at all.

Fixes: #91012.
Fixes: #88096.

Release note (bug fix): CockroachDB previously could incorrectly
evaluate queries that performed left semi and left anti "virtual lookup"
joins on tables in `pg_catalog` or `information_schema`. These join types
can be planned when a subquery is used inside of a filter condition. The
bug was introduced in 22.1.0 and is now fixed.

92783: nogo: detect deprecated go standard library packages r=rickystewart a=healthy-pod

In #87327, we patched `staticcheck` to detect deprecated "objects" from the standard library. This patch ensures that we also detect deprecated "packages".

Closes #84877

Release note: None

92859: rowcontainer: address an old TODO r=yuzefovich a=yuzefovich

This commit addresses an old TODO about figuring out why we cannot reuse the same buffer in `diskRowIterator.Row` method. The contract of that method was previously confusing - it says that the call to `Row` invalidates the row returned on the previous call; however, the important piece was missing - that the datums themselves cannot be mutated (this is what we assume elsewhere and perform only the "shallow" copies). This commit clarifies the contract of the method and explicitly explains why we need to allocate fresh byte slices (which is done via `ByteAllocator` to reduce the number of allocations).

Additional context can be found in #43145 which added this copy in the first place. Here is a relevant quote from Alfonso:
```
I think what's going on here is that this type of contract (you may only
reuse the row until the next call) is a bit unclear. `CopyRow`s of
`EncDatum`s are only implemented as shallow copies, so the reference to
this reuse only applies to the `EncDatumRow`, but not to the `encoded`
field, which is what is rewritten in this case. The `encoded` field will
not be copied, so I think the tests are probably failing due to that.
This is unfortunate and there doesn't seem to be a good reason for it.
To implement deep copies, we will have to implement deep copies for
`Datum`s as well.
```
I think we were under the impression that we'd implement the "deep copy" in `CopyRow`, but I highly doubt we'll do so given that we're mostly investing in the columnar infrastructure nowadays, and the current way of performing shallow copying has worked well long enough.

Epic: None

Release note: None

Co-authored-by: Yahor Yuzefovich <[email protected]>
Co-authored-by: healthy-pod <[email protected]>
@craig craig bot closed this as completed in 9f2f119 Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-system C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-dev-inf
Projects
None yet
2 participants