Skip to content

Commit

Permalink
Merge #69934 #69989
Browse files Browse the repository at this point in the history
69934: roachtest: add passing tests for lib/pq and pgjdbc r=arulajmani a=rafiss

fixes #69527
fixes #69190

Release justification: test only change
Release note: None

69989: distsql: update evalCtx.Txn early if possible r=yuzefovich a=yuzefovich

We recently introduced the support for multiple parallel processors
within a single stage of a local plan. This forces us to use the LeafTxn
which we instantiate eagerly. This commit adjusts the code to update
`EvalCtx.Txn` right away too as well as to restore the value to its
original.

Release note: None

Release justification: low-risk adjustment to the new functionality.

Co-authored-by: Rafi Shamim <[email protected]>
Co-authored-by: Yahor Yuzefovich <[email protected]>
  • Loading branch information
3 people committed Sep 13, 2021
3 parents e19274a + 5f91349 + 9f650cd commit 386e099
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
35 changes: 34 additions & 1 deletion pkg/cmd/roachtest/tests/libpq_blocklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,40 @@ var libPQBlocklists = blocklistsForVersion{
{"v21.2", "libPQBlocklist21_2", libPQBlocklist21_2, "libPQIgnorelist21_2", libPQIgnorelist21_2},
}

var libPQBlocklist21_2 = libPQBlocklist21_1
var libPQBlocklist21_2 = blocklist{
"pq.ExampleConnectorWithNoticeHandler": "unknown",
"pq.TestBinaryByteSliceToInt": "41547",
"pq.TestBinaryByteSlicetoUUID": "41547",
"pq.TestConnListen": "41522",
"pq.TestConnUnlisten": "41522",
"pq.TestConnUnlistenAll": "41522",
"pq.TestConnectorWithNoticeHandler_Simple": "unknown",
"pq.TestConnectorWithNotificationHandler_Simple": "unknown",
"pq.TestContextCancelBegin": "41335",
"pq.TestContextCancelExec": "41335",
"pq.TestContextCancelQuery": "41335",
"pq.TestCopyFromError": "5807",
"pq.TestCopyInRaiseStmtTrigger": "5807",
"pq.TestCopyInTypes": "5807",
"pq.TestCopyRespLoopConnectionError": "5807",
"pq.TestEncodeAndParseTs": "41563",
"pq.TestInfinityTimestamp": "41564",
"pq.TestIssue186": "41558",
"pq.TestIssue196": "41689",
"pq.TestIssue282": "12137",
"pq.TestListenerFailedQuery": "41522",
"pq.TestListenerListen": "41522",
"pq.TestListenerReconnect": "41522",
"pq.TestListenerUnlisten": "41522",
"pq.TestListenerUnlistenAll": "41522",
"pq.TestNotifyExtra": "41522",
"pq.TestPing": "35897",
"pq.TestQueryRowBugWorkaround": "5807",
"pq.TestReconnect": "35897",
"pq.TestRowsColumnTypes": "41688",
"pq.TestRuntimeParameters": "12137",
"pq.TestStringWithNul": "26366",
}

var libPQBlocklist21_1 = libPQBlocklist20_2

Expand Down
4 changes: 1 addition & 3 deletions pkg/cmd/roachtest/tests/pgjdbc_blocklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,7 @@ var pgjdbcBlockList21_2 = blocklist{
"org.postgresql.test.jdbc2.PGObjectSetTest.setNullAsPGobject[binary = REGULAR, sql = polygon, type = class org.postgresql.geometric.PGpolygon]": "21286",
"org.postgresql.test.jdbc2.PGTimeTest.testTimeInsertAndSelect": "41775",
"org.postgresql.test.jdbc2.PGTimestampTest.testTimeInsertAndSelect": "41775",
"org.postgresql.test.jdbc2.ParameterStatusTest.transactionalParametersAutocommit": "32562",
"org.postgresql.test.jdbc2.ParameterStatusTest.transactionalParametersCommit": "32562",
"org.postgresql.test.jdbc2.ParameterStatusTest.transactionalParametersRollback": "32562",
"org.postgresql.test.jdbc2.ParameterStatusTest.transactionalParametersRollback": "69396",
"org.postgresql.test.jdbc2.PreparedStatementTest.testBatchWithPrepareThreshold5[binary = REGULAR]": "5807",
"org.postgresql.test.jdbc2.PreparedStatementTest.testDoubleQuestionMark[binary = FORCE]": "21286",
"org.postgresql.test.jdbc2.PreparedStatementTest.testDoubleQuestionMark[binary = REGULAR]": "21286",
Expand Down
5 changes: 5 additions & 0 deletions pkg/sql/distsql/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,10 @@ func (ds *ServerImpl) setupFlow(
// the whole evalContext, but that isn't free, so we choose to restore
// the original state in order to avoid performance regressions.
origMon := evalCtx.Mon
origTxn := evalCtx.Txn
onFlowCleanup = func() {
evalCtx.Mon = origMon
evalCtx.Txn = origTxn
}
evalCtx.Mon = monitor
if localState.HasConcurrency {
Expand All @@ -310,6 +312,9 @@ func (ds *ServerImpl) setupFlow(
if err != nil {
return nil, nil, nil, err
}
// Update the Txn field early (before f.SetTxn() below) since some
// processors capture the field in their constructor (see #41992).
evalCtx.Txn = leafTxn
}
} else {
if localState.IsLocal {
Expand Down

0 comments on commit 386e099

Please sign in to comment.