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

sqlbase: avoid using SERIAL in system tables #28689

Merged
merged 1 commit into from
Aug 16, 2018

Conversation

knz
Copy link
Contributor

@knz knz commented Aug 16, 2018

Needed for #28575.

We'll soon want special behavior for SERIAL. We can't afford the
definition of system tables to be subject to a discussion about what
SERIAL means. So this patch ensures system tables don't use SERIAL.

Release note: None

@knz knz requested a review from BramGruneir August 16, 2018 08:18
@knz knz requested review from a team August 16, 2018 08:18
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained


pkg/sql/sqlbase/system.go, line 131 at r1 (raw file):

	WebSessionsTableSchema = `
CREATE TABLE system.web_sessions (
	id             INT        DEFAULT unique_rowid() PRIMARY KEY,

I have no prior experience with these things, but shouldn't it be INT NOT NULL DEFAULT unique_rowid()?

We'll soon want special behavior for SERIAL. We can't afford the
definition of system tables to be subject to a discussion about what
SERIAL means. So this patch ensures system tables don't use SERIAL.

Release note: None
@knz knz force-pushed the 20180816-web-sessions branch from 24a7688 to 41afd6b Compare August 16, 2018 13:59
@knz
Copy link
Contributor Author

knz commented Aug 16, 2018

I have no prior experience with these things, but shouldn't it be INT NOT NULL DEFAULT unique_rowid()?

Good catch. Done.

See, that's what a review is for :)

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: glad I could help :)

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r2.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@knz
Copy link
Contributor Author

knz commented Aug 16, 2018

thank you!

bors r+

@craig
Copy link
Contributor

craig bot commented Aug 16, 2018

Build failed

@knz
Copy link
Contributor Author

knz commented Aug 16, 2018

known flake, retrying

bors r+

craig bot pushed a commit that referenced this pull request Aug 16, 2018
23885: kv: evict leaseholder on RPC error r=solongoron a=tschottdorf

This addresses a situation in which we would not evict a stale
leaseholder for a long time. Consider the replicas [s1,s2,s3] and
s1 is down but is the cached leaseholder, while s2 is the actual lease
holder. The RPC layer will try s1, get an RPC error, try s2 and succeed.
Since there is no NotLeaseHolderError involved, the cache would not get
updated, and so every request pays the overhead of trying s1 first.

WIP because needs testing.

Touches #23601.

Release note (bug fix): Improve request routing during node outages.

28609: opt: Make additional perf improvements r=andy-kimball a=andy-kimball

Make several more fixes:

1. Do not qualify column names in metadata, since that
requires expensive string formatting up-front (also cleanup
the factoring of this code, which had gotten messy).
2. Inline Metadata into Memo.
3. Inline logicalPropsBuilder into the Memo.

Together, these changes improve KV perf from:
```
Phases/kv-read/OptBuild  18.4µs ± 1%
```
to:
```
Phases/kv-read/OptBuild  17.8µs ± 1%
```

28661: storage: don't include RHS data in merge trigger r=bdarnell,tschottdorf a=benesch

Now that we require ranges to be collocated during a merge and the RHS
replicas to be up-to-date before the merge commits, we no longer need to
include a snapshot of the RHS in the merge trigger. We know that the
copy of the data that already exists in the local store is perfectly
up-to-date.

So, stop sending the data in the merge trigger.

Release note: None

28689: sqlbase: avoid using SERIAL in system tables r=knz a=knz

Needed for  #28575.

We'll soon want special behavior for SERIAL. We can't afford the
definition of system tables to be subject to a discussion about what
SERIAL means. So this patch ensures system tables don't use SERIAL.

Release note: None

Co-authored-by: Tobias Schottdorf <[email protected]>
Co-authored-by: Andrew Kimball <[email protected]>
Co-authored-by: Nikhil Benesch <[email protected]>
Co-authored-by: Raphael 'kena' Poss <[email protected]>
@craig
Copy link
Contributor

craig bot commented Aug 16, 2018

Build succeeded

@craig craig bot merged commit 41afd6b into cockroachdb:master Aug 16, 2018
@knz knz deleted the 20180816-web-sessions branch August 16, 2018 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants