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

[DNM] RFCS: draft of transactional schema changes #8

Merged
merged 1,920 commits into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1920 commits
Select commit Hold shift + click to select a range
c4032c2
Merge #56914
Nov 19, 2020
891b299
server: remove KeepRedactable logs rpc option
andreimatei Nov 17, 2020
cec4342
Merge #56458
Nov 19, 2020
4a2177f
util, server: fix memory detection with non-root cgroups
darinpp Nov 18, 2020
06cb7c1
Merge #56835
Nov 20, 2020
be7dc05
sql: allow PRIMARY REGION syntax for CREATE / ALTER DATABASE
otan Nov 20, 2020
099dae8
Merge #56878
Nov 20, 2020
39015a0
Merge #56829 #56840
Nov 20, 2020
fefb12b
roachtest: add flag to testSpec to disable release-blocker tag
thoszhang Nov 20, 2020
d9cadaa
roachtest: mark random schema change tests as non-release-blocking
thoszhang Nov 20, 2020
81ac191
Merge #56883
Nov 20, 2020
609cad5
Merge #55474
Nov 20, 2020
ec75805
workload/tpcc: fix race condition in scattering tables
thoszhang Nov 20, 2020
277cc15
kv: cap COCKROACH_SCHEDULER_CONCURRENCY at 96
nvanbenschoten Nov 18, 2020
6efc215
kv: batch enqueue Ranges in Raft scheduler for coalesced heartbeats
nvanbenschoten Nov 18, 2020
900729b
kv: prioritize NodeLiveness Range in Raft scheduler
nvanbenschoten Nov 18, 2020
13409b9
server: de-flake TestClusterVersionMixedVersionTooOld
irfansharif Nov 20, 2020
cf9f376
Merge #56944
Nov 20, 2020
960e03a
Merge #56681 #56858
Nov 20, 2020
b1dc519
sql: aggregate row counts for EXPLAIN ANALYZE (PLAN)
RaduBerinde Nov 19, 2020
02667e3
storage, storageccl: Update EnvStats to account for obsolete files
itsbilal Nov 20, 2020
2301b8c
Merge #56879
Nov 20, 2020
a175148
sql/catalog/lease: add more details to assertion error
ajwerner Nov 20, 2020
829177f
colexec: make router outputs and external operators more dynamic
yuzefovich Nov 19, 2020
2d88439
Merge #56437
Nov 20, 2020
9806c1c
Merge #56632 #56913
Nov 20, 2020
5dcdf36
server: Add sentry tag for encryption-at-rest
itsbilal Nov 20, 2020
b1d1547
sql: Enabled correct pg_class.relPersistence for temporary tables
Nov 17, 2020
46dfe50
Merge #56931
Nov 21, 2020
7ae56ff
Merge #56962
Nov 21, 2020
2900c47
kvcoord: pool grpcTransports; avoid allocations
jordanlewis Nov 20, 2020
f5f0f11
Merge #56935 #56942 #56960
Nov 21, 2020
5e19d61
*: skip all tests which take > 1min under race
adityamaru Nov 20, 2020
09b5497
Revert "cli, ui: dismiss release notes signup banner per environment …
jordanlewis Nov 22, 2020
947c365
Merge #57003
Nov 22, 2020
3588e05
Merge #56940 #56963
Nov 22, 2020
be3ff28
Merge #56860
Nov 22, 2020
6f07e59
util/log: remove a stray file
knz Nov 19, 2020
7c9f24b
util/log: fix the `--redactable-logs` flag
knz Nov 20, 2020
c8e6237
Merge #56897
Nov 22, 2020
0ab6c8a
geos: link to docs if GEOS is not installed
otan Nov 22, 2020
28e2cad
kv: re-use elapsed time for RaftHandleReadyLatency metric
nvanbenschoten Nov 22, 2020
f39169e
kv: recycle small info slices in raftRequestQueue
nvanbenschoten Nov 23, 2020
067d833
parser: remove CREATE DATABASE ... REGION from docs
otan Nov 23, 2020
b6a7bd2
kv: cache replica-annotated Raft scheduler context
nvanbenschoten Nov 23, 2020
097e1b7
roachpb: use kv.kvpb as package name for errors.proto
tbg Nov 23, 2020
fb7d753
descs: remove unnecessary slice allocation
jordanlewis Nov 23, 2020
f34986f
Merge #57011
Nov 23, 2020
f24548e
cli: rework the `--help` strings for `node drain`
knz Nov 18, 2020
6188451
Merge #56849
Nov 23, 2020
93a32ae
sql: add notice for interleaved tables and indexes
Nov 18, 2020
dc02e8c
Merge #56939
Nov 23, 2020
2a93a53
storage: add Reader and Writer wrappers for separated intents
sumeerbhola Nov 19, 2020
edcc70e
colexec: support running colexec tests through bazel
irfansharif Nov 23, 2020
191dc37
Merge #56827
Nov 23, 2020
be5a871
Merge #56934
Nov 23, 2020
5156cf0
backupccl: optimize spans selected for backup and ts protection
adityamaru Oct 14, 2020
3cfc3de
Merge #56930
Nov 23, 2020
ea381b0
importccl: Add DROP TABLE [IF EXISTS] support for import pgdump.
mokaixu Nov 18, 2020
61ee2d5
backupccl: correctly manage temp objects during a full cluster restore
adityamaru Nov 20, 2020
08bd15a
execgen: permit customization of template path
jordanlewis Nov 23, 2020
6d2d444
cli: remove cockroach dump from CRDB
adityamaru Nov 20, 2020
10944cf
Merge #56900
Nov 23, 2020
392a0ec
sql,util: return unique boolean from EncodeContainingInvertedIndexSpans
rytaft Nov 16, 2020
22da098
Merge #56964
Nov 23, 2020
c2b4fff
Merge #55794 #56298 #56920 #57004
Nov 23, 2020
ecb0a4c
sql: fix for column type for pg_constraint.confkey to smallint[]
Nov 20, 2020
c2e607e
Merge #56882 #56956 #57006
Nov 23, 2020
c27ae46
Merge #56874 #57018 #57027
Nov 23, 2020
14f6285
sql: persist CREATE DATABASE ... REGIONS / SURVIVE options
otan Nov 19, 2020
2ed069f
sql: display survival goal and regions in SHOW DATABASES
otan Nov 23, 2020
620c6bb
Merge #56880
Nov 23, 2020
ed964c0
bazel: add freebsd support
irfansharif Nov 24, 2020
b125e4c
opttester: add optsteps split-diff test
mgartner Nov 21, 2020
4c5dee2
tree: fix casts and parse to obey type limits
otan Nov 24, 2020
4f396c8
Merge #56981
Nov 24, 2020
7f231b7
Merge #57007
Nov 24, 2020
40ab4eb
teamcity-trigger: run nightly stressrace with -p 1
andreimatei Nov 16, 2020
91ae736
storage: delete mvccGetInternal, use mvccGet directly
nvanbenschoten Nov 24, 2020
99f2183
storage: optimize mvccGet return value
nvanbenschoten Nov 24, 2020
350c427
storage: remove mvccGetImpls from tests
nvanbenschoten Nov 24, 2020
8c9a248
util: move IntValue to util.optional
RaduBerinde Nov 21, 2020
7b8288b
Merge #56929
Nov 24, 2020
6ca7ef3
jobs: jitter jobs cleanups
andreimatei Nov 24, 2020
d9233a4
jobs: paginate job deletions
andreimatei Nov 24, 2020
48f860b
Merge #56775
Nov 24, 2020
9bf4db1
ui: Update empty states for table components
koorosh Sep 28, 2020
a47c233
ui: Add rc-calendar package
koorosh Sep 21, 2020
8c16a8c
ui: Add RangeCalendar component
koorosh Sep 21, 2020
66d4032
ui: Use RangeCalendar within Range component
koorosh Sep 24, 2020
fccf248
Merge #57030 #57039
Nov 24, 2020
e911d58
Merge #57041
Nov 24, 2020
57a5fe2
Merge #56998
Nov 24, 2020
15f6b33
ccl/sqlproxyccl: expose a connection Done channel
jbowens Nov 23, 2020
8d62a0d
ccl/sqlproxyccl: allow insecure non-TLS connections
jbowens Nov 23, 2020
25986df
Merge #57037
Nov 24, 2020
1f23ef2
Merge #54943
Nov 24, 2020
9208fa2
add an external contributors hall of fame file
otan Nov 24, 2020
86b9b43
Merge #57069
Nov 24, 2020
f11b367
execinfra: add flow diagram for BACKUP
dt Nov 9, 2020
5aa5213
backupccl: improve context of a few errors
dt Nov 9, 2020
17ae8f9
backupccl: remove unneeded NodeID
dt Nov 24, 2020
f4126d2
backupccl: pass correct codec to read descs
dt Nov 24, 2020
dbeef3e
opt: remove unnecessary *memo.Memo argument in FiltersExpr.OuterCols
mgartner Nov 24, 2020
721af02
sql: add feature flag for CREATE STATISTICS/ANALYZE
Nov 24, 2020
1370a0a
Merge #57080
Nov 24, 2020
ada5d53
ui: update link on sessions page documentation
koorosh Nov 23, 2020
c7fdd24
sql: persist PRIMARY REGION metadata onto database descriptor
otan Nov 23, 2020
0298629
delegate: show primary_region for SHOW DATABASES
otan Nov 23, 2020
e5bb3be
sql: sort regions in order
otan Nov 24, 2020
4f071aa
roachtest: update pgjdbc blocklists
solongordon Nov 24, 2020
61bd94b
Merge #57076
Nov 24, 2020
149416b
sql: allow for pre-19.2 foreign keys in table validation
thoszhang Nov 24, 2020
bb95a38
catalogkv: add testing of descriptor unwrapping and validation
ajwerner Nov 24, 2020
c9fb63a
Merge #57066
Nov 24, 2020
de2525b
Merge #57078
Nov 24, 2020
9e34e57
Merge #55095
Nov 24, 2020
65b8033
bazel: pin Go 1.15.5
otan Nov 25, 2020
3d1e994
sql,opt: add support for inverted filter with JSON and Array columns
rytaft Nov 5, 2020
1166346
sql, featureflag: add schema change feature flag
Nov 24, 2020
d251e17
Merge #57038
Nov 25, 2020
82ae151
Merge #57040
Nov 25, 2020
f1ac4ef
Merge #56899
Nov 25, 2020
63e1047
tracing: improve a comment
tbg Nov 5, 2020
ea9f248
tracing: internally remove WithSeparateRecording
tbg Nov 5, 2020
482875d
tracing: don't erroneously return a noopSpan
tbg Nov 5, 2020
7f0a102
tracing: return nil *SpanMeta
tbg Nov 5, 2020
a126abc
tracing: rename WithParent and WithRemoteParent
tbg Nov 11, 2020
6d906e9
tracing: fix alloc regression startSpanGeneric
tbg Nov 24, 2020
94e3fca
sql: skip TestTrace under race
tbg Nov 25, 2020
b7c714b
Merge #56343
Nov 25, 2020
e9d66e5
Merge #54851
Nov 25, 2020
9f4a46b
rditer: include lock table ranges when making key ranges
sumeerbhola Nov 24, 2020
87bd652
Merge #57046
Nov 25, 2020
4800cf2
colexec,bazel: re-work code-gen through bazel
irfansharif Nov 24, 2020
8d25fa1
Merge #57075 #57081
Nov 25, 2020
8ef0622
Merge #56732 #57050
Nov 25, 2020
3abdc15
storage: pass correct parameters to PutIntent, ClearIntent
sumeerbhola Nov 25, 2020
c8f9c3f
roachtest: Use encryption-at-rest in some random clearrange runs
itsbilal Nov 24, 2020
38f14ff
cli,util/log: fix the redaction code
knz Nov 25, 2020
edfe918
Merge #57121
Nov 25, 2020
fda0d97
tabledesc: fix bug in unupgraded descriptor validation
ajwerner Nov 25, 2020
33b8558
catalogkv: extend datadriven test for fk references with differring ids
ajwerner Nov 25, 2020
21beeeb
Merge #57117
Nov 25, 2020
21503c8
Merge #57132
Nov 25, 2020
00755c0
descpb: add Region as a type
otan Nov 25, 2020
ffd7f68
util/log: make the entry counter a property of the sink
knz Nov 20, 2020
552e2a7
util/log: share some common properties across sinks
knz Nov 20, 2020
2c66148
util/log: new sub package 'logcrash'
knz Nov 22, 2020
3dacfef
sql: feature flag for ALTER TABLE/INDEX SPLIT/UNSPLIT
Nov 25, 2020
52c79da
Merge #57000
Nov 25, 2020
75df73e
Merge #57086 #57105
Nov 25, 2020
0d8f7d4
sql: allow nulls in materialized views
rafiss Nov 25, 2020
a94f1d9
opt: don't hold on to evalCtx from detached Memo
RaduBerinde Nov 25, 2020
fe5da5c
Merge #56975
Nov 25, 2020
b97c9fb
docs: edit release note for schema change feature flag
Nov 25, 2020
70d8558
roachtest: introduce new tpce/c=5000/nodes=3 roachtest
nvanbenschoten Nov 20, 2020
f82face
ui: update user permissions validations for adminui endpoints
koorosh Nov 4, 2020
59639b2
ui: messages for restricted access for non-admin users
koorosh Jul 1, 2020
44956fa
ui: Integrate InlineAlerts into Loading component
koorosh Jul 3, 2020
f499cff
ui: provide server generated errors for restricted permissions
koorosh Nov 4, 2020
e31d60c
Merge #57019
Nov 26, 2020
ee22b18
Revert "util/log: more misc cleanups"
irfansharif Nov 26, 2020
87cf74e
Merge #57178
Nov 26, 2020
81c6639
sql: don't use b.Parallel in BenchmarkFlowSetup
nvanbenschoten Nov 26, 2020
f108265
descpb: rework RegionConfig to be nilable
otan Nov 26, 2020
00970f5
Merge #57094
Nov 26, 2020
d1aee54
Merge #57151
Nov 26, 2020
d9954e1
delegate: implement SHOW REGION FROM DATABASE
otan Nov 26, 2020
40f7f9c
Merge #57142
Nov 26, 2020
425d8ed
Merge #57143
Nov 26, 2020
3612151
Merge #57139
Nov 27, 2020
def8f6f
cli: Warn users if --locality doesn't include "region"
ajstorm Nov 26, 2020
9a52a9c
sql: create region type enums for multiregion databases
arulajmani Nov 12, 2020
fd16474
ui: reuse Loading component from admin-ui-components
koorosh Nov 4, 2020
25698c5
Merge #56628
Nov 27, 2020
85781f8
Merge #57180
Nov 27, 2020
d98aa66
clusterversion: document process for introducing cluster versions
irfansharif Nov 26, 2020
a506329
clusterversion: move version comments next to definition
irfansharif Nov 26, 2020
da5dc14
Merge #57154
Nov 27, 2020
8107022
clusterversion,*: remove VersionContainsEstimatesCounter
irfansharif Nov 26, 2020
93812e9
migration,server: plumb in initial version to the migration manager
irfansharif Nov 25, 2020
e8c3b90
clusterversion: rename proto pkg name for cleaner import path
irfansharif Nov 25, 2020
3783e63
migration: promote clusterversion to first-class citizen...
irfansharif Nov 25, 2020
7dc582a
sql: extend SHOW ENUMS to include an optional FROM clause
arulajmani Nov 27, 2020
bbb7e7c
Merge #57118
Nov 27, 2020
8e8ccb1
clusterversion: introduce even internal version constraint
irfansharif Nov 26, 2020
ebf8c3e
sql,clusterversion: remove VersionAuthLocalAndTrustRejectMethods
irfansharif Nov 26, 2020
effee63
Merge #57155 #57156
Nov 28, 2020
6787eec
migration: introduce fence versions
irfansharif Nov 26, 2020
54cdc5f
Merge #57186
Nov 28, 2020
72aa85a
sql: add support for CTAS AS OF SYSTEM TIME
jordanlewis Oct 23, 2020
4970b95
Merge #57106
Nov 29, 2020
76935fd
Merge #56974
Nov 30, 2020
01a634e
builtins: implement regr_count
mneverov Nov 30, 2020
3bdac01
optional: add Duration
asubiotto Nov 30, 2020
d9f7bcb
Merge #56951
Nov 30, 2020
94a429b
Revert "Revert "util/log: more misc cleanups""
knz Nov 30, 2020
ef184b7
util/log: deflake tests that use SQL connections
knz Nov 30, 2020
510d541
sql: remove pointless Clock update closure allocation
jordanlewis Nov 23, 2020
8a449fc
storage: split UnsafeRawKey into two methods
sumeerbhola Nov 25, 2020
338abcf
Merge #55916
Nov 30, 2020
a23d529
sql: add introspection for multi-region enums
arulajmani Nov 27, 2020
b7de6c9
Merge #56822
Nov 30, 2020
cefe554
optbuilder: fix ambiguous column references for FK cascades
mgartner Nov 25, 2020
13ce0e8
Merge #56395 #57222
Nov 30, 2020
76968ff
colexec: adjust benchmarks to include cases with small number of tuples
yuzefovich Nov 20, 2020
11e6312
colexec: retune hash table constants in all of its uses
yuzefovich Nov 20, 2020
293c931
*: s/the the /the /
jordanlewis Nov 30, 2020
4907cac
ccl/sqlproxyccl: lazily initialize closedCh
jbowens Nov 30, 2020
314f553
opt: make checking indexRejectFlags in scanIndexIter safer
mgartner Nov 30, 2020
4fc8f27
lint: remove some dead code
knz Nov 30, 2020
356bdd6
build: install tar in our docker image
chrisseto Nov 30, 2020
1fe7794
kvserver: avoid serving an unsafe string to log.Fatalf
knz Nov 30, 2020
9f9add7
geo: set SRID to 4326 when using ST_GeomFromGeoJSON
otan Nov 30, 2020
32b2ea4
rowenc: de-flake TestEncodeContainingArrayInvertedIndexSpans
mgartner Nov 30, 2020
8a54c58
Merge #57152 #57239
Nov 30, 2020
f850b88
sql: Add information_schema.character_sets table
mknycha Nov 25, 2020
75d99fa
Merge #57235
Nov 30, 2020
47d133e
logictest: add tests for backfilling multi-column inverted indexes
mgartner Nov 30, 2020
2bacba5
cloud: Bump orchestration version to 20.2.2
Nov 30, 2020
d5222dc
Merge #57149 #57153 #57242 #57246
Nov 30, 2020
54158fc
importccl: Added row limit option for importing bundle formats
mokaixu Nov 4, 2020
04149f8
Merge #57150 #57225
Nov 30, 2020
e637caf
Merge #56953
Nov 30, 2020
9d94976
sql: raise error if opaque statement receives nil plan node
Nov 30, 2020
ae509ad
Merge #57241
Nov 30, 2020
e017dd1
colexec: remove templating nulls vs no-nulls case in merge joiner
yuzefovich Nov 30, 2020
67274b0
Merge #57252
Dec 1, 2020
5c44393
sql,colexec: minor cleanup of scan-related things
yuzefovich Nov 9, 2020
6980223
Merge #57267
Dec 1, 2020
211cf30
lease: add logging for questionable descriptors
jordanlewis Dec 1, 2020
82f4274
Merge #57263
Dec 1, 2020
a654511
Merge #57233
Dec 1, 2020
22906f7
Merge #57207 #57271
Dec 1, 2020
aa5a86b
colfetcher: remove unused semactx object
jordanlewis Nov 27, 2020
7d6cd82
colflow: store type resolver as a non-pointer type
jordanlewis Nov 27, 2020
beb56d4
execinfra: keep SemaCtx memory in ProcessorBase
jordanlewis Nov 27, 2020
46bc274
descs: remove pointless log allocs on the hot path
jordanlewis Nov 28, 2020
0bd8a5d
descs: avoid heap allocation for TableName
jordanlewis Nov 28, 2020
ddee2d4
Merge #56587
Dec 1, 2020
05013a1
roachpb: add ContentionEvent
asubiotto Dec 1, 2020
05a34d3
sql: add cumulative contention time to KV operations in EXPLAIN ANALYZE
asubiotto Dec 1, 2020
5faa952
Merge #56906
Dec 1, 2020
c5c4165
Merge #50869
Dec 1, 2020
0bcea47
Merge #57254
Dec 1, 2020
9bae8ba
Merge #57197
Dec 1, 2020
e6f9184
Merge #56968 #57179 #57201
Dec 1, 2020
6785859
Merge #57266
Dec 1, 2020
93dbe44
RFCS: draft of transactional schema changes
ajwerner Sep 15, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.pb.* -diff
*.eg.go -diff
DEPS.bzl -diff
10 changes: 7 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
/pkg/sql/sem/builtins/ @cockroachdb/sql-api-prs

/pkg/cli/ @cockroachdb/cli-prs
/pkg/server/ @cockroachdb/cli-prs

/pkg/ccl/backupccl/ @cockroachdb/bulk-prs
/pkg/ccl/importccl/ @cockroachdb/bulk-prs
Expand All @@ -32,6 +33,9 @@
/pkg/geo @cockroachdb/geospatial

/pkg/ui/ @cockroachdb/admin-ui-prs
/pkg/ui/embedded.go
/pkg/ui/src/js/protos.d.ts
/pkg/ui/src/js/protos.js
/pkg/ui/embedded.go @cockroachdb/admin-ui-prs
/pkg/ui/src/js/protos.d.ts @cockroachdb/admin-ui-prs
/pkg/ui/src/js/protos.js @cockroachdb/admin-ui-prs

/docs/generated/http @cockroachdb/http-api-prs
/pkg/cmd/docgen/http.go @cockroachdb/http-api-prs
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ customenv.mk
# Generated files containing include paths.
zcgo_flags*.go
build/Railroad.jar

# Bazel generated symlinks
/bazel-*
13 changes: 0 additions & 13 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,9 @@
[submodule "c-deps/jemalloc"]
path = c-deps/jemalloc
url = https://github.com/cockroachdb/jemalloc.git
[submodule "c-deps/rocksdb"]
path = c-deps/rocksdb
url = https://github.com/cockroachdb/rocksdb.git
[submodule "c-deps/snappy"]
path = c-deps/snappy
url = https://github.com/cockroachdb/snappy.git
ignore = untracked
[submodule "c-deps/protobuf"]
path = c-deps/protobuf
url = https://github.com/cockroachdb/protobuf.git
[submodule "c-deps/cryptopp"]
path = c-deps/cryptopp
url = https://github.com/cockroachdb/cryptopp.git
[submodule "c-deps/googletest"]
path = c-deps/googletest
url = https://github.com/cockroachdb/googletest
[submodule "pkg/ui/yarn-vendor"]
path = pkg/ui/yarn-vendor
url = https://github.com/cockroachdb/yarn-vendored
Expand Down
8 changes: 8 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
Aaditya Sondhi <aadityas@cockroachlabs.com>
Aaron Blum <aaron@cockroachlabs.com>
Aaron Dunnington <aaron.dunnington@gmail.com> aarondunnington <aaron.dunnington@gmail.com>
Aaron Zinger <zinger@cockroachlabs.com>
Aayush Shah <aayush.shah15@gmail.com> <@cockroachlabs.com>
Abby Hersh <abby@cockroachlabs.com>
Abbey Russell <abbey@cockroachlabs.com> Abigail Russell <abigail.michelle.russell@gmail.com> <amruss@mit.edu>
Abhishek Madan <abhi.madan01@gmail.com> <abhimadan@users.noreply.github.com> <abhishek@cockroachlabs.com> Abhemailk abhi.madan01@gmail.com <abhishek@cockroachlabs.com>
Abhishek Soni <abhishek.rocks26@gmail.com>
Abhishek Saha <as1695@scarletmail.rutgers.edu> AbhishekSaha <as1695@scarletmail.rutgers.edu>
Expand All @@ -33,6 +35,7 @@ Adam Yao <adam.yao.qinglin@gmail.com>
Aditya Maru <adityamaru@gmail.com> <@cockroachlabs.com>
Aid Idrizović <idrizovicaid@gmail.com>
Ajaya Agrawal <ajku.agr@gmail.com>
Alan Acosta <acostas.alan@gmail.com>
Alex Gaynor <alex.gaynor@gmail.com>
Alex Lunev <lunevalex@gmail.com> <alexl@cockroachlabs.com>
Alex Robinson <alexdwanerobinson@gmail.com> <arob@google.com> <@cockroachlabs.com>
Expand Down Expand Up @@ -127,6 +130,7 @@ Harshit Chopra <harshit@squareup.com>
Hayden A. James <hayden.james@gmail.com>
Helen He <helenhe.mit@gmail.com> <@cockroachlabs.com>
Ibrahim AshShohail <ibra.sho@gmail.com>
Ian Evans <ian@cockroachlabs.com>
Igor Kharin <igorkharin@gmail.com>
il9ue <oodanq@gmail.com>
Irfan Sharif <irfanmahmoudsharif@gmail.com> irfan sharif <irfanmahmoudsharif@gmail.com> <@cockroachlabs.com>
Expand Down Expand Up @@ -203,6 +207,7 @@ Manik Surtani <manik@squareup.com> <manik@surtani.org>
Marc Berhault <marc.berhault@gmail.com> marc <marc@cockroachlabs.com> MBerhault <marc.berhault@gmail.com>
Marcus Gartner <marcus@cockroachlabs.com> <magartner@gmail.com>
Marcus Westin <marcus.westin@gmail.com>
Marius Posta <marius@cockroachlabs.com>
Marko Bonaći <mbonaci@users.noreply.github.com>
Martin Bertschler <mbertschler@gmail.com>
Masha Schneider <masha@cockroachlabs.com> <mshv14282@gmail.com>
Expand All @@ -213,9 +218,12 @@ Matthew O'Connor <matthew@squareup.com> <matthew.t.oconnor@gmail.com>
Max Lang <max@cockroachlabs.com> <maxwell.g.lang@gmail.com>
Mayank Oli <mayankoli96@gmail.com>
mbonaci <mbonaci@gmail.com>
Miguel Novelo <miguel.novelo@digitalonus.com> <jmnovelov@gmail.com>
mike czabator <michaelc@cockroachlabs.com>
Mo Firouz <mofirouz@mofirouz.com>
Mohamed Elqdusy <mohamedelqdusy@gmail.com>
Monica Xu <monicax@cockroachlabs.com> <mokaixu@gmail.com>
Namrata Kodali <namrata@cockroachlabs.com> <namrata.kodali@gmail.com>
Nate Stewart <nathaniel.p.stewart@gmail.com> Nate <nathaniel.p.stewart@gmail.com> <nate@cockroachlabs.com>
Nathan Johnson <njohnson@ena.com>
Nathan VanBenschoten <nvanbenschoten@gmail.com> <@cockroachlabs.com>
Expand Down
110 changes: 110 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
load("@bazel_gazelle//:def.bzl", "gazelle")

# The following directives inform gazelle how to auto-generate BUILD.bazel
# files throughout the repo. By including them here, we can run gazelle using
# `bazel run //:gazelle` instead of invoking gazelle directly.
#
# NB: Be sure to re-generate BUILD.bazel files if any of the directives below
# are changed.

# Define the gazelle prefix and what the autogenerated BUILD files should be
# named as.
#
# gazelle:prefix github.com/cockroachdb/cockroach
# gazelle:build_file_name BUILD.bazel

# We disable protobuf generation for our dependencies
#
# gazelle:proto disable_global

# Gazelle is unable to resolve this specific package.
#
# TODO(irfansharif): I'm not sure why this is. Is it because it's a proto only
# package?
#
# gazelle:resolve go github.com/grpc-ecosystem/grpc-gateway/internal //vendor/github.com/grpc-ecosystem/grpc-gateway/internal

# We exclude a few things from gazelle consideration:
# - The protobuf C dependency, it's are already bazel-ified, lest we overwrite
# those build files.
# - The artifacts directory
# - All checked-in autogenerated files (they'll get autogenerated on the fly
# through bazel).
# - A testdata "repo" that looks like a go package, but isn't
# (testdata/src/example.com)
#
# gazelle:exclude c-deps/protobuf
# gazelle:exclude artifacts
# gazelle:exclude **/zcgo_flags.go
# gazelle:exclude **/zcgo_flags_*.go
# gazelle:exclude **/*.og.go
# gazelle:exclude **/*.eg.go
# gazelle:exclude pkg/sql/parser/sql.go
# gazelle:exclude pkg/sql/opt/rule_name_string.go
# gazelle:exclude pkg/sql/opt/rule_name_string.go
# gazelle:exclude pkg/cmd/prereqs/testdata

# Generally useful references:
#
# https://docs.bazel.build/versions/master/user-manual.html
# https://docs.bazel.build/versions/master/guide.html

# TODO(irfansharif): Today we let bazel take over the vendor directory and
# define each vendored dependency as a bazel target. We should be able to have
# bazel ignore all of vendor/ and create those dependencies on the fly.
# Deleting the vendor directory and running `bazel run //:gazelle` shows what
# that would look like (though that doesn't quite work yet).

# TODO(irfansharif): Document a few usage patterns for bazel and how to
# understand all the autogen stuff. Probably as a tech note. Here are a few
# short hands I've used so far:
#
# bazel test //pkg/kv/kvserver/concurrency/...
# bazel test //pkg/kv/kvserver:all --test_cache_results=no --test_output=all
# bazel test --features race //pkg/kv/kvserver/concurrency/... --test_output=all \
# --test_arg='-test.v' --test_arg='-show-logs' --test_filter='TestBTreeClone.*' \
# --run_under='stress -maxtime=120s' --cache_test_results=no
# bazel build //pkg/sql/opt
# bazel build //pkg/sql/opt:all
# bazel build //pkg/sql/colexec:gen-exec
# bazel build //pkg/cmd/cockroach-short
# bazel build //:libjemalloc
# bazel query //pkg/sql/colexec:all
# bazel run //:gazelle
# bazel run //pkg/cmd/cockroach-short -- demo
# bazel run //pkg/sql/opt/optgen/cmd/langgen -- -h
# bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro=DEPS.bzl%go_deps
#
# The //<stuff> names can also be fully qualified using @cockroach, and that
# appears in certain parts of the codebase/elsewhere. Specifically it'll look
# like:
#
# bazel build @cockroach//pkg/cmd/cockroach-short
#
# TODO(irfansharif): We should define shorthands for all of the above. See
# https://docs.bazel.build/versions/master/skylark/tutorial-custom-verbs.html

# TODO(irfansharif): The way we currently generate code through bazel, that
# code is only available within the bazel sandbox. Bazel ignores all
# the pre-generated code that is already checked into the codebase (through
# `make generate`/etc.) through the exclude directives above. It's generating
# everything on the fly.
#
# As we move towards bazel, we'll want to introduce a mechanism that implants
# the generated code within the sandbox placing them "back into" the
# appropriate packages. This is to ensure we don't break existing IDEs and code
# editors which rely on files existing in the same package itself (as opposed
# to the sandbox). This way we could continue checking in auto-generated code.
# We should provide a bazel alternative for `make generate` that does this very
# same thing. See [1], this is a long standing issue for folks using using Go,
# bazel, and autogenerated code.
#
# [1]: https://github.com/bazelbuild/rules_go/issues/512.

# TODO(irfansharif): We'll need to pin toolchains somewhere to make sure
# everything below works as expected.

gazelle(
name = "gazelle",
prefix = "github.com/cockroachdb/cockroach",
)
Loading