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

storage: leave intents behind after blind-writes experiencing write-too-old #44654

Merged
merged 3 commits into from
Feb 13, 2020

Commits on Feb 13, 2020

  1. storage: fix test stale comment

    Release note: None
    andreimatei committed Feb 13, 2020
    Configuration menu
    Copy the full SHA
    9b84126 View commit details
    Browse the repository at this point in the history
  2. storage: remove obsolete code

    Remove InclusiveTimeBounds(), a vestige that used to be more complex for
    backwards compatibility with 19.1 reasons but became obsolete when we
    cleaned up the compatibility cruft.
    
    Release note: None
    andreimatei committed Feb 13, 2020
    Configuration menu
    Copy the full SHA
    56cced1 View commit details
    Browse the repository at this point in the history
  3. storage: leave intents behind after blind-writes experiencing write-t…

    …oo-old
    
    Before this patch, any write running into a write-too-old condition
    resulted in a WriteTooOldError being returned by the server. Returning
    an error implies that no intents are left behind. This is unfortunate;
    we'd like to leave intents (or, in the future, other types of locks)
    behind so keep away other transactions. We've observed this resulting in
    the starvation of a class of transactions in a user's workload.
    
    This patch makes it so that blind writes (i.e. Puts - used by UPDATE,
    not CPuts) don't return WriteTooOldErrors any more. Instead, they return
    the a txn proto with the WriteTooOld flag set. This is the behavior they
    had before cockroachdb#38668. This patch retains the goal of cockroachdb#38668, however: the
    client now eagerly refreshes the transactions when it sees a WriteTooOld
    flag, and if the refresh succeeds, it returns a WriteTooOldError to the
    higher layers (SQL), allowing for automatic retries where applicable.
    
    Unfortunately, CPuts (used by INSERT) continue to return
    WriteTooOldErrors without leaving locks behind. Dealing with them
    requires more tenderness because they imply a read, and the timestamp of
    a read cannot be bumped as easily as that of a write.
    
    Touches cockroachdb#44653
    
    Release note (sql change): UPDATEs returning a serialization failure error (code
    40001) now leave behind a lock, helping the transaction succeed if it
    retries. This prevents starvation of transactions whose UPDATEs are
    prone to conflicts.
    andreimatei committed Feb 13, 2020
    Configuration menu
    Copy the full SHA
    da5dc5b View commit details
    Browse the repository at this point in the history