Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
88752: kvserver: log details about `ConditionFailedError` encountered by splits r=aayushshah15 a=aayushshah15

Informs #87837

Release justification: logging only change

Release note: None

88790: logictest: remove a duplicate query r=yuzefovich a=yuzefovich

This commit removes a single test query since it is an exact duplicate of another one about 100 lines up in the file. There is also no change in the session variables between the two spots.

Release note: None

88814: changefeedccl: Fix array encoding avro bug. r=miretskiy a=miretskiy

Fix latent array avro encoding bug where previously allocated memo array might contain 'nil' element, while the code assumed that the element must always be a map.

Release note: none.

Co-authored-by: Aayush Shah <[email protected]>
Co-authored-by: Yahor Yuzefovich <[email protected]>
Co-authored-by: Yevgeniy Miretskiy <[email protected]>
  • Loading branch information
4 people committed Sep 27, 2022
4 parents 03b8afb + 98e5e81 + d5f3be1 + d7f53cf commit ae38d90
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions pkg/ccl/changefeedccl/avro.go
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ func typeToAvroSchema(typ *types.T) (*avroSchemaField, error) {
},
func(d tree.Datum, memo interface{}) (interface{}, error) {
datumArr := d.(*tree.DArray)

var avroArr []interface{}
if memo != nil {
avroArr = memo.([]interface{})
Expand All @@ -616,14 +617,13 @@ func typeToAvroSchema(typ *types.T) (*avroSchemaField, error) {
} else {
avroArr = make([]interface{}, 0, datumArr.Len())
}

for i, elt := range datumArr.Array {
var encoded interface{}
if elt == tree.DNull {
encoded = nil
} else {
var encErr error
if i < len(avroArr) {
if i < len(avroArr) && avroArr[i] != nil {
encoded, encErr = itemSchema.encodeDatum(elt, avroArr[i].(map[string]interface{})[itemUnionKey])
} else {
encoded, encErr = itemSchema.encodeDatum(elt, nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,6 @@ statement error pq: Query has no home region\. Try adding a filter on o\.crdb_re
SELECT * FROM customers c JOIN orders o ON c.id = o.cust_id AND
(c.crdb_region = o.crdb_region) WHERE c.id = '69a1c2c2-5b18-459e-94d2-079dc53a4dd0'

# A join relation with no home region as the left input of lookup join should
# not be allowed.
statement error pq: Query has no home region\. Try adding a filter on rbr\.crdb_region and/or on key column \(rbr\.account_id\)\.
SELECT * FROM messages_rbr rbr INNER LOOKUP JOIN messages_global g2 ON rbr.account_id = g2.account_id
INNER LOOKUP JOIN messages_global g3 ON g2.account_id = g3.account_id

# Locality optimized lookup join is allowed.
query TTTTTTT retry
SELECT * FROM messages_rbr rbr, messages_rbt rbt WHERE rbr.account_id = rbt.account_id LIMIT 1
Expand Down Expand Up @@ -372,7 +366,7 @@ inner-join (lookup messages_rbt [as=rbt])
│ └── constraint: /4/1: [/'ap-southeast-2' - /'ap-southeast-2']
└── filters (true)

# A lookup join between with a global table as either input should be allowed.
# A lookup join with a global table as either input should be allowed.
query TTTTTT retry
SELECT * FROM messages_global g1 INNER LOOKUP JOIN messages_global g2 ON g1.account_id = g2.account_id
----
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/split_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func (sq *splitQueue) process(
// attempts because splits can race with other descriptor modifications.
// On seeing a ConditionFailedError, don't return an error and enqueue
// this replica again in case it still needs to be split.
log.Infof(ctx, "split saw concurrent descriptor modification; maybe retrying")
log.Infof(ctx, "split saw concurrent descriptor modification; maybe retrying; err: %v", err)
sq.MaybeAddAsync(ctx, r, sq.store.Clock().NowAsClockTimestamp())
return false, nil
}
Expand Down

0 comments on commit ae38d90

Please sign in to comment.