This project is mirrored from https://github.com/cockroachdb/cockroach. Updated .
  1. 06 Apr, 2020 1 commit
    • craig[bot]'s avatar
      Merge #46993 · bf8e3784
      craig[bot] authored
      46993: sql: fix max time for TIME type r=rohany a=otan
      
      inspired by https://github.com/cockroachdb/cockroach/issues/46973
      Our Max for TIME types was 23:59:59, but we can store up to 24:00:00.
      This doesn't really quite parse for lib/pq, so we have to comment out a
      test to compensate.
      
      Release note (bug fix): Previously, when using TIME as an index,
      comparisons using the '!=' operator would return incorrect results if
      '24:00:00' is located in the index. This have been resolved in this PR.
      Co-authored-by: default avatarOliver Tan <[email protected]>
      bf8e3784
  2. 05 Apr, 2020 4 commits
    • craig[bot]'s avatar
      Merge #47048 · beac4a53
      craig[bot] authored
      47048: sql: pass stopper.ShouldQuiesce() to retryFunc for TemporaryObjectCleaner r=RaduBerinde a=otan
      
      Resolves https://github.com/cockroachdb/cockroach/issues/47047.
      
      This fixes a bug where the temporary object cleaner can hang during
      object shutdown by not obeying stopper.ShouldQuiesce(). I've run
      `TestChartCatalogGen` 10 times and confirmed it all takes the same
      amount of time.
      
      Release note: None
      Co-authored-by: default avatarOliver Tan <[email protected]>
      beac4a53
    • craig[bot]'s avatar
      Merge #46911 · 704b094e
      craig[bot] authored
      46911: jobs: fix order of `error.Is` arguments r=spaskob a=spaskob
      
      The order of the `error.Is` arguments has been reversed.
      Fortunately this has not caused a bug yet since the
      errors compared are actually identical but may cause error
      in the future.
      
      Release justification: no-op change that prevents future bugs from
      occurring.
      
      Release note (bug fix): this is actually just a potential and this
      change prevents it from becoming a bug if the error is extended in
      the future.
      Co-authored-by: default avatarSpas Bojanov <[email protected]>
      704b094e
    • Oliver Tan's avatar
      sql: pass stopper.ShouldQuiesce() to retryFunc for TemporaryObjectCleaner · 6dd15623
      Oliver Tan authored
      Resolves https://github.com/cockroachdb/cockroach/issues/47047.
      
      This fixes a bug where the temporary object cleaner can hang during
      object shutdown by not obeying stopper.ShouldQuiesce(). I've run
      `TestChartCatalogGen` 10 times and confirmed it all takes the same
      amount of time.
      
      Release note: None
      6dd15623
    • craig[bot]'s avatar
      Merge #46945 · b1a0b989
      craig[bot] authored
      46945: geo: add ability to convert from Geography to S2 regions r=sumeerbhola a=otan
      
      This PR adds the ability to convert from Geography to S2. We currently
      do this via the geom library, to avoid having to parse any EWKB
      ourselves. This will be different in future, but is a good stop gap to
      unblock feature development.
      
      Release note: None
      Co-authored-by: default avatarOliver Tan <[email protected]>
      b1a0b989
  3. 04 Apr, 2020 7 commits
    • craig[bot]'s avatar
      Merge #47023 · fe1a523e
      craig[bot] authored
      47023: sql: add bit support for bit_or aggregate function r=yuzefovich a=DrewKimball
      
      Previously, the bit_or aggregate function only worked with INT
      types. This commit adds support for BIT and VARBIT types.
      
      Fixes #45841
      
      Release note (sql change): bit_or aggregate function now supports
      BIT and VARBIT data types.
      Co-authored-by: default avatarDrew Kimball <[email protected]>
      fe1a523e
    • Drew Kimball's avatar
      sql: add bit support for bit_or aggregate function · ce4ef35b
      Drew Kimball authored
      Previously, the bit_or aggregate function only worked with INT
      types. This commit adds support for BIT and VARBIT types.
      
      Fixes #45841
      
      Release note (sql change): bit_or aggregate function now supports
      BIT and VARBIT data types.
      ce4ef35b
    • craig[bot]'s avatar
      Merge #46504 · f0dd0893
      craig[bot] authored
      46504: sqlmigrations: add migration for 19.2-style schema change jobs r=lucy-zhang a=lucy-zhang
      
      # sqlmigrations: add migration for 19.2-style schema change jobs
      
      This PR adds a migration which upgrades the format of any 19.2 schema
      change jobs that remain on a cluster after upgrading to 20.1, so that
      those schema changes can run to completion.
      
      For context, note that schema change execution in 19.2 and 20.1 are
      mutually incompatible, and 20.1 nodes are forbidden both from initiating
      new schema changes before upgrade finalization and from attempting to
      run 19.2-style schema changes. Any 19.2 schema changes that linger on
      the cluster as a result of being in progress while upgrading the cluster
      to have 20.1 binaries must be upgraded to the 20.1 job format before
      they can be run in the 20.1 schema change job resumer.
      
      This migration is run inside an async task started in `server.Start()`
      after most of the other server state is initialized, and is separate
      from the existing startup migrations which must be finished before the
      node fully starts up. The migration itself must first wait for the
      cluster upgrade to be finalized, to ensure the absence of any 19.2
      binaries from the cluster. After upgrade finalization, the migration is
      attempted in the background until it finishes successfully. Once any
      given job undergoes the migration, it is eligible to be adopted by the
      job registry.
      
      The migration has 2 steps: In the first step, we scan all jobs, look up
      the table descriptor for each job, and update the job state based on the
      schema change-related state on the table descriptor. For jobs that are
      waiting for GC for a dropped index, table, etc., we mark the job as
      successful and create a GC job. In the second step, we scan all
      descriptors and running jobs, and create a new job for each table that
      is either being added or has draining names which does not have a
      running schema change job. Tables in either of those two states used to
      rely on a schema changer in 19.2 to move them out of those intermediate
      states, and now require a job in 20.1.
      
      As with the existing startup migrations, we write KVs to the
      `system-version/` span to checkpoint the progress of the migration.
      
      Closes #46177.
      
      Release justification: This is needed to support the upgrade path for
      the new schema change job.
      
      Release note (general change): Schema changes started in 19.2 will now
      be automatically migrated in the background in 20.1 after upgrade
      finalization so that they can run to completion.
      
      ----
      
      # sql: add schema change migration testing
      
      This commit introduces a testing framework which tests the migration of
      schema changes from the 19.2 to the 20.1 format. A test case is created
      for each type of schema change so that they can be stressed and
      testrace'd individually. For each schema change, the test will:
      
      1. Create a 20.1 schema change.
      2. Block the schema change at a certain point in its execution.
      3. Mutate the job descriptor and table descriptor such that it appears
      as a 19.2 format job. These jobs will not be resumed anymore as 20.1
      will refuse to run 19.2 jobs.
      4. Verify that the job has been marked as a 19.2 job and is blocked.
      5. Run the migration and wait for the migration to complete.
      6. Ensure that the schema change completes.
      
      Release justification: testing feature required for release.
      Release note: None
      
      ----
      
      # testing: increase timeout for CI stress tests
      
      This commit increases the timeout on CI so that make stressrace can
      complete. There should be a follow up investigation as to why these
      tests take this long to complete.
      
      Release note: None
      
      ----
      
      # importccl: set system config trigger in TestGetDescriptorFromDB
      
      The transaction used to write database descriptors in
      `TestGetDescriptorFromDB` was missing a call to
      `txn.SetSystemConfigTrigger()`. This would be caught by
      `CheckEndTxnTrigger` in some cases, in `CreateTestServerParams()`, but
      it looks like the error generated by `CheckEndTxnTrigger` to indicate
      that the trigger had not been set was consistently being swallowed in
      `*txnCommitter.makeTxnCommitExplicitAsync()`, causing the test to pass
      anyway. This test started failing with the introduction of the migration
      to update schema change jobs, which needs to read all descriptors, and
      in doing so somehow causes the error from `CheckEndTxnTrigger` to not be
      swallowed anymore. This PR fixes the test.
      
      Release note: None
      Co-authored-by: default avatarLucy Zhang <[email protected]>
      Co-authored-by: default avatarPaul Bardea <[email protected]>
      f0dd0893
    • craig[bot]'s avatar
      Merge #46952 · 82fec00c
      craig[bot] authored
      46952: kv: batch ranged intent resolution r=nvanbenschoten a=nvanbenschoten
      
      Fixes #46752.
      Resolves the recent perf regression on TPC-C.
      
      This commit follows in the footsteps of #34803 and introduces batching for ranged intent resolution, where previously only point intent resolution was batched. As we found in #46752, this is more important than it has been in the past, because implicit SELECT FOR UPDATE acquires a ranged lock on each row that it updates instead of a single-key lock.
      
      The change addresses this by adding a third request batcher to IntentResolver. ResolveIntent requests and ResolveIntentRange requests are batched separately, which is necessary for the use of MaxSpanRequestKeys to work properly (in fact, to be accepted by DistSender at all).
      
      To accommodate the ranged nature of ResolveIntentRange request, the notion of pagination is introduced into RequestBatcher. A MaxKeysPerBatchReq option is added to the configuration of a RequestBatcher, which corresponds to the MaxSpanRequestKeys value set on each BatchRequest header. The RequestBatcher is then taught about request pagination and how to work with partial responses. The semantics at play here are clarified in an earlier commit in the PR.
      
      Release justification: important fix to avoid a performance regression when implicit SELECT FOR UPDATE is enabled. All commits except the last are testing-only. The last commit is subtle but small and well-tested.
      
      @andreimatei: I assigned you because I think you know the most about `MaxSpanRequestKeys`. I'm mostly interested to get your input on the "rationalize Header.MaxSpanRequestKeys" commit (testing + comments only).
      Co-authored-by: default avatarNathan VanBenschoten <[email protected]>
      82fec00c
    • Nathan VanBenschoten's avatar
      kv: batch ranged intent resolution · cf11645a
      Nathan VanBenschoten authored
      Fixes #46752.
      Resolves the recent perf regression on TPC-C.
      
      This commit follows in the footsteps of #34803 and introduces batching for
      ranged intent resolution, where previously only point intent resolution was
      batched. As we found in #46752, this is more important than it has been in
      the past, because implicit SELECT FOR UPDATE acquires a ranged lock on each
      row that it updates instead of a single-key lock.
      
      The change addresses this by adding a third request batcher to IntentResolver.
      ResolveIntent requests and ResolveIntentRange requests are batched separately,
      which is necessary for the use of MaxSpanRequestKeys to work properly (in fact,
      to be accepted by DistSender at all).
      
      To accommodate the ranged nature of ResolveIntentRange request, the notion of
      pagination is introduced into RequestBatcher. A MaxKeysPerBatchReq option is
      added to the configuration of a RequestBatcher, which corresponds to the
      MaxSpanRequestKeys value set on each BatchRequest header. The RequestBatcher is
      then taught about request pagination and how to work with partial responses. See
      the previous commit for clarification about the semantics at play here.
      
      Release justification: important fix to avoid a performance regression when
      implicit SELECT FOR UPDATE is enabled.
      cf11645a
    • craig[bot]'s avatar
      Merge #46954 · 847396e3
      craig[bot] authored
      46954: sql: add bit support for bit_and aggregate function r=yuzefovich a=DrewKimball
      
      Previously, the bit_and aggregate function only worked with INT
      types. This commit adds support for BIT and VARBIT types.
      
      Fixes #45841
      
      Release note (sql change): bit_and aggregate function now supports BIT
      and VARBIT data types.
      Co-authored-by: default avatarDrew Kimball <[email protected]>
      847396e3
    • craig[bot]'s avatar
      Merge #47014 · 709969b8
      craig[bot] authored
      47014: sql: update description returned by EXPLAIN ANALYZE (DEBUG) r=RaduBerinde a=RaduBerinde
      
      Updating the returned text to match the UI wording and to include the "bare" UI
      link; example:
      ```
                                            text
      --------------------------------------------------------------------------------
        Statement diagnostics bundle generated. Download from the Admin UI (Advanced
        Debug -> Statement Diagnostics History) or use the direct link below.
        Admin UI: http://127.0.0.1:37023
        Direct link: http://127.0.0.1:37023/_admin/v1/stmtbundle/543551741425713153
      ```
      
      Release note: None
      Co-authored-by: default avatarRadu Berinde <[email protected]>
      709969b8
  4. 03 Apr, 2020 28 commits
    • Drew Kimball's avatar
      sql: add bit support for bit_and aggregate function · 30cfb851
      Drew Kimball authored
      Previously, the bit_and aggregate function only worked with INT
      types. This commit adds support for BIT and VARBIT types.
      
      Partially fixes #45841. Will add bit_or aggregate support later.
      
      Release note (sql change): bit_and aggregate function now supports BIT
      and VARBIT data types.
      30cfb851
    • Nathan VanBenschoten's avatar
      kv: rationalize Header.MaxSpanRequestKeys + unordered/overlapping requests · 5ec87f17
      Nathan VanBenschoten authored
      This commit improves the contract around MaxSpanRequestKeys and its interaction
      with overlapping and unsorted requests. Instead of saying that only sorted,
      non-overlapping requests were allowed in a batch with a limit (which was not
      being respected by users of the KV API), we now discuss what callers should
      expect if they cannot provide one or both of these guarantees.
      
      The commit then improves the testing around this area.
      5ec87f17
    • Nathan VanBenschoten's avatar
      testutils: delete Caller · 27017234
      Nathan VanBenschoten authored
      This uses of this have long-since been replaceable by `t.Helper()`.
      27017234
    • Nathan VanBenschoten's avatar
      testutils: delete MakeCaller · ba82c6e8
      Nathan VanBenschoten authored
      This has long-since been replaced by `t.Helper()`.
      ba82c6e8
    • Nathan VanBenschoten's avatar
      roachpb: extract CombineResponses function · 5d02934a
      Nathan VanBenschoten authored
      Previously, the only way to access this functionality outside of
      the roachpb package was through the BatchResponse.Combine method.
      There doesn't seem to be a strong reason for this encapsulation,
      given that Response is an exported part of the roachpb interface.
      5d02934a
    • Nathan VanBenschoten's avatar
      client/requestbatcher: don't force *BatchResponse onto heap · 531d9883
      Nathan VanBenschoten authored
      Before this change, `var br *roachpb.BatchResponse` was being forced
      onto the heap:
      ```
      $ goescape . | grep moved
      ./batcher.go:262:6: moved to heap: br
      ```
      
      By moving the closures into the RunWorker function, we avoid the
      allocation:
      ```
      $ goescape . | grep moved | wc -l
      0
      ```
      
      Release justification: probably none. I'll sit on this if it's alone.
      531d9883
    • Oliver Tan's avatar
      sql: fix max time for TIME type · 32545600
      Oliver Tan authored
      Our Max for TIME types was 23:59:59, but we can store up to 24:00:00.
      This doesn't really quite parse for lib/pq, so we have to comment out a
      test to compensate.
      
      Release note (bug fix): Previously, when using TIME as an index,
      comparisons using the '!=' operator would return incorrect results if
      '24:00:00' is located in the index. This have been resolved in this PR.
      32545600
    • Lucy Zhang's avatar
      importccl: set system config trigger in TestGetDescriptorFromDB · f2aad4bf
      Lucy Zhang authored
      The transaction used to write database descriptors in
      `TestGetDescriptorFromDB` was missing a call to
      `txn.SetSystemConfigTrigger()`. This would be caught by
      `CheckEndTxnTrigger` in some cases, in `CreateTestServerParams()`, but
      it looks like the error generated by `CheckEndTxnTrigger` to indicate
      that the trigger had not been set was consistently being swallowed in
      `*txnCommitter.makeTxnCommitExplicitAsync()`, causing the test to pass
      anyway. This test started failing with the introduction of the migration
      to update schema change jobs, which needs to read all descriptors, and
      in doing so somehow causes the error from `CheckEndTxnTrigger` to not be
      swallowed anymore. This PR fixes the test.
      
      Release note: None
      f2aad4bf
    • Radu Berinde's avatar
      sql: update description returned by EXPLAIN ANALYZE (DEBUG) · 6d2ac3fd
      Radu Berinde authored
      Updating the returned text to match the UI wording and to include the "bare" UI
      link; example:
      ```
                                            text
      --------------------------------------------------------------------------------
        Statement diagnostics bundle generated. Download from the Admin UI (Advanced
        Debug -> Statement Diagnostics History) or use the direct link below.
        Admin UI: http://127.0.0.1:37023
        Direct link: http://127.0.0.1:37023/_admin/v1/stmtbundle/543551741425713153
      ```
      
      Release note: None
      6d2ac3fd
    • craig[bot]'s avatar
      Merge #46984 · 072da6b2
      craig[bot] authored
      46984: geo/geos: refactor C++ initialization code r=petermattis a=petermattis
      
      Refactor the C++ initialization code, and remove the `CR_GEOS_` from
      member names. The latter seems to fix a warning that some C++ compilers
      complain about.
      
      Release note: None
      Co-authored-by: default avatarPeter Mattis <[email protected]>
      072da6b2
    • craig[bot]'s avatar
      Merge #46983 · f449bb1e
      craig[bot] authored
      46983: kvserver: make sure an error makes it to the logs r=tbg a=tbg
      
      We were reporting this error, but not necessarily printing it. It is
      helpful to have it in the logs.
      
      Release note: None
      Co-authored-by: default avatarTobias Schottdorf <[email protected]>
      f449bb1e
    • craig[bot]'s avatar
      Merge #46708 · 18a24f4d
      craig[bot] authored
      46708: sql: clarify 'SPANS ALL' is EXPLAIN output r=yuzefovich a=yuzefovich
      
      Release justification: UX improvement of explain output.
      
      Fixes: #44403.
      
      Release note (sql change): CockroachDB will now be more verbose about
      full scans when executing `EXPLAIN`, previously, we would output
      `SPANS | ALL`, now it will be `SPANS | FULL SCAN` or (if there is
      a limit) `SPANS | LIMITED SCAN`.
      Co-authored-by: default avatarYahor Yuzefovich <[email protected]>
      18a24f4d
    • craig[bot]'s avatar
      Merge #46953 #46991 · a15c57e7
      craig[bot] authored
      46953: config/zonepb: fix typo in DefaultSystemZoneConfig r=nvanbenschoten a=ajwerner
      
      This change fixes a typo that made the default system zone config gigabytes
      instead of megabytes. Fortunately this was both not released in an official
      release and also system ranges aren't generally gigantic.
      
      Nevertheless, this is pretty egregious.
      
      Release note: None
      
      46991: cli/demo: move the demo cluster code to its own file r=rohany a=knz
      
      Requested by @rohany . 
      First two commits from separate PRs #46979 and #46989 - please ignore.
      Co-authored-by: default avatarAndrew Werner <[email protected]>
      Co-authored-by: default avatarRaphael 'kena' Poss <[email protected]>
      a15c57e7
    • Oliver Tan's avatar
      geo: add ability to convert from Geography to S2 regions · fd518d5d
      Oliver Tan authored
      This PR adds the ability to convert from Geography to S2. We currently
      do this via the geom library, to avoid having to parse any EWKB
      ourselves. This will be different in future, but is a good stop gap to
      unblock feature development.
      
      Release note: None
      fd518d5d
    • Peter Mattis's avatar
      geo/geos: clang-format the C++ code · 1872ff85
      Peter Mattis authored
      Copy the clang-format config from `c-deps/libroach`.
      
      Release note: None
      1872ff85
    • Raphael 'kena' Poss's avatar
      cli/demo: move the demo cluster code to its own file · 320fce9c
      Raphael 'kena' Poss authored
      Release note: None
      320fce9c
    • Raphael 'kena' Poss's avatar
      cli/demo: prevent a call to os.Exit in the license goroutine · 53b33935
      Raphael 'kena' Poss authored
      Prior to this patch, the async goroutine responsible for license
      acquisition was also taking over the responsibility to call os.Exit.
      
      This was sad because it meant that in case license acquisition failed,
      the temporary files created for the demo cluster were not cleaned up.
      
      This patch repairs that by bringing error handling back into the main
      goroutine.
      
      (It's still possible for demo to leave stray files behind - see
      https://github.com/cockroachdb/cockroach/issues/46988 - and that will
      need a separate patch.)
      
      Release note (bug fix): `cockroach demo` now properly cleans up its
      temporary files if the background license acquisition fails.
      53b33935
    • craig[bot]'s avatar
      Merge #46979 · 939d6f8b
      craig[bot] authored
      46979: cli/demo: simplify the SQL connection parameters r=rohany a=knz
      
      First commit from #46968. 
      Requested/recommended by @aaron-crl 
      
      Prior to this patch, the `cockroach demo` shell was advertising SQL
      client URLs that were dependent on TLS client certs. This makes it
      overly reliant on the client app having access to the cert files,
      which in a multi-user system may not be easy to achieve.
      
      This patch improves the situation as follows:
      
      - the generated SQL connection URL, when in secure mode, now requires
        TLS (`sslmode=require`) but uses a password to authenticate the
        client instead of a client cert.
      
      - when running on unix, a unix socket is also configured.
        The socket URL, if available, is also displayed because
        alongside the TCP URL.
      
      Example:
      
      ```
         $ ./cockroach demo  --nodes 2
         #
         # Welcome to the CockroachDB demo database!
         #
         ...
         # Connection parameters:
         # node 1:
         #   (console) http://127.0.0.1:36732
         #   (sql)     postgres://root:[email protected]?host=%2Ftmp%2Fdemo806076655&port=26257
         #   (sql/tcp) postgres://root:[email protected]:43251?sslmode=require
         #
         # node 2:
         #   (console) http://127.0.0.1:31261
         #   (sql)     postgres://root:[email protected]?host=%2Ftmp%2Fdemo806076655&port=26258
         #   (sql/tcp) postgres://root:[email protected]:13130?sslmode=require
         #
         # Enter \? for a brief introduction.
         #
         [email protected]:43251/movr>
      ```
      
      Additionally, the new client-side command `\demo ls` enables the user
      to re-display the connection URLs during an interactive demo.
      
      For example:
      
      ```
      [email protected]:43251/movr> \demo ls
      node 1:
        (console) http://127.0.0.1:36732
        (sql)     postgres://root:[email protected]?host=%2Ftmp%2Fdemo806076655&port=26257
        (sql/tcp) postgres://root:[email protected]:43251?sslmode=require
      
      node 2:
        (console) http://127.0.0.1:31261
        (sql)     postgres://root:[email protected]?host=%2Ftmp%2Fdemo806076655&port=26258
        (sql/tcp) postgres://root:[email protected]:13130?sslmode=require
      ```
      
      Release note (cli change): The `cockroach demo` now displays a
      connection URL using a unix datagram socket before the TCP-based URL,
      as this may deliver better performance in clients running on the same
      system.
      
      Release note (cli change): the SQL URL generated by `cockroach demo`,
      when running in the secure mode, now embed the password. This way,
      a command ran by copy-pasting the URL is able to run without asking
      for a password first.
      
      Release note (cli change): the SQL URL generated by `cockroach demo`
      is simplified to not require TLS client certificates in particular
      directory locations.
      
      Release note (cli change): the new client-side command `\demo
      ls` (experimental) can now (re-)display the connection parameters for
      every node in the simulated cluster.
      Co-authored-by: default avatarRaphael 'kena' Poss <[email protected]>
      939d6f8b
    • Peter Mattis's avatar
      geo/geos: refactor C++ initialization code · 387b533c
      Peter Mattis authored
      Refactor the C++ initialization code, and remove the `CR_GEOS_` from
      member names. The latter seems to fix a warning that some C++ compilers
      complain about.
      
      Release note: None
      387b533c
    • Raphael 'kena' Poss's avatar
      cli/demo: simplify the SQL connection parameters · 404142df
      Raphael 'kena' Poss authored
      Prior to this patch, the `cockroach demo` shell was advertising SQL
      client URLs that were dependent on TLS client certs. This makes it
      overly reliant on the client app having access to the cert files,
      which in a multi-user system may not be easy to achieve.
      
      This patch improves the situation as follows:
      
      - the generated SQL connection URL now requires
        TLS (`sslmode=require`) but uses a password to authenticate the
        client instead of a client cert.
      
      - when running on unix, a unix socket is also configured.
        The socket URL, if available, is also displayed because
        alongside the TCP URL.
      
      Example:
      
      ```
         $ ./cockroach demo  --nodes 2
         #
         # Welcome to the CockroachDB demo database!
         #
         ...
         # Connection parameters:
         # node 1:
         #   (console) http://127.0.0.1:36732
         #   (sql)     postgres://root:[email protected]?host=%2Ftmp%2Fdemo806076655&port=26257
         #   (sql/tcp) postgres://root:[email protected]:43251?sslmode=require
         #
         # node 2:
         #   (console) http://127.0.0.1:31261
         #   (sql)     postgres://root:[email protected]?host=%2Ftmp%2Fdemo806076655&port=26258
         #   (sql/tcp) postgres://root:[email protected]:13130?sslmode=require
         #
         # Enter \? for a brief introduction.
         #
         [email protected]:43251/movr>
      ```
      
      Additionally, the new client-side command `\demo ls` enables the user
      to re-display the connection URLs during an interactive demo.
      
      For example:
      
      ```
      [email protected]:43251/movr> \demo ls
      node 1:
        (console) http://127.0.0.1:36732
        (sql)     postgres://root:[email protected]?host=%2Ftmp%2Fdemo806076655&port=26257
        (sql/tcp) postgres://root:[email protected]:43251?sslmode=require
      
      node 2:
        (console) http://127.0.0.1:31261
        (sql)     postgres://root:[email protected]?host=%2Ftmp%2Fdemo806076655&port=26258
        (sql/tcp) postgres://root:[email protected]:13130?sslmode=require
      ```
      
      Release note (cli change): The `cockroach demo` now displays a
      connection URL using a unix datagram socket before the TCP-based URL,
      as this may deliver better performance in clients running on the same
      system.
      
      Release note (cli change): the SQL URL generated by `cockroach demo`,
      when running in the secure mode, now embed the password. This way,
      a command ran by copy-pasting the URL is able to run without asking
      for a password first.
      
      Release note (cli change): the SQL URL generated by `cockroach demo`
      is simplified to not require TLS client certificates in particular
      directory locations.
      
      Release note (cli change): the new client-side command `\demo
      ls` (experimental) can now (re-)display the connection parameters for
      every node in the simulated cluster.
      404142df
    • Andrew Werner's avatar
      config/zonepb: fix typo in DefaultSystemZoneConfig · ad9042e2
      Andrew Werner authored
      This change fixes a typo that made the default system zone config gigabytes
      instead of megabytes. Fortunately this was both not released in an official
      release and also system ranges aren't generally gigantic.
      
      Nevertheless, this is pretty egregious.
      
      Release note: None
      ad9042e2
    • craig[bot]'s avatar
      Merge #46906 · f09b2bec
      craig[bot] authored
      46906: roachtest: subdue weekly/tpcc-max r=nvanbenschoten a=darinpp
      
      The existing version of weekly/tpcc-max times-out as
      the response times increase with the database growth.
      This reduces the number of warehouses to 1000 to provide
      headroom for the slowdown towards the end of the test and
      renames the test to weekly/tpcc/headroom
      
      Fixes #41163
      
      Release note: None
      Co-authored-by: default avatarDarin <[email protected]>
      f09b2bec
    • Tobias Schottdorf's avatar
      kvserver: make sure an error makes it to the logs · bf65bbb1
      Tobias Schottdorf authored
      We were reporting this error, but not necessarily printing it. It is
      helpful to have it in the logs.
      
      Release note: None
      bf65bbb1
    • Paul Bardea's avatar
      testing: increase timeout for CI stress tests · 275e620b
      Paul Bardea authored
      This commit increases the timeout on CI so that make stressrace can
      complete. There should be a follow up investigation as to why these
      tests take this long to complete.
      
      Release note: None
      275e620b
    • Paul Bardea's avatar
      sql: add schema change migration testing · 28473ec2
      Paul Bardea authored
      This commit introduces a testing framework which tests the migration of
      schema changes from the 19.2 to the 20.1 format. A test case is created
      for each type of schema change so that they can be stressed and
      testrace'd individually. For each schema change, the test will:
      
      1. Create a 20.1 schema change.
      2. Block the schema change at a certain point in its execution.
      3. Mutate the job descriptor and table descriptor such that it appears
      as a 19.2 format job. These jobs will not be resumed anymore as 20.1
      will refuse to run 19.2 jobs.
      4. Verify that the job has been marked as a 19.2 job and is blocked.
      5. Run the migration and wait for the migration to complete.
      6. Ensure that the schema change completes.
      
      Release justification: testing feature required for release.
      Release note: None
      28473ec2
    • craig[bot]'s avatar
      Merge #46801 #46968 · 1c27a9f7
      craig[bot] authored
      46801: ui: improve wording in storage tooltips r=nathanstilwell a=dhartunian
      
      Some existing tooltips discussion storage metrics
      needed adjustment to improve accuracy.
      
      Changes affect:
      
      ### Metrics
      * Overview page: Capacity graph
      * Replication page: Logical Bytes per Store
      * Storage page: Capacity and Live Bytes
      
      ### Databases
      * Database summary box: "Database Size"
      
      Some tooltips now include links to documentation
      where database operators can get much more detail
      on how these metrics are calculated and how to
      use them.
      
      Resolves #46726
      
      Release justification: low risk documentation edit
      
      Release note (admin ui change): improved tooltips
      for existing capacity and storage metrics.
      
      46968: cli: make the SQL client commands work with unix sockets r=otan a=knz
      
      Prior to this patch crdb's own CLI commands did not know how to use a
      unix socket, even though that's the standard facility offered by
      PostgreSQL and is also supported by CockroachDB servers.
      
      This patch fixes it.
      
      Release note (cli change): The `cockroach` CLI commands that
      internally use SQL, including `cockroach sql`, now can connect
      to a server using a unix datagram socket. The syntax for this
      is `--url 'postgres://[email protected]?host=/path/to/directory?port=NNNN'`.
      Co-authored-by: default avatarDavid Hartunian <[email protected]>
      Co-authored-by: default avatarRaphael 'kena' Poss <[email protected]>
      1c27a9f7
    • Raphael 'kena' Poss's avatar
      cli: make the SQL client commands work with unix sockets · 52c1dda2
      Raphael 'kena' Poss authored
      Prior to this patch crdb's own CLI commands did not know how to use a
      unix socket, even though that's the standard facility offered by
      PostgreSQL and is also supported by CockroachDB servers.
      
      This patch fixes it.
      
      Release note (cli change): The `cockroach` CLI commands that
      internally use SQL, including `cockroach sql`, now can connect
      to a server using a unix datagram socket. The syntax for this
      is `--url 'postgres://[email protected]?host=/path/to/directory?port=NNNN'`.
      52c1dda2
    • craig[bot]'s avatar
      Merge #46712 #46943 #46962 · 5d33d44a
      craig[bot] authored
      46712: colexec: populate batches for projecting operators upfront r=yuzefovich a=yuzefovich
      
      **colexec: populate batches for projecting operators upfront**
      
      Release justification: bug fix (without this, vectorized engine could
      hit internal errors in some cases).
      
      This commit introduces two utility operators `vectorTypeEnforcer` and
      `batchSchemaPrefixEnforcer` which all "projecting" operators that do not
      output their own batches need to use. This utility operators are planned
      in a such way that they wrap the input to the projecting operator and
      make sure that there is an output column of the appropriate type for
      corresponding projecting operator. For most operators, enforcing
      a single column is sufficient, however, `caseOp`, `andProjOp`, and
      `orProjOp` use side chains of projecting operators, so they need to
      enforce the vector types on the prefix of the columns from the batch, so
      they use `batchSchemaPrefixEnforcer`. Such design allows us to have
      short-circuiting logic in all operators on zero-length batches, yet it
      enforces that all vectors are correctly appended upfront.
      
      Additionally, this commit refactors several unit tests to use
      `NewColOperator` to plan the operators to test rather than instantiating
      them directly. This is done so that planning code is being tested as
      well, and it already found a deficiency in planning casts to decimals
      (namely, currently we're prohibiting all possible casts except between
      decimals of the same precision).
      
      Fixes: #46646.
      
      Release note: None
      
      **colexec: fix width mismatch for integer types in some cases**
      
      We have a limitation of our SQL type system that it doesn't respect the
      width of integer columns, however, the vectorized projecting operators
      do, and this can lead to a mismatch between expected logical and actual
      physical types in the vectorized flow. This is now fixed by planning
      a cast that "synchronizes" the reality and the expectations.
      
      Fixes: #46714.
      
      Release note (bug fix): Previously, CockroachDB could hit an internal
      error when queries with projections only of `INT2` and/or `INT4` columns
      were executed via the vectorized engine, and this has been fixed.
      
      46943: Ui telemetry metrics time picker r=nathanstilwell a=nathanstilwell
      
      fixes #45632
      
      - [x] time frame selection (including custom)
      - [x] next/previous timeframe button clicks
      - [x] "now" button clicks
      
      Added tracking events for changes to the time series on the metrics view. The events are,
      
      ### Time Scale Selected
      
      This event fires when the user selects a new time scale from the drop down.
      
      ![time-scale-select](https://user-images.githubusercontent.com/397448/78309212-61481400-7518-11ea-8d77-df25332344bd.gif)
      
      ```
      {
        userId: '9553cdfb-5cf3-4430-862c-1a7bd4ec524b',
        event: 'Time Frame Change',
        properties: {
          direction: 'previous frame',
          pagePath: '/metrics/overview/cluster'
        }
      }
      
      {
        userId: '9553cdfb-5cf3-4430-862c-1a7bd4ec524b',
        event: 'Time Frame Change',
        properties: {
          direction: 'now',
          pagePath: '/metrics/overview/cluster'
        }
      }
      ```
      
      ### Time Frame Change
      
      This event fires when the user changes the time frame using the directional controls or "now".
      
      ![time-frame-change](https://user-images.githubusercontent.com/397448/78309238-715ff380-7518-11ea-8452-62ee4adbd334.gif)
      
      ```
      {
        userId: '9553cdfb-5cf3-4430-862c-1a7bd4ec524b',
        event: 'Time Scale Selected',
        properties: {
          pagePath: '/metrics/overview/cluster',
          timeScale: 'Custom'
        }
      }
      
      {
        userId: '9553cdfb-5cf3-4430-862c-1a7bd4ec524b',
        event: 'Time Scale Selected',
        properties: {
          pagePath: '/metrics/overview/cluster',
          timeScale: 'Past 3 Days'
        }
      }
      ```
      
      46962: cli/demo: document the client-side commands r=otan a=knz
      
      Fixes #42242.
      
      This adds the missing documentation, and also shortens the command
      prefix from `\demo_node` to `\demo`. This way we can add more
      sub-commands besides shutdown/restart/etc.
      
      Release note (cli change): The client-side commands specific to
      `cockroach demo`, starting with `\demo`, are now advertised in the
      output of `\?`. Note that this feature is currently experimental.
      Co-authored-by: default avatarYahor Yuzefovich <[email protected]>
      Co-authored-by: default avatarNathan Stilwell <[email protected]>
      Co-authored-by: default avatarRaphael 'kena' Poss <[email protected]>
      5d33d44a