Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…db#45738 cockroachdb#45752

45667: ui: Refactor redux connect for enqueue ranges r=nathanstilwell a=nathanstilwell

Moving `handleEnqueueRange` from Redux connect to a method in the component as the data seems useless in the state and doesn't dispatch an action.

It seems like the GPRC promise wasn't getting handled by either the [Thunk](https://github.com/reduxjs/redux-thunk) or [Saga](https://github.com/redux-saga/redux-saga) middleware and was confusing Redux as with a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) instead of [an action](https://redux.js.org/basics/actions/).

I'm also increasing the request timeout time on the GPRC request to an hour to ensure completion of tasks.

fixes cockroachdb#44948, cockroachdb#42888

45726: roachtest: use more memory for django roachtest r=rafiss a=rafiss

It is currently running into OOM issues. This should fix it until we can
reduce memory usage.

Also, fix the repo name when getting the latest django-cockroachdb
release.

Release note: None

45737: execgen: try not to touch .eg.go files r=jordanlewis a=jordanlewis

This changes the Makefile to output .eg.go output to a tmp file before
actually editing .eg.go files, to prevent build churn.

Release note: None

45738: roachpb: make the ignored seq num list copy on write r=andreimatei a=andreimatei

Unfortunately the RaceTransport doesn't allow any data referenced by a
Transaction proto to be mutated. This patch makes updates to the ignored
seq nums conform.
The RaceTransport wants to prevent the server from doing such mutations.
In this case it's the client that does the mutations, which should be
allowed, but the implementation of this testing tool casts a wide net.

Release note: None

45752: sql: add a notice to primary key changes about async jobs r=otan a=rohany

Fixes cockroachdb#45730.

Release note: None

Co-authored-by: Nathan Stilwell <nathanstilwell@cockroachlabs.com>
Co-authored-by: Rafi Shamim <rafi@cockroachlabs.com>
Co-authored-by: Jordan Lewis <jordanthelewis@gmail.com>
Co-authored-by: Andrei Matei <andrei@cockroachlabs.com>
Co-authored-by: Rohan Yadav <rohany@alumni.cmu.edu>
  • Loading branch information
6 people committed Mar 5, 2020
6 parents fc91ca8 + da10d08 + 0dd4d44 + 1dca38f + b8af030 + de9786a commit e4d0a0e
Show file tree
Hide file tree
Showing 15 changed files with 206 additions and 203 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,8 @@ pkg/sql/colexec/vec_comparators.eg.go: pkg/sql/colexec/vec_comparators_tmpl.go
pkg/sql/colexec/window_peer_grouper.eg.go: pkg/sql/colexec/window_peer_grouper_tmpl.go

$(EXECGEN_TARGETS): bin/execgen
execgen $@
execgen $@ > $@.tmp; cmp $@.tmp $@ && rm -f $@.tmp || mv $@.tmp $@


optgen-defs := pkg/sql/opt/ops/*.opt
optgen-norm-rules := pkg/sql/opt/norm/rules/*.opt
Expand Down
5 changes: 5 additions & 0 deletions pkg/cli/interactive_tests/test_notice.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,10 @@ send "CREATE TABLE drop_index_test(a int); CREATE INDEX drop_index_test_index ON
eexpect "NOTICE: index \"drop_index_test_index\" will be dropped asynchronously and will be complete after the GC TTL"
end_test

start_test "Check that altering the primary key of a table prints a message about async jobs."
send "CREATE TABLE alterpk (x INT NOT NULL); ALTER TABLE alterpk ALTER PRIMARY KEY USING COLUMNS (x);\r"
eexpect "NOTICE: primary key changes spawn async cleanup jobs. Future schema changes on \"alterpk\" may be delayed as these jobs finish"
end_test

send "\\q\r"
eexpect eof
4 changes: 2 additions & 2 deletions pkg/cmd/roachtest/django.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func registerDjango(r *testRegistry) {
}

djangoCockroachDBLatestTag, err := repeatGetLatestTag(
ctx, c, "django", "django", djangoCockroachDBReleaseTagRegex,
ctx, c, "cockroachdb", "django-cockroachdb", djangoCockroachDBReleaseTagRegex,
)
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -206,7 +206,7 @@ func registerDjango(r *testRegistry) {
MinVersion: "v19.2.0",
Name: "django",
Owner: OwnerAppDev,
Cluster: makeClusterSpec(1, cpu(8)),
Cluster: makeClusterSpec(1, cpu(16)),
Tags: []string{`default`, `orm`},
Run: func(ctx context.Context, t *test, c *cluster) {
runDjango(ctx, t, c)
Expand Down
4 changes: 1 addition & 3 deletions pkg/kv/txn_coord_sender_savepoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"context"

"github.com/cockroachdb/cockroach/pkg/internal/client"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/storage/enginepb"
"github.com/cockroachdb/cockroach/pkg/util/errorutil/unimplemented"
"github.com/cockroachdb/cockroach/pkg/util/uuid"
Expand Down Expand Up @@ -118,8 +117,7 @@ func (tc *TxnCoordSender) RollbackToSavepoint(ctx context.Context, s client.Save
return nil
}

tc.mu.txn.IgnoredSeqNums = roachpb.AddIgnoredSeqNumRange(
tc.mu.txn.IgnoredSeqNums,
tc.mu.txn.AddIgnoredSeqNumRange(
enginepb.IgnoredSeqNumRange{
Start: st.seqNum + 1, End: tc.interceptorAlloc.txnSeqNumAllocator.writeSeq,
})
Expand Down
48 changes: 48 additions & 0 deletions pkg/roachpb/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,54 @@ func (t *Transaction) GetObservedTimestamp(nodeID NodeID) (hlc.Timestamp, bool)
return s.get(nodeID)
}

// AddIgnoredSeqNumRange adds the given range to the given list of
// ignored seqnum ranges. Since none of the references held by a Transaction
// allow interior mutations, the existing list is copied instead of being
// mutated in place.
//
// The following invariants are assumed to hold and are preserved:
// - the list contains no overlapping ranges
// - the list contains no contiguous ranges
// - the list is sorted, with larger seqnums at the end
//
// Additionally, the caller must ensure:
//
// 1) if the new range overlaps with some range in the list, then it
// also overlaps with every subsequent range in the list.
//
// 2) the new range's "end" seqnum is larger or equal to the "end"
// seqnum of the last element in the list.
//
// For example:
// current list [3 5] [10 20] [22 24]
// new item: [8 26]
// final list: [3 5] [8 26]
//
// current list [3 5] [10 20] [22 24]
// new item: [28 32]
// final list: [3 5] [10 20] [22 24] [28 32]
//
// This corresponds to savepoints semantics:
//
// - Property 1 says that a rollback to an earlier savepoint
// rolls back over all writes following that savepoint.
// - Property 2 comes from that the new range's 'end' seqnum is the
// current write seqnum and thus larger than or equal to every
// previously seen value.
func (t *Transaction) AddIgnoredSeqNumRange(newRange enginepb.IgnoredSeqNumRange) {
// Truncate the list at the last element not included in the new range.

list := t.IgnoredSeqNums
i := sort.Search(len(list), func(i int) bool {
return list[i].End >= newRange.Start
})

cpy := make([]enginepb.IgnoredSeqNumRange, i+1)
copy(cpy[:i], list[:i])
cpy[i] = newRange
t.IgnoredSeqNums = cpy
}

// AsRecord returns a TransactionRecord object containing only the subset of
// fields from the receiver that must be persisted in the transaction record.
func (t *Transaction) AsRecord() TransactionRecord {
Expand Down
61 changes: 31 additions & 30 deletions pkg/roachpb/data.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions pkg/roachpb/data.proto
Original file line number Diff line number Diff line change
Expand Up @@ -501,10 +501,11 @@ message Transaction {
repeated SequencedWrite in_flight_writes = 17 [(gogoproto.nullable) = false];
// A list of ignored seqnum ranges.
//
// The user code must guarantee this list to be non-overlapping,
// non-contiguous (i.e. it must coalesce ranges to avoid situations
// where a range's end seqnum is equal to the next range's start
// seqnum), and sorted in seqnum order.
// The slice is maintained as non-overlapping, non-contiguous (i.e. it must
// coalesce ranges to avoid situations where a range's end seqnum is equal to
// the next range's start seqnum), and sorted in seqnum order. It should be
// treated as immutable and all updates should be performed on a copy of the
// slice.
repeated storage.enginepb.IgnoredSeqNumRange ignored_seqnums = 18
[(gogoproto.nullable) = false, (gogoproto.customname) = "IgnoredSeqNums"];

Expand Down
Loading

0 comments on commit e4d0a0e

Please sign in to comment.