The Wayback Machine - https://web.archive.org/web/20200713040130/https://github.com/cockroachdb/cockroach
Skip to content
Branch: master
Go to file
Code

Latest commit

craig[bot] and dt committed 12b58af Jul 12, 2020
51139: kvserver: check start-time above GC threshold r=dt a=dt

checkExecutionCanProceed typically checks that a request that is intending to
operate at a specific time will be doing so at or above the GC threshold.

It previously did this by comparing the ba.Timestamp to the (implied) GC
threshold, as this is the common field on all batches that indicate the
time at which they will operate. However a few special types of requests
operate on *a span* of time, rather than at a particular time. For
example, ExportRequest can ask to export all revisions between its
start and end times, or RevertRange can ask that all revisions between
its TargetTime and EndTime be destoryed. These commands require that
the GC threshold be not just below their end-time -- which they set
in ba.Timestamp, but also below their start-time, to ensure those
revisions they want to operate on are still there.

Previously they each checked this manually during evaluation. However
these checks were inconsistent with the common check that the kvserver
usually does on ba.Timestamp before even calling evaluation: they used
a different error type and, when the common check was extended to be
strict w.r.t. the TTL, they continued to only check the actual GC time.

This change instead updates that common check to read the ealier of the
batch timestamp or, if one of the requests in the batch is known to have
a start time, the earliest of those times. This then means that the
enforcement of 'this batch is operating at a timestamp above the GC TTL'
has the same semantics for batches thatt operate at a single time or on
a span of time.

Release note: none.

Co-authored-by: David Taylor <tinystatemachine@gmail.com>

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
pkg
Jul 12, 2020

README.md


CockroachDB is a cloud-native SQL database for building global, scalable cloud services that survive disasters.

What is CockroachDB?

CockroachDB is a distributed SQL database built on a transactional and strongly-consistent key-value store. It scales horizontally; survives disk, machine, rack, and even datacenter failures with minimal latency disruption and no manual intervention; supports strongly-consistent ACID transactions; and provides a familiar SQL API for structuring, manipulating, and querying data.

For more details, see our FAQ or architecture document.

Docs

For guidance on installation, development, deployment, and administration, see our User Documentation.

Quickstart

  1. Install CockroachDB.
  2. Start a local cluster and talk to it via the built-in SQL client.
  3. Learn more about CockroachDB SQL.
  4. Use a PostgreSQL-compatible driver or ORM to build an app with CockroachDB.
  5. Explore core features, such as data replication, automatic rebalancing, and fault tolerance and recovery.

Client Drivers

CockroachDB supports the PostgreSQL wire protocol, so you can use any available PostgreSQL client drivers to connect from various languages.

Deployment

  • Test Deployments - Easiest way to test an insecure, multi-node CockroachDB cluster.
  • Production Deployments
    • Manual - Steps to deploy a CockroachDB cluster manually on multiple machines.
    • Cloud - Guides for deploying CockroachDB on various cloud platforms.
    • Orchestration - Guides for running CockroachDB with popular open-source orchestration systems.

Need Help?

Building from source

See our wiki for more details.

Contributing

We welcome your contributions! If you're looking for issues to work on, try looking at the good first issue list. We do our best to tag issues suitable for new external contributors with that label, so it's a great way to find something you can help with!

See our wiki for more details.

Engineering discussion takes place on our public mailing list, cockroach-db@googlegroups.com, and feel free to join our Community Slack (there's a dedicated #contributors channel!) to ask questions, discuss your ideas, or connect with other contributors.

Design

For an in-depth discussion of the CockroachDB architecture, see our Architecture Guide. For the original design motivation, see our design doc.

Comparison with Other Databases

To see how key features of CockroachDB stack up against other databases, check out CockroachDB in Comparison.

See Also

You can’t perform that action at this time.