Skip to content

Commit 7a597b6

Browse files
craig[bot]ecwallmaryliagjayshrivastava
committed
107586: sql: remove deferred c.bufferReadyForQuery r=rafiss a=ecwall Informs cockroachdb#105448 This line is only used in a testing knob, but is not required by any tests so it can be removed. Release note: None 108147: ui: upgrade typescript from v4 to v5 r=maryliag a=maryliag Upgrade Typescript from v4 to v5, that has a smaller size, is faster and adds new features. This commit make some updates that were causing errors on the new Typescript version, such as type mismatch error. [1] [1] https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#forbidden-implicit-coercions-in-relational-operators Epic: none Release note: None 108191: changefeedccl: fix row count in nemeses test r=miretskiy a=jayshrivastava There was a bug in this test where, when using the declarative schema changer, we would increment the running row count by a factor of 3 when doing addColumn/dropColumn operations. This behavior aligns with the legacy schema changer where we expect to see two backfills. For the declarative schema changer, we should only double the row count because we see one backfill. In cockroachdb#108155, this bug was caused the rowcount would be incorrectly nonzero which would cause test would get stuck waiting for rows to be emitted. Fixes: cockroachdb#108155 Release note: None Epic: None Co-authored-by: Evan Wall <[email protected]> Co-authored-by: maryliag <[email protected]> Co-authored-by: Jayant Shrivastava <[email protected]>
4 parents 8c0426c + 94d156d + f7a8aa2 + 813a079 commit 7a597b6

File tree

13 files changed

+233
-293
lines changed

13 files changed

+233
-293
lines changed

pkg/ccl/changefeedccl/cdctest/nemeses.go

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
// real output of a changefeed. The output rows and resolved timestamps of the
3131
// tested feed are fed into them to check for anomalies.
3232
func RunNemesis(
33-
f TestFeedFactory, db *gosql.DB, isSinkless bool, rng *rand.Rand,
33+
f TestFeedFactory, db *gosql.DB, isSinkless bool, withLegacySchemaChanger bool, rng *rand.Rand,
3434
) (Validator, error) {
3535
// possible additional nemeses:
3636
// - schema changes
@@ -54,9 +54,10 @@ func RunNemesis(
5454
eventPauseCount = 0
5555
}
5656
ns := &nemeses{
57-
maxTestColumnCount: 10,
58-
rowCount: 4,
59-
db: db,
57+
withLegacySchemaChanger: withLegacySchemaChanger,
58+
maxTestColumnCount: 10,
59+
rowCount: 4,
60+
db: db,
6061
// eventMix does not have to add to 100
6162
eventMix: map[fsm.Event]int{
6263
// We don't want `eventFinished` to ever be returned by `nextEvent` so we set
@@ -262,6 +263,8 @@ type addColumnPayload struct {
262263
}
263264

264265
type nemeses struct {
266+
withLegacySchemaChanger bool
267+
265268
rowCount int
266269
maxTestColumnCount int
267270
eventMix map[fsm.Event]int
@@ -692,9 +695,14 @@ func addColumn(a fsm.Args) error {
692695
if err := ns.db.QueryRow(`SELECT count(*) FROM foo`).Scan(&rows); err != nil {
693696
return err
694697
}
695-
// We expect one table scan that corresponds to the schema change backfill, and one
696-
// scan that corresponds to the changefeed level backfill.
697-
ns.availableRows += 2 * rows
698+
if ns.withLegacySchemaChanger {
699+
// We expect one table scan that corresponds to the schema change backfill, and one
700+
// scan that corresponds to the changefeed level backfill.
701+
ns.availableRows += 2 * rows
702+
} else {
703+
// We expect to see a backfill
704+
ns.availableRows += rows
705+
}
698706
return nil
699707
}
700708

@@ -715,9 +723,14 @@ func removeColumn(a fsm.Args) error {
715723
if err := ns.db.QueryRow(`SELECT count(*) FROM foo`).Scan(&rows); err != nil {
716724
return err
717725
}
718-
// We expect one table scan that corresponds to the schema change backfill, and one
719-
// scan that corresponds to the changefeed level backfill.
720-
ns.availableRows += 2 * rows
726+
if ns.withLegacySchemaChanger {
727+
// We expect one table scan that corresponds to the schema change backfill, and one
728+
// scan that corresponds to the changefeed level backfill.
729+
ns.availableRows += 2 * rows
730+
} else {
731+
// We expect to see a backfill
732+
ns.availableRows += rows
733+
}
721734
return nil
722735
}
723736

pkg/ccl/changefeedccl/nemeses_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ func TestChangefeedNemeses(t *testing.T) {
3232
t.Logf("random seed: %d", seed)
3333

3434
sqlDB := sqlutils.MakeSQLRunner(s.DB)
35-
_ = maybeDisableDeclarativeSchemaChangesForTest(t, sqlDB, rng)
35+
withLegacySchemaChanger := maybeDisableDeclarativeSchemaChangesForTest(t, sqlDB, rng)
3636
// TODO(dan): Ugly hack to disable `eventPause` in sinkless feeds. See comment in
3737
// `RunNemesis` for details.
3838
isSinkless := strings.Contains(t.Name(), "sinkless")
39-
v, err := cdctest.RunNemesis(f, s.DB, isSinkless, rng)
39+
v, err := cdctest.RunNemesis(f, s.DB, isSinkless, withLegacySchemaChanger, rng)
4040
if err != nil {
4141
t.Fatalf("%+v", err)
4242
}

pkg/sql/pgwire/conn.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,6 @@ func (c *conn) processCommands(
187187
_ = c.writeErr(ctx, retErr, &c.writerState.buf)
188188
_ /* n */, _ /* err */ = c.writerState.buf.WriteTo(c.conn)
189189
c.stmtBuf.Close()
190-
// Send a ready for query to make sure the client can react.
191-
// TODO(andrei, jordan): Why are we sending this exactly?
192-
c.bufferReadyForQuery('I')
193190
}
194191
}
195192
if !authOK {

0 commit comments

Comments
 (0)