diff --git a/c-deps/libroach/protos/roachpb/data.pb.cc b/c-deps/libroach/protos/roachpb/data.pb.cc index 9f095e0b09f3..d9fa7fc6e5a2 100644 --- a/c-deps/libroach/protos/roachpb/data.pb.cc +++ b/c-deps/libroach/protos/roachpb/data.pb.cc @@ -120,6 +120,11 @@ class IntentDefaultTypeInternal { ::google::protobuf::internal::ExplicitlyConstructed _instance; } _Intent_default_instance_; +class LockAcquisitionDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _LockAcquisition_default_instance_; class LockUpdateDefaultTypeInternal { public: ::google::protobuf::internal::ExplicitlyConstructed @@ -392,6 +397,22 @@ ::google::protobuf::internal::SCCInfo<2> scc_info_Intent = &protobuf_roachpb_2fdata_2eproto::scc_info_Intent_SingleKeySpan.base, &protobuf_storage_2fenginepb_2fmvcc3_2eproto::scc_info_TxnMeta.base,}}; +static void InitDefaultsLockAcquisition() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::cockroach::roachpb::_LockAcquisition_default_instance_; + new (ptr) ::cockroach::roachpb::LockAcquisition(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::cockroach::roachpb::LockAcquisition::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_LockAcquisition = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsLockAcquisition}, { + &protobuf_roachpb_2fdata_2eproto::scc_info_Span.base, + &protobuf_storage_2fenginepb_2fmvcc3_2eproto::scc_info_TxnMeta.base,}}; + static void InitDefaultsLockUpdate() { GOOGLE_PROTOBUF_VERIFY_VERSION; @@ -502,6 +523,7 @@ void InitDefaults() { ::google::protobuf::internal::InitSCC(&scc_info_TransactionRecord.base); ::google::protobuf::internal::InitSCC(&scc_info_Intent_SingleKeySpan.base); ::google::protobuf::internal::InitSCC(&scc_info_Intent.base); + ::google::protobuf::internal::InitSCC(&scc_info_LockAcquisition.base); ::google::protobuf::internal::InitSCC(&scc_info_LockUpdate.base); ::google::protobuf::internal::InitSCC(&scc_info_SequencedWrite.base); ::google::protobuf::internal::InitSCC(&scc_info_Lease.base); @@ -4924,6 +4946,274 @@ ::std::string Intent::GetTypeName() const { } +// =================================================================== + +void LockAcquisition::InitAsDefaultInstance() { + ::cockroach::roachpb::_LockAcquisition_default_instance_._instance.get_mutable()->span_ = const_cast< ::cockroach::roachpb::Span*>( + ::cockroach::roachpb::Span::internal_default_instance()); + ::cockroach::roachpb::_LockAcquisition_default_instance_._instance.get_mutable()->txn_ = const_cast< ::cockroach::storage::enginepb::TxnMeta*>( + ::cockroach::storage::enginepb::TxnMeta::internal_default_instance()); +} +void LockAcquisition::clear_txn() { + if (GetArenaNoVirtual() == NULL && txn_ != NULL) { + delete txn_; + } + txn_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LockAcquisition::kSpanFieldNumber; +const int LockAcquisition::kTxnFieldNumber; +const int LockAcquisition::kDurabilityFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LockAcquisition::LockAcquisition() + : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_roachpb_2fdata_2eproto::scc_info_LockAcquisition.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:cockroach.roachpb.LockAcquisition) +} +LockAcquisition::LockAcquisition(const LockAcquisition& from) + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_span()) { + span_ = new ::cockroach::roachpb::Span(*from.span_); + } else { + span_ = NULL; + } + if (from.has_txn()) { + txn_ = new ::cockroach::storage::enginepb::TxnMeta(*from.txn_); + } else { + txn_ = NULL; + } + durability_ = from.durability_; + // @@protoc_insertion_point(copy_constructor:cockroach.roachpb.LockAcquisition) +} + +void LockAcquisition::SharedCtor() { + ::memset(&span_, 0, static_cast( + reinterpret_cast(&durability_) - + reinterpret_cast(&span_)) + sizeof(durability_)); +} + +LockAcquisition::~LockAcquisition() { + // @@protoc_insertion_point(destructor:cockroach.roachpb.LockAcquisition) + SharedDtor(); +} + +void LockAcquisition::SharedDtor() { + if (this != internal_default_instance()) delete span_; + if (this != internal_default_instance()) delete txn_; +} + +void LockAcquisition::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const LockAcquisition& LockAcquisition::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_roachpb_2fdata_2eproto::scc_info_LockAcquisition.base); + return *internal_default_instance(); +} + + +void LockAcquisition::Clear() { +// @@protoc_insertion_point(message_clear_start:cockroach.roachpb.LockAcquisition) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && span_ != NULL) { + delete span_; + } + span_ = NULL; + if (GetArenaNoVirtual() == NULL && txn_ != NULL) { + delete txn_; + } + txn_ = NULL; + durability_ = 0; + _internal_metadata_.Clear(); +} + +bool LockAcquisition::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::LiteUnknownFieldSetter unknown_fields_setter( + &_internal_metadata_); + ::google::protobuf::io::StringOutputStream unknown_fields_output( + unknown_fields_setter.buffer()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_output, false); + // @@protoc_insertion_point(parse_start:cockroach.roachpb.LockAcquisition) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_span())); + } else { + goto handle_unusual; + } + break; + } + + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_txn())); + } else { + goto handle_unusual; + } + break; + } + + // .cockroach.kv.kvserver.concurrency.lock.Durability durability = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_durability(static_cast< ::cockroach::kv::kvserver::concurrency::lock::Durability >(value)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:cockroach.roachpb.LockAcquisition) + return true; +failure: + // @@protoc_insertion_point(parse_failure:cockroach.roachpb.LockAcquisition) + return false; +#undef DO_ +} + +void LockAcquisition::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:cockroach.roachpb.LockAcquisition) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (this->has_span()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->_internal_span(), output); + } + + if (this->has_txn()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->_internal_txn(), output); + } + + // .cockroach.kv.kvserver.concurrency.lock.Durability durability = 3; + if (this->durability() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 3, this->durability(), output); + } + + output->WriteRaw((::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()).data(), + static_cast((::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()).size())); + // @@protoc_insertion_point(serialize_end:cockroach.roachpb.LockAcquisition) +} + +size_t LockAcquisition::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:cockroach.roachpb.LockAcquisition) + size_t total_size = 0; + + total_size += (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()).size(); + + if (this->has_span()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *span_); + } + + if (this->has_txn()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *txn_); + } + + // .cockroach.kv.kvserver.concurrency.lock.Durability durability = 3; + if (this->durability() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->durability()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LockAcquisition::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void LockAcquisition::MergeFrom(const LockAcquisition& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:cockroach.roachpb.LockAcquisition) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_span()) { + mutable_span()->::cockroach::roachpb::Span::MergeFrom(from.span()); + } + if (from.has_txn()) { + mutable_txn()->::cockroach::storage::enginepb::TxnMeta::MergeFrom(from.txn()); + } + if (from.durability() != 0) { + set_durability(from.durability()); + } +} + +void LockAcquisition::CopyFrom(const LockAcquisition& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:cockroach.roachpb.LockAcquisition) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LockAcquisition::IsInitialized() const { + return true; +} + +void LockAcquisition::Swap(LockAcquisition* other) { + if (other == this) return; + InternalSwap(other); +} +void LockAcquisition::InternalSwap(LockAcquisition* other) { + using std::swap; + swap(span_, other->span_); + swap(txn_, other->txn_); + swap(durability_, other->durability_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::std::string LockAcquisition::GetTypeName() const { + return "cockroach.roachpb.LockAcquisition"; +} + + // =================================================================== void LockUpdate::InitAsDefaultInstance() { @@ -4946,7 +5236,6 @@ const int LockUpdate::kSpanFieldNumber; const int LockUpdate::kTxnFieldNumber; const int LockUpdate::kStatusFieldNumber; const int LockUpdate::kIgnoredSeqnumsFieldNumber; -const int LockUpdate::kDurabilityFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 LockUpdate::LockUpdate() @@ -4971,16 +5260,14 @@ LockUpdate::LockUpdate(const LockUpdate& from) } else { txn_ = NULL; } - ::memcpy(&status_, &from.status_, - static_cast(reinterpret_cast(&durability_) - - reinterpret_cast(&status_)) + sizeof(durability_)); + status_ = from.status_; // @@protoc_insertion_point(copy_constructor:cockroach.roachpb.LockUpdate) } void LockUpdate::SharedCtor() { ::memset(&span_, 0, static_cast( - reinterpret_cast(&durability_) - - reinterpret_cast(&span_)) + sizeof(durability_)); + reinterpret_cast(&status_) - + reinterpret_cast(&span_)) + sizeof(status_)); } LockUpdate::~LockUpdate() { @@ -5017,9 +5304,7 @@ void LockUpdate::Clear() { delete txn_; } txn_ = NULL; - ::memset(&status_, 0, static_cast( - reinterpret_cast(&durability_) - - reinterpret_cast(&status_)) + sizeof(durability_)); + status_ = 0; _internal_metadata_.Clear(); } @@ -5087,21 +5372,6 @@ bool LockUpdate::MergePartialFromCodedStream( break; } - // .cockroach.kv.kvserver.concurrency.lock.Durability durability = 5; - case 5: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { - int value; - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - set_durability(static_cast< ::cockroach::kv::kvserver::concurrency::lock::Durability >(value)); - } else { - goto handle_unusual; - } - break; - } - default: { handle_unusual: if (tag == 0) { @@ -5152,12 +5422,6 @@ void LockUpdate::SerializeWithCachedSizes( output); } - // .cockroach.kv.kvserver.concurrency.lock.Durability durability = 5; - if (this->durability() != 0) { - ::google::protobuf::internal::WireFormatLite::WriteEnum( - 5, this->durability(), output); - } - output->WriteRaw((::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()).data(), static_cast((::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()).size())); // @@protoc_insertion_point(serialize_end:cockroach.roachpb.LockUpdate) @@ -5197,12 +5461,6 @@ size_t LockUpdate::ByteSizeLong() const { ::google::protobuf::internal::WireFormatLite::EnumSize(this->status()); } - // .cockroach.kv.kvserver.concurrency.lock.Durability durability = 5; - if (this->durability() != 0) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::EnumSize(this->durability()); - } - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; @@ -5230,9 +5488,6 @@ void LockUpdate::MergeFrom(const LockUpdate& from) { if (from.status() != 0) { set_status(from.status()); } - if (from.durability() != 0) { - set_durability(from.durability()); - } } void LockUpdate::CopyFrom(const LockUpdate& from) { @@ -5256,7 +5511,6 @@ void LockUpdate::InternalSwap(LockUpdate* other) { swap(span_, other->span_); swap(txn_, other->txn_); swap(status_, other->status_); - swap(durability_, other->durability_); _internal_metadata_.Swap(&other->_internal_metadata_); } @@ -6834,6 +7088,9 @@ template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::cockroach::roachpb::Intent_Singl template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::cockroach::roachpb::Intent* Arena::CreateMaybeMessage< ::cockroach::roachpb::Intent >(Arena* arena) { return Arena::CreateInternal< ::cockroach::roachpb::Intent >(arena); } +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::cockroach::roachpb::LockAcquisition* Arena::CreateMaybeMessage< ::cockroach::roachpb::LockAcquisition >(Arena* arena) { + return Arena::CreateInternal< ::cockroach::roachpb::LockAcquisition >(arena); +} template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::cockroach::roachpb::LockUpdate* Arena::CreateMaybeMessage< ::cockroach::roachpb::LockUpdate >(Arena* arena) { return Arena::CreateInternal< ::cockroach::roachpb::LockUpdate >(arena); } diff --git a/c-deps/libroach/protos/roachpb/data.pb.h b/c-deps/libroach/protos/roachpb/data.pb.h index 82c512da6d44..e33b4d4f3dee 100644 --- a/c-deps/libroach/protos/roachpb/data.pb.h +++ b/c-deps/libroach/protos/roachpb/data.pb.h @@ -43,7 +43,7 @@ namespace protobuf_roachpb_2fdata_2eproto { struct TableStruct { static const ::google::protobuf::internal::ParseTableField entries[]; static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; - static const ::google::protobuf::internal::ParseTable schema[21]; + static const ::google::protobuf::internal::ParseTable schema[22]; static const ::google::protobuf::internal::FieldMetadata field_metadata[]; static const ::google::protobuf::internal::SerializationTable serialization_table[]; static const ::google::protobuf::uint32 offsets[]; @@ -78,6 +78,9 @@ extern LeafTxnInputStateDefaultTypeInternal _LeafTxnInputState_default_instance_ class Lease; class LeaseDefaultTypeInternal; extern LeaseDefaultTypeInternal _Lease_default_instance_; +class LockAcquisition; +class LockAcquisitionDefaultTypeInternal; +extern LockAcquisitionDefaultTypeInternal _LockAcquisition_default_instance_; class LockUpdate; class LockUpdateDefaultTypeInternal; extern LockUpdateDefaultTypeInternal _LockUpdate_default_instance_; @@ -127,6 +130,7 @@ template<> ::cockroach::roachpb::KeyValue* Arena::CreateMaybeMessage<::cockroach template<> ::cockroach::roachpb::LeafTxnFinalState* Arena::CreateMaybeMessage<::cockroach::roachpb::LeafTxnFinalState>(Arena*); template<> ::cockroach::roachpb::LeafTxnInputState* Arena::CreateMaybeMessage<::cockroach::roachpb::LeafTxnInputState>(Arena*); template<> ::cockroach::roachpb::Lease* Arena::CreateMaybeMessage<::cockroach::roachpb::Lease>(Arena*); +template<> ::cockroach::roachpb::LockAcquisition* Arena::CreateMaybeMessage<::cockroach::roachpb::LockAcquisition>(Arena*); template<> ::cockroach::roachpb::LockUpdate* Arena::CreateMaybeMessage<::cockroach::roachpb::LockUpdate>(Arena*); template<> ::cockroach::roachpb::MergeTrigger* Arena::CreateMaybeMessage<::cockroach::roachpb::MergeTrigger>(Arena*); template<> ::cockroach::roachpb::ModifiedSpanTrigger* Arena::CreateMaybeMessage<::cockroach::roachpb::ModifiedSpanTrigger>(Arena*); @@ -2222,6 +2226,131 @@ class Intent : public ::google::protobuf::MessageLite /* @@protoc_insertion_poin }; // ------------------------------------------------------------------- +class LockAcquisition : public ::google::protobuf::MessageLite /* @@protoc_insertion_point(class_definition:cockroach.roachpb.LockAcquisition) */ { + public: + LockAcquisition(); + virtual ~LockAcquisition(); + + LockAcquisition(const LockAcquisition& from); + + inline LockAcquisition& operator=(const LockAcquisition& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LockAcquisition(LockAcquisition&& from) noexcept + : LockAcquisition() { + *this = ::std::move(from); + } + + inline LockAcquisition& operator=(LockAcquisition&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const LockAcquisition& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LockAcquisition* internal_default_instance() { + return reinterpret_cast( + &_LockAcquisition_default_instance_); + } + static constexpr int kIndexInFileMessages = + 15; + + void Swap(LockAcquisition* other); + friend void swap(LockAcquisition& a, LockAcquisition& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LockAcquisition* New() const final { + return CreateMaybeMessage(NULL); + } + + LockAcquisition* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from) + final; + void CopyFrom(const LockAcquisition& from); + void MergeFrom(const LockAcquisition& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + void DiscardUnknownFields(); + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(LockAcquisition* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::std::string GetTypeName() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + bool has_span() const; + void clear_span(); + static const int kSpanFieldNumber = 1; + private: + const ::cockroach::roachpb::Span& _internal_span() const; + public: + const ::cockroach::roachpb::Span& span() const; + ::cockroach::roachpb::Span* release_span(); + ::cockroach::roachpb::Span* mutable_span(); + void set_allocated_span(::cockroach::roachpb::Span* span); + + bool has_txn() const; + void clear_txn(); + static const int kTxnFieldNumber = 2; + private: + const ::cockroach::storage::enginepb::TxnMeta& _internal_txn() const; + public: + const ::cockroach::storage::enginepb::TxnMeta& txn() const; + ::cockroach::storage::enginepb::TxnMeta* release_txn(); + ::cockroach::storage::enginepb::TxnMeta* mutable_txn(); + void set_allocated_txn(::cockroach::storage::enginepb::TxnMeta* txn); + + // .cockroach.kv.kvserver.concurrency.lock.Durability durability = 3; + void clear_durability(); + static const int kDurabilityFieldNumber = 3; + ::cockroach::kv::kvserver::concurrency::lock::Durability durability() const; + void set_durability(::cockroach::kv::kvserver::concurrency::lock::Durability value); + + // @@protoc_insertion_point(class_scope:cockroach.roachpb.LockAcquisition) + private: + + ::google::protobuf::internal::InternalMetadataWithArenaLite _internal_metadata_; + ::cockroach::roachpb::Span* span_; + ::cockroach::storage::enginepb::TxnMeta* txn_; + int durability_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_roachpb_2fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + class LockUpdate : public ::google::protobuf::MessageLite /* @@protoc_insertion_point(class_definition:cockroach.roachpb.LockUpdate) */ { public: LockUpdate(); @@ -2256,7 +2385,7 @@ class LockUpdate : public ::google::protobuf::MessageLite /* @@protoc_insertion_ &_LockUpdate_default_instance_); } static constexpr int kIndexInFileMessages = - 15; + 16; void Swap(LockUpdate* other); friend void swap(LockUpdate& a, LockUpdate& b) { @@ -2346,12 +2475,6 @@ class LockUpdate : public ::google::protobuf::MessageLite /* @@protoc_insertion_ ::cockroach::roachpb::TransactionStatus status() const; void set_status(::cockroach::roachpb::TransactionStatus value); - // .cockroach.kv.kvserver.concurrency.lock.Durability durability = 5; - void clear_durability(); - static const int kDurabilityFieldNumber = 5; - ::cockroach::kv::kvserver::concurrency::lock::Durability durability() const; - void set_durability(::cockroach::kv::kvserver::concurrency::lock::Durability value); - // @@protoc_insertion_point(class_scope:cockroach.roachpb.LockUpdate) private: @@ -2360,7 +2483,6 @@ class LockUpdate : public ::google::protobuf::MessageLite /* @@protoc_insertion_ ::cockroach::roachpb::Span* span_; ::cockroach::storage::enginepb::TxnMeta* txn_; int status_; - int durability_; mutable ::google::protobuf::internal::CachedSize _cached_size_; friend struct ::protobuf_roachpb_2fdata_2eproto::TableStruct; }; @@ -2400,7 +2522,7 @@ class SequencedWrite : public ::google::protobuf::MessageLite /* @@protoc_insert &_SequencedWrite_default_instance_); } static constexpr int kIndexInFileMessages = - 16; + 17; void Swap(SequencedWrite* other); friend void swap(SequencedWrite& a, SequencedWrite& b) { @@ -2514,7 +2636,7 @@ class Lease : public ::google::protobuf::MessageLite /* @@protoc_insertion_point &_Lease_default_instance_); } static constexpr int kIndexInFileMessages = - 17; + 18; void Swap(Lease* other); friend void swap(Lease& a, Lease& b) { @@ -2681,7 +2803,7 @@ class AbortSpanEntry : public ::google::protobuf::MessageLite /* @@protoc_insert &_AbortSpanEntry_default_instance_); } static constexpr int kIndexInFileMessages = - 18; + 19; void Swap(AbortSpanEntry* other); friend void swap(AbortSpanEntry& a, AbortSpanEntry& b) { @@ -2807,7 +2929,7 @@ class LeafTxnInputState : public ::google::protobuf::MessageLite /* @@protoc_ins &_LeafTxnInputState_default_instance_); } static constexpr int kIndexInFileMessages = - 19; + 20; void Swap(LeafTxnInputState* other); friend void swap(LeafTxnInputState& a, LeafTxnInputState& b) { @@ -2945,7 +3067,7 @@ class LeafTxnFinalState : public ::google::protobuf::MessageLite /* @@protoc_ins &_LeafTxnFinalState_default_instance_); } static constexpr int kIndexInFileMessages = - 20; + 21; void Swap(LeafTxnFinalState* other); friend void swap(LeafTxnFinalState& a, LeafTxnFinalState& b) { @@ -5211,6 +5333,124 @@ inline void Intent::set_allocated_txn(::cockroach::storage::enginepb::TxnMeta* t // ------------------------------------------------------------------- +// LockAcquisition + +inline bool LockAcquisition::has_span() const { + return this != internal_default_instance() && span_ != NULL; +} +inline void LockAcquisition::clear_span() { + if (GetArenaNoVirtual() == NULL && span_ != NULL) { + delete span_; + } + span_ = NULL; +} +inline const ::cockroach::roachpb::Span& LockAcquisition::_internal_span() const { + return *span_; +} +inline const ::cockroach::roachpb::Span& LockAcquisition::span() const { + const ::cockroach::roachpb::Span* p = span_; + // @@protoc_insertion_point(field_get:cockroach.roachpb.LockAcquisition.span) + return p != NULL ? *p : *reinterpret_cast( + &::cockroach::roachpb::_Span_default_instance_); +} +inline ::cockroach::roachpb::Span* LockAcquisition::release_span() { + // @@protoc_insertion_point(field_release:cockroach.roachpb.LockAcquisition.span) + + ::cockroach::roachpb::Span* temp = span_; + span_ = NULL; + return temp; +} +inline ::cockroach::roachpb::Span* LockAcquisition::mutable_span() { + + if (span_ == NULL) { + auto* p = CreateMaybeMessage<::cockroach::roachpb::Span>(GetArenaNoVirtual()); + span_ = p; + } + // @@protoc_insertion_point(field_mutable:cockroach.roachpb.LockAcquisition.span) + return span_; +} +inline void LockAcquisition::set_allocated_span(::cockroach::roachpb::Span* span) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete span_; + } + if (span) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + span = ::google::protobuf::internal::GetOwnedMessage( + message_arena, span, submessage_arena); + } + + } else { + + } + span_ = span; + // @@protoc_insertion_point(field_set_allocated:cockroach.roachpb.LockAcquisition.span) +} + +inline bool LockAcquisition::has_txn() const { + return this != internal_default_instance() && txn_ != NULL; +} +inline const ::cockroach::storage::enginepb::TxnMeta& LockAcquisition::_internal_txn() const { + return *txn_; +} +inline const ::cockroach::storage::enginepb::TxnMeta& LockAcquisition::txn() const { + const ::cockroach::storage::enginepb::TxnMeta* p = txn_; + // @@protoc_insertion_point(field_get:cockroach.roachpb.LockAcquisition.txn) + return p != NULL ? *p : *reinterpret_cast( + &::cockroach::storage::enginepb::_TxnMeta_default_instance_); +} +inline ::cockroach::storage::enginepb::TxnMeta* LockAcquisition::release_txn() { + // @@protoc_insertion_point(field_release:cockroach.roachpb.LockAcquisition.txn) + + ::cockroach::storage::enginepb::TxnMeta* temp = txn_; + txn_ = NULL; + return temp; +} +inline ::cockroach::storage::enginepb::TxnMeta* LockAcquisition::mutable_txn() { + + if (txn_ == NULL) { + auto* p = CreateMaybeMessage<::cockroach::storage::enginepb::TxnMeta>(GetArenaNoVirtual()); + txn_ = p; + } + // @@protoc_insertion_point(field_mutable:cockroach.roachpb.LockAcquisition.txn) + return txn_; +} +inline void LockAcquisition::set_allocated_txn(::cockroach::storage::enginepb::TxnMeta* txn) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(txn_); + } + if (txn) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + txn = ::google::protobuf::internal::GetOwnedMessage( + message_arena, txn, submessage_arena); + } + + } else { + + } + txn_ = txn; + // @@protoc_insertion_point(field_set_allocated:cockroach.roachpb.LockAcquisition.txn) +} + +// .cockroach.kv.kvserver.concurrency.lock.Durability durability = 3; +inline void LockAcquisition::clear_durability() { + durability_ = 0; +} +inline ::cockroach::kv::kvserver::concurrency::lock::Durability LockAcquisition::durability() const { + // @@protoc_insertion_point(field_get:cockroach.roachpb.LockAcquisition.durability) + return static_cast< ::cockroach::kv::kvserver::concurrency::lock::Durability >(durability_); +} +inline void LockAcquisition::set_durability(::cockroach::kv::kvserver::concurrency::lock::Durability value) { + + durability_ = value; + // @@protoc_insertion_point(field_set:cockroach.roachpb.LockAcquisition.durability) +} + +// ------------------------------------------------------------------- + // LockUpdate inline bool LockUpdate::has_span() const { @@ -5353,20 +5593,6 @@ LockUpdate::ignored_seqnums() const { return ignored_seqnums_; } -// .cockroach.kv.kvserver.concurrency.lock.Durability durability = 5; -inline void LockUpdate::clear_durability() { - durability_ = 0; -} -inline ::cockroach::kv::kvserver::concurrency::lock::Durability LockUpdate::durability() const { - // @@protoc_insertion_point(field_get:cockroach.roachpb.LockUpdate.durability) - return static_cast< ::cockroach::kv::kvserver::concurrency::lock::Durability >(durability_); -} -inline void LockUpdate::set_durability(::cockroach::kv::kvserver::concurrency::lock::Durability value) { - - durability_ = value; - // @@protoc_insertion_point(field_set:cockroach.roachpb.LockUpdate.durability) -} - // ------------------------------------------------------------------- // SequencedWrite @@ -6102,6 +6328,8 @@ inline void LeafTxnFinalState::set_refresh_invalid(bool value) { // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/pkg/cli/debug.go b/pkg/cli/debug.go index 2dee2e68687f..ee9506c3e62a 100644 --- a/pkg/cli/debug.go +++ b/pkg/cli/debug.go @@ -33,7 +33,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/gossip" "github.com/cockroachdb/cockroach/pkg/keys" "github.com/cockroachdb/cockroach/pkg/kv/kvserver" - "github.com/cockroachdb/cockroach/pkg/kv/kvserver/concurrency/lock" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/gc" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/rditer" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/stateloader" @@ -1134,10 +1133,9 @@ func removeDeadReplicas( return nil, err } update := roachpb.LockUpdate{ - Span: roachpb.Span{Key: intent.Key}, - Txn: intent.Txn, - Status: roachpb.ABORTED, - Durability: lock.Replicated, + Span: roachpb.Span{Key: intent.Key}, + Txn: intent.Txn, + Status: roachpb.ABORTED, } if _, err := storage.MVCCResolveWriteIntent(ctx, batch, &ms, update); err != nil { return nil, err diff --git a/pkg/kv/kvserver/batcheval/cmd_end_transaction.go b/pkg/kv/kvserver/batcheval/cmd_end_transaction.go index 1057af808897..77f06a125469 100644 --- a/pkg/kv/kvserver/batcheval/cmd_end_transaction.go +++ b/pkg/kv/kvserver/batcheval/cmd_end_transaction.go @@ -21,7 +21,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/keys" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/abortspan" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/batcheval/result" - "github.com/cockroachdb/cockroach/pkg/kv/kvserver/concurrency/lock" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/rditer" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/spanset" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/stateloader" @@ -502,7 +501,7 @@ func resolveLocalLocks( externalLocks = append(externalLocks, span) return nil } - update := roachpb.MakeLockUpdateWithDur(txn, span, lock.Replicated) + update := roachpb.MakeLockUpdate(txn, span) if len(span.EndKey) == 0 { // For single-key lock updates, do a KeyAddress-aware check of // whether it's contained in our Range. diff --git a/pkg/kv/kvserver/batcheval/intent.go b/pkg/kv/kvserver/batcheval/intent.go index e93e2743c57b..8cd9c8ea664b 100644 --- a/pkg/kv/kvserver/batcheval/intent.go +++ b/pkg/kv/kvserver/batcheval/intent.go @@ -112,29 +112,18 @@ func acquireUnreplicatedLocksOnKeys( scanFmt roachpb.ScanFormat, scanRes *storage.MVCCScanResult, ) error { + res.Local.AcquiredLocks = make([]roachpb.LockAcquisition, scanRes.NumKeys) switch scanFmt { case roachpb.BATCH_RESPONSE: - res.Local.AcquiredLocks = make([]roachpb.LockUpdate, scanRes.NumKeys) var i int return storage.MVCCScanDecodeKeyValues(scanRes.KVData, func(key storage.MVCCKey, _ []byte) error { - res.Local.AcquiredLocks[i] = roachpb.LockUpdate{ - Span: roachpb.Span{Key: key.Key}, - Txn: txn.TxnMeta, - Status: roachpb.PENDING, - Durability: lock.Unreplicated, - } + res.Local.AcquiredLocks[i] = roachpb.MakeLockAcquisition(txn, key.Key, lock.Unreplicated) i++ return nil }) case roachpb.KEY_VALUES: - res.Local.AcquiredLocks = make([]roachpb.LockUpdate, scanRes.NumKeys) for i, row := range scanRes.KVs { - res.Local.AcquiredLocks[i] = roachpb.LockUpdate{ - Span: roachpb.Span{Key: row.Key}, - Txn: txn.TxnMeta, - Status: roachpb.PENDING, - Durability: lock.Unreplicated, - } + res.Local.AcquiredLocks[i] = roachpb.MakeLockAcquisition(txn, row.Key, lock.Unreplicated) } return nil default: diff --git a/pkg/kv/kvserver/batcheval/result/intent.go b/pkg/kv/kvserver/batcheval/result/intent.go index 0a75a24cdec1..1dc98f4a92a8 100644 --- a/pkg/kv/kvserver/batcheval/result/intent.go +++ b/pkg/kv/kvserver/batcheval/result/intent.go @@ -33,14 +33,9 @@ func FromAcquiredLocks(txn *roachpb.Transaction, keys ...roachpb.Key) Result { if txn == nil { return pd } - pd.Local.AcquiredLocks = make([]roachpb.LockUpdate, len(keys)) + pd.Local.AcquiredLocks = make([]roachpb.LockAcquisition, len(keys)) for i := range pd.Local.AcquiredLocks { - pd.Local.AcquiredLocks[i] = roachpb.LockUpdate{ - Span: roachpb.Span{Key: keys[i]}, - Txn: txn.TxnMeta, - Status: roachpb.PENDING, - Durability: lock.Replicated, - } + pd.Local.AcquiredLocks[i] = roachpb.MakeLockAcquisition(txn, keys[i], lock.Replicated) } return pd } diff --git a/pkg/kv/kvserver/batcheval/result/result.go b/pkg/kv/kvserver/batcheval/result/result.go index 25d626770905..784f078a46cc 100644 --- a/pkg/kv/kvserver/batcheval/result/result.go +++ b/pkg/kv/kvserver/batcheval/result/result.go @@ -34,7 +34,7 @@ type LocalResult struct { // resolve them is made. EncounteredIntents []roachpb.Intent // AcquiredLocks stores any newly acquired or re-acquired locks. - AcquiredLocks []roachpb.LockUpdate + AcquiredLocks []roachpb.LockAcquisition // ResolvedLocks stores any resolved lock spans, either with finalized or // pending statuses. Unlike AcquiredLocks and EncounteredIntents, values in // this slice will represent spans of locks that were resolved. diff --git a/pkg/kv/kvserver/client_test.go b/pkg/kv/kvserver/client_test.go index a94f9a37eb53..58fd6536be61 100644 --- a/pkg/kv/kvserver/client_test.go +++ b/pkg/kv/kvserver/client_test.go @@ -970,7 +970,7 @@ func (m *multiTestContext) addStore(idx int) { }{ ch: make(chan struct{}), } - m.nodeLivenesses[idx].StartHeartbeat(ctx, stopper, func(ctx context.Context) { + m.nodeLivenesses[idx].StartHeartbeat(ctx, stopper, m.engines[idx:idx+1], func(ctx context.Context) { now := clock.Now() if err := store.WriteLastUpTimestamp(ctx, now); err != nil { log.Warning(ctx, err) @@ -978,7 +978,7 @@ func (m *multiTestContext) addStore(idx int) { ran.Do(func() { close(ran.ch) }) - }, []storage.Engine{m.engines[idx]}) + }) store.WaitForInit() @@ -1067,12 +1067,12 @@ func (m *multiTestContext) restartStoreWithoutHeartbeat(i int) { m.transport.GetCircuitBreaker(m.idents[i].NodeID, rpc.DefaultClass).Reset() m.transport.GetCircuitBreaker(m.idents[i].NodeID, rpc.SystemClass).Reset() m.mu.Unlock() - cfg.NodeLiveness.StartHeartbeat(ctx, stopper, func(ctx context.Context) { + cfg.NodeLiveness.StartHeartbeat(ctx, stopper, m.engines[i:i+1], func(ctx context.Context) { now := m.clocks[i].Now() if err := store.WriteLastUpTimestamp(ctx, now); err != nil { log.Warning(ctx, err) } - }, []storage.Engine{m.engines[i]}) + }) } // restartStore restarts a store previously stopped with StopStore. diff --git a/pkg/kv/kvserver/concurrency/concurrency_control.go b/pkg/kv/kvserver/concurrency/concurrency_control.go index efbb42f907d1..a2e0294d211a 100644 --- a/pkg/kv/kvserver/concurrency/concurrency_control.go +++ b/pkg/kv/kvserver/concurrency/concurrency_control.go @@ -232,7 +232,7 @@ type ContentionHandler interface { type LockManager interface { // OnLockAcquired informs the concurrency manager that a transaction has // acquired a new lock or re-acquired an existing lock that it already held. - OnLockAcquired(context.Context, *roachpb.LockUpdate) + OnLockAcquired(context.Context, *roachpb.LockAcquisition) // OnLockUpdated informs the concurrency manager that a transaction has // updated or released a lock or range of locks that it previously held. diff --git a/pkg/kv/kvserver/concurrency/concurrency_manager.go b/pkg/kv/kvserver/concurrency/concurrency_manager.go index a3f61c923b58..7dcbba6bc15b 100644 --- a/pkg/kv/kvserver/concurrency/concurrency_manager.go +++ b/pkg/kv/kvserver/concurrency/concurrency_manager.go @@ -303,8 +303,8 @@ func (m *managerImpl) HandleTransactionPushError( } // OnLockAcquired implements the LockManager interface. -func (m *managerImpl) OnLockAcquired(ctx context.Context, up *roachpb.LockUpdate) { - if err := m.lt.AcquireLock(&up.Txn, up.Key, lock.Exclusive, up.Durability); err != nil { +func (m *managerImpl) OnLockAcquired(ctx context.Context, acq *roachpb.LockAcquisition) { + if err := m.lt.AcquireLock(&acq.Txn, acq.Key, lock.Exclusive, acq.Durability); err != nil { log.Fatal(ctx, errors.HandleAsAssertionFailure(err)) } } diff --git a/pkg/kv/kvserver/concurrency/concurrency_manager_test.go b/pkg/kv/kvserver/concurrency/concurrency_manager_test.go index a8fbe09f26ab..2c806f979128 100644 --- a/pkg/kv/kvserver/concurrency/concurrency_manager_test.go +++ b/pkg/kv/kvserver/concurrency/concurrency_manager_test.go @@ -302,9 +302,8 @@ func TestConcurrencyManagerBasic(t *testing.T) { mon.runSync("acquire lock", func(ctx context.Context) { log.Eventf(ctx, "txn %s @ %s", txn.ID.Short(), key) - span := roachpb.Span{Key: roachpb.Key(key)} - up := roachpb.MakeLockUpdateWithDur(txnAcquire, span, dur) - m.OnLockAcquired(ctx, &up) + acq := roachpb.MakeLockAcquisition(txnAcquire, roachpb.Key(key), dur) + m.OnLockAcquired(ctx, &acq) }) return c.waitAndCollect(t, mon) diff --git a/pkg/kv/kvserver/concurrency/lock_table.go b/pkg/kv/kvserver/concurrency/lock_table.go index 8444f5ad9b5d..3d00f968fb69 100644 --- a/pkg/kv/kvserver/concurrency/lock_table.go +++ b/pkg/kv/kvserver/concurrency/lock_table.go @@ -32,36 +32,65 @@ import ( // Default upper bound on the number of locks in a lockTable. const defaultLockTableSize = 10000 -// The kind of waiting that the request is subject to. See the detailed comment -// above for the meaning of each kind. -type stateKind int +// The kind of waiting that the request is subject to. +type waitKind int const ( - waitForDistinguished stateKind = iota + _ waitKind = iota + + // waitFor indicates that the request is waiting on another transaction to + // to release its locks or complete its own request. waitingStates with this + // waitKind will provide information on who the request is waiting on. The + // request will likely want to eventually push the conflicting transaction. waitFor + + // waitForDistinguished is a sub-case of waitFor. It implies everything that + // waitFor does and additionally indicates that the request is currently the + // "distinguished waiter". A distinguished waiter is responsible for taking + // extra actions, e.g. immediately pushing the transaction it is waiting + // for. If there are multiple requests in the waitFor state waiting on the + // same transaction, at least one will be a distinguished waiter. + waitForDistinguished + + // waitElsewhere is used when the lockTable is under memory pressure and is + // clearing its internal queue state. Like the waitFor* states, it informs + // the request who it is waiting for so that deadlock detection works. + // However, sequencing information inside the lockTable is mostly discarded. waitElsewhere + + // waitSelf indicates that a different requests from the same transaction + // has a conflicting reservation. See the comment about "Reservations" in + // lockState. This request should sit tight and wait for a new notification + // without pushing anyone. waitSelf + + // doneWaiting indicates that the request is done waiting on this pass + // through the lockTable and should make another call to ScanAndEnqueue. doneWaiting ) -// The current waiting state of the request. See the detailed comment above. +// The current waiting state of the request. +// +// See the detailed comment about "Waiting logic" on lockTableGuardImpl. type waitingState struct { - stateKind stateKind - - // Populated for waitFor* and waitElsewhere type, and represents who the - // request is waiting for. - txn *enginepb.TxnMeta // always non-nil - ts hlc.Timestamp // the timestamp of the transaction that is causing the wait - dur lock.Durability // the durability of the lock that is causing the wait - key roachpb.Key // the key of the lock that is causing the wait - held bool // is the lock currently held? - access spanset.SpanAccess // currently only SpanReadWrite - guardAccess spanset.SpanAccess // the access method of the guard + kind waitKind + + // Fields below are populated for waitFor* and waitElsewhere kinds. + + // Represents who the request is waiting for. The conflicting + // transaction may be a lock holder of a conflicting lock or a + // conflicting request being sequenced through the same lockTable. + txn *enginepb.TxnMeta // always non-nil + key roachpb.Key // the key of the conflict + held bool // is the conflict a held lock? + + // Represents the action that the request was trying to perform when + // it hit the conflict. E.g. was it trying to read or write? + guardAccess spanset.SpanAccess } // Implementation // TODO(sbhola): -// - proper error strings and give better explanation to all panics. // - metrics about lockTable state to export to observability debug pages: // number of locks, number of waiting requests, wait time?, ... // - test cases where guard.readTS != guard.writeTS. @@ -387,10 +416,14 @@ func (g *lockTableGuardImpl) doneWaitingAtLock(hasReservation bool, l *lockState g.mu.Unlock() } -func (g *lockTableGuardImpl) isTxn(txn *enginepb.TxnMeta) bool { +func (g *lockTableGuardImpl) isSameTxn(txn *enginepb.TxnMeta) bool { return g.txn != nil && g.txn.ID == txn.ID } +func (g *lockTableGuardImpl) isSameTxnAsReservation(ws waitingState) bool { + return !ws.held && g.isSameTxn(ws.txn) +} + // Finds the next lock, after the current one, to actively wait at. If it // finds the next lock the request starts actively waiting there, else it is // told that it is done waiting. @@ -439,7 +472,7 @@ func (g *lockTableGuardImpl) findNextLockAfter(notify bool) { } g.mu.Lock() defer g.mu.Unlock() - g.mu.state.stateKind = doneWaiting + g.mu.state = waitingState{kind: doneWaiting} if notify { g.notify() } @@ -739,7 +772,7 @@ func (l *lockState) Format(buf *strings.Builder) { } fmt.Fprintln(b, "") } - txn, ts, _ := l.getLockerInfo() + txn, ts := l.getLockerInfo() if txn == nil { fmt.Fprintf(buf, " res: req: %d, ", l.reservation.seqNum) writeResInfo(buf, l.reservation.txn, l.reservation.writeTS) @@ -798,28 +831,18 @@ func (l *lockState) tryBreakReservation(seqNum uint64) bool { // waitForDistinguished states. // REQUIRES: l.mu is locked. func (l *lockState) informActiveWaiters() { - waitForTxn, waitForTs, waitForDur := l.getLockerInfo() - var checkForWaitSelf bool + waitForState := waitingState{kind: waitFor, key: l.key} findDistinguished := l.distinguishedWaiter == nil - if waitForTxn == nil { - checkForWaitSelf = true - waitForTxn = l.reservation.txn - waitForTs = l.reservation.writeTS - if !findDistinguished && l.distinguishedWaiter.isTxn(waitForTxn) { + if lockHolderTxn, _ := l.getLockerInfo(); lockHolderTxn != nil { + waitForState.txn = lockHolderTxn + waitForState.held = true + } else { + waitForState.txn = l.reservation.txn + if !findDistinguished && l.distinguishedWaiter.isSameTxnAsReservation(waitForState) { findDistinguished = true l.distinguishedWaiter = nil } } - waitForState := waitingState{ - stateKind: waitFor, - txn: waitForTxn, - ts: waitForTs, - dur: waitForDur, - key: l.key, - held: l.holder.locked, - access: spanset.SpanReadWrite, - } - waitSelfState := waitingState{stateKind: waitSelf} for e := l.waitingReaders.Front(); e != nil; e = e.Next() { state := waitForState @@ -835,7 +858,7 @@ func (l *lockState) informActiveWaiters() { g.mu.Lock() g.mu.state = state if l.distinguishedWaiter == g { - g.mu.state.stateKind = waitForDistinguished + g.mu.state.kind = waitForDistinguished } g.notify() g.mu.Unlock() @@ -847,8 +870,8 @@ func (l *lockState) informActiveWaiters() { } g := qg.guard var state waitingState - if checkForWaitSelf && g.isTxn(waitForTxn) { - state = waitSelfState + if g.isSameTxnAsReservation(waitForState) { + state = waitingState{kind: waitSelf} } else { state = waitForState state.guardAccess = spanset.SpanReadWrite @@ -856,12 +879,12 @@ func (l *lockState) informActiveWaiters() { l.distinguishedWaiter = g findDistinguished = false } + if l.distinguishedWaiter == g { + state.kind = waitForDistinguished + } } g.mu.Lock() g.mu.state = state - if l.distinguishedWaiter == g { - g.mu.state.stateKind = waitForDistinguished - } g.notify() g.mu.Unlock() } @@ -876,7 +899,7 @@ func (l *lockState) releaseWritersFromTxn(txn *enginepb.TxnMeta) { curr := e e = e.Next() g := qg.guard - if g.isTxn(txn) { + if g.isSameTxn(txn) { if qg.active { if g == l.distinguishedWaiter { l.distinguishedWaiter = nil @@ -903,7 +926,7 @@ func (l *lockState) tryMakeNewDistinguished() { } else if l.queuedWriters.Len() > 0 { for e := l.queuedWriters.Front(); e != nil; e = e.Next() { qg := e.Value.(*queuedGuard) - if qg.active && (l.reservation == nil || !qg.guard.isTxn(l.reservation.txn)) { + if qg.active && (l.reservation == nil || !qg.guard.isSameTxn(l.reservation.txn)) { g = qg.guard break } @@ -912,7 +935,7 @@ func (l *lockState) tryMakeNewDistinguished() { if g != nil { l.distinguishedWaiter = g g.mu.Lock() - g.mu.state.stateKind = waitForDistinguished + g.mu.state.kind = waitForDistinguished // The rest of g.state is already up-to-date. g.notify() g.mu.Unlock() @@ -938,9 +961,9 @@ func (l *lockState) isLockedBy(id uuid.UUID) bool { // Returns information about the current lock holder if the lock is held, else // returns nil. // REQUIRES: l.mu is locked. -func (l *lockState) getLockerInfo() (*enginepb.TxnMeta, hlc.Timestamp, lock.Durability) { +func (l *lockState) getLockerInfo() (*enginepb.TxnMeta, hlc.Timestamp) { if !l.holder.locked { - return nil, hlc.Timestamp{}, 0 + return nil, hlc.Timestamp{} } // If the lock is held as both replicated and unreplicated we want to @@ -957,7 +980,7 @@ func (l *lockState) getLockerInfo() (*enginepb.TxnMeta, hlc.Timestamp, lock.Dura l.holder.holder[lock.Unreplicated].ts.Less(l.holder.holder[lock.Replicated].ts)) { index = lock.Unreplicated } - return l.holder.holder[index].txn, l.holder.holder[index].ts, index + return l.holder.holder[index].txn, l.holder.holder[index].ts } // Decides whether the request g with access sa should actively wait at this @@ -979,39 +1002,19 @@ func (l *lockState) tryActiveWait(g *lockTableGuardImpl, sa spanset.SpanAccess, } // Lock is not empty. - waitForTxn, waitForTs, waitForDur := l.getLockerInfo() - if waitForTxn != nil && g.isTxn(waitForTxn) { + lockHolderTxn, lockHolderTS := l.getLockerInfo() + if lockHolderTxn != nil && g.isSameTxn(lockHolderTxn) { // Already locked by this txn. return false } - var reservedBySelfTxn bool - if waitForTxn == nil { - if l.reservation == g { - // Already reserved by this request. - return false - } - waitForTxn = l.reservation.txn - waitForTs = l.reservation.writeTS - reservedBySelfTxn = g.isTxn(waitForTxn) - // A non-transactional write request never makes or breaks reservations, - // and only waits for a reservation if the reservation has a lower seqNum. - // For reads, the non-transactional and transactional behavior is - // equivalent and handled later in this function. - if g.txn == nil && sa == spanset.SpanReadWrite && l.reservation.seqNum > g.seqNum { - // Reservation is held by a request with a higher seqNum and g is a - // non-transactional request. Ignore the reservation. - return false - } - } - if sa == spanset.SpanReadOnly { - if !l.holder.locked { + if lockHolderTxn == nil { // Reads only care about locker, not a reservation. return false } // Locked by some other txn. - if g.readTS.Less(waitForTs) { + if g.readTS.Less(lockHolderTS) { return false } g.mu.Lock() @@ -1035,6 +1038,27 @@ func (l *lockState) tryActiveWait(g *lockTableGuardImpl, sa spanset.SpanAccess, } } + waitForState := waitingState{kind: waitFor, key: l.key} + if lockHolderTxn != nil { + waitForState.txn = lockHolderTxn + waitForState.held = true + } else { + if l.reservation == g { + // Already reserved by this request. + return false + } + // A non-transactional write request never makes or breaks reservations, + // and only waits for a reservation if the reservation has a lower + // seqNum. Note that `sa == spanset.SpanRead && lockHolderTxn == nil` + // was already checked above. + if g.txn == nil && l.reservation.seqNum > g.seqNum { + // Reservation is held by a request with a higher seqNum and g is a + // non-transactional request. Ignore the reservation. + return false + } + waitForState.txn = l.reservation.txn + } + // Incompatible with whoever is holding lock or reservation. if l.reservation != nil && sa == spanset.SpanReadWrite && l.tryBreakReservation(g.seqNum) { @@ -1100,24 +1124,16 @@ func (l *lockState) tryActiveWait(g *lockTableGuardImpl, sa spanset.SpanAccess, // Make it an active waiter. g.key = l.key g.mu.startWait = true - if reservedBySelfTxn { - g.mu.state = waitingState{stateKind: waitSelf} + if g.isSameTxnAsReservation(waitForState) { + g.mu.state = waitingState{kind: waitSelf} } else { - stateType := waitFor + state := waitForState + state.guardAccess = sa if l.distinguishedWaiter == nil { l.distinguishedWaiter = g - stateType = waitForDistinguished - } - g.mu.state = waitingState{ - stateKind: stateType, - txn: waitForTxn, - ts: waitForTs, - dur: waitForDur, - key: l.key, - held: l.holder.locked, - access: spanset.SpanReadWrite, - guardAccess: sa, + state.kind = waitForDistinguished } + g.mu.state = state } if notify { g.notify() @@ -1136,7 +1152,7 @@ func (l *lockState) acquireLock( defer l.mu.Unlock() if l.holder.locked { // Already held. - beforeTxn, beforeTs, _ := l.getLockerInfo() + beforeTxn, beforeTs := l.getLockerInfo() if txn.ID != beforeTxn.ID { return errors.Errorf("caller violated contract: " + "existing lock cannot be acquired by different transaction") @@ -1206,7 +1222,7 @@ func (l *lockState) acquireLock( l.holder.holder[durability].ts.Forward(ts) l.holder.holder[durability].seqs = append(seqs, txn.Sequence) - _, afterTs, _ := l.getLockerInfo() + _, afterTs := l.getLockerInfo() if beforeTs.Less(afterTs) { l.increasedLockTs(afterTs) } @@ -1362,22 +1378,19 @@ func (l *lockState) tryClearLock(force bool) bool { l.holder.holder[lock.Unreplicated] = lockHolderInfo{} var waitState waitingState if replicatedHeld && !force { - holderTxn, holderTs, holderDur := l.getLockerInfo() + lockHolderTxn, _ := l.getLockerInfo() // Note that none of the current waiters can be requests - // from holderTxn. + // from lockHolderTxn. waitState = waitingState{ - stateKind: waitElsewhere, - txn: holderTxn, - ts: holderTs, - dur: holderDur, + kind: waitElsewhere, + txn: lockHolderTxn, key: l.key, held: true, - access: spanset.SpanReadWrite, guardAccess: spanset.SpanReadOnly, } } else { l.holder.locked = false - waitState = waitingState{stateKind: doneWaiting} + waitState = waitingState{kind: doneWaiting} } l.distinguishedWaiter = nil @@ -1473,7 +1486,7 @@ func (l *lockState) tryUpdateLock(up *roachpb.LockUpdate) (gc bool, err error) { txn := &up.Txn ts := up.Txn.WriteTimestamp - _, beforeTs, _ := l.getLockerInfo() + _, beforeTs := l.getLockerInfo() advancedTs := beforeTs.Less(ts) isLocked := false for i := range l.holder.holder { @@ -1519,7 +1532,7 @@ func (l *lockState) tryUpdateLock(up *roachpb.LockUpdate) (gc bool, err error) { holder.txn = txn } } - // Else txn.Epoch < holderTxn.Epoch, so only the timestamp has been + // Else txn.Epoch < lockHolderTxn.Epoch, so only the timestamp has been // potentially updated. isLocked = true } diff --git a/pkg/kv/kvserver/concurrency/lock_table_test.go b/pkg/kv/kvserver/concurrency/lock_table_test.go index 6d9d40d59831..e4379d350a49 100644 --- a/pkg/kv/kvserver/concurrency/lock_table_test.go +++ b/pkg/kv/kvserver/concurrency/lock_table_test.go @@ -375,7 +375,7 @@ func TestLockTableBasic(t *testing.T) { } state := g.CurState() var typeStr string - switch state.stateKind { + switch state.kind { case waitForDistinguished: typeStr = "waitForDistinguished" case waitFor: @@ -398,12 +398,8 @@ func TestLockTableBasic(t *testing.T) { if txnS == "" { txnS = fmt.Sprintf("unknown txn with ID: %v", state.txn.ID) } - tsS := fmt.Sprintf("%d", state.ts.WallTime) - if state.ts.Logical != 0 { - tsS += fmt.Sprintf(",%d", state.ts.Logical) - } - return fmt.Sprintf("%sstate=%s txn=%s ts=%s key=%s held=%t guard-access=%s", - str, typeStr, txnS, tsS, state.key, state.held, state.guardAccess) + return fmt.Sprintf("%sstate=%s txn=%s key=%s held=%t guard-access=%s", + str, typeStr, txnS, state.key, state.held, state.guardAccess) case "enable": lt.Enable() @@ -538,7 +534,7 @@ func doWork(ctx context.Context, item *workItem, e *workloadExecutor) error { return ctx.Err() } state := g.CurState() - switch state.stateKind { + switch state.kind { case doneWaiting: if !lastID.Equal(uuid.UUID{}) && item.request.Txn != nil { _, err = e.waitingFor(item.request.Txn.ID, lastID, uuid.UUID{}) @@ -566,7 +562,7 @@ func doWork(ctx context.Context, item *workItem, e *workloadExecutor) error { } } default: - return errors.Errorf("unexpected state: %v", state.stateKind) + return errors.Errorf("unexpected state: %v", state.kind) } } } @@ -1079,7 +1075,7 @@ func doBenchWork(item *benchWorkItem, env benchEnv, doneCh chan<- error) { for { <-g.NewStateChan() state := g.CurState() - if state.stateKind == doneWaiting { + if state.kind == doneWaiting { break } } diff --git a/pkg/kv/kvserver/concurrency/lock_table_waiter.go b/pkg/kv/kvserver/concurrency/lock_table_waiter.go index c9100c21584f..1942cd9abad9 100644 --- a/pkg/kv/kvserver/concurrency/lock_table_waiter.go +++ b/pkg/kv/kvserver/concurrency/lock_table_waiter.go @@ -15,7 +15,6 @@ import ( "math" "time" - "github.com/cockroachdb/cockroach/pkg/kv/kvserver/concurrency/lock" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/intentresolver" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/spanset" "github.com/cockroachdb/cockroach/pkg/roachpb" @@ -121,7 +120,7 @@ func (w *lockTableWaiterImpl) WaitOn( case <-newStateC: timerC = nil state := guard.CurState() - switch state.stateKind { + switch state.kind { case waitFor, waitForDistinguished: // waitFor indicates that the request is waiting on another // transaction. This transaction may be the lock holder of a @@ -142,7 +141,7 @@ func (w *lockTableWaiterImpl) WaitOn( // had a cache of aborted transaction IDs that allowed us to notice // and quickly resolve abandoned intents then we might be able to // get rid of this state. - livenessPush := state.stateKind == waitForDistinguished + livenessPush := state.kind == waitForDistinguished deadlockPush := true // If the conflict is a reservation holder and not a held lock then @@ -308,13 +307,10 @@ func (w *lockTableWaiterImpl) WaitOnLock( return roachpb.NewError(err) } return w.pushLockTxn(ctx, req, waitingState{ - stateKind: waitFor, + kind: waitFor, txn: &intent.Txn, - ts: intent.Txn.WriteTimestamp, - dur: lock.Replicated, key: intent.Key, held: true, - access: spanset.SpanReadWrite, guardAccess: sa, }) } @@ -383,7 +379,7 @@ func (w *lockTableWaiterImpl) pushLockTxn( // with the responsibility to abort the intents (for example if we find the // transaction aborted). To do better here, we need per-intent information // on whether we need to poison. - resolve := roachpb.MakeLockUpdateWithDur(&pusheeTxn, roachpb.Span{Key: ws.key}, ws.dur) + resolve := roachpb.MakeLockUpdate(&pusheeTxn, roachpb.Span{Key: ws.key}) opts := intentresolver.ResolveOptions{Poison: true} return w.ir.ResolveIntent(ctx, resolve, opts) } @@ -404,14 +400,6 @@ func (w *lockTableWaiterImpl) pushLockTxn( // caller is expected to terminate the push if it observes any state transitions // in the lockTable. As such, the push is only expected to be allowed to run to // completion in cases where requests are truly deadlocked. -// -// TODO(nvanbenschoten): what if both the pusher and pusher are deadlocked on -// each other and both are aborted but notice that the other is aborted first? -// They with both wait for the other to exit its lock wait-queue and they will -// deadlock. Even if we pushed again, there's no guarantee that the same thing -// wouldn't happen. This seems exceedingly rare, but it isn't handled properly. -// The best way to fix this seems to be to confirm that the pusher is not -// aborted _after_ performing the push using a QueryTxn request. func (w *lockTableWaiterImpl) pushRequestTxn( ctx context.Context, req Request, ws waitingState, ) *Error { @@ -425,6 +413,10 @@ func (w *lockTableWaiterImpl) pushRequestTxn( log.VEventf(ctx, 3, "pushing txn %s to detect request deadlock", ws.txn.ID.Short()) _, err := w.ir.PushTransaction(ctx, ws.txn, h, pushType) + if err != nil { + return err + } + // Even if the push succeeded and aborted the other transaction to break a // deadlock, there's nothing for the pusher to clean up. The conflicting // request will quickly exit the lock wait-queue and release its reservation @@ -432,7 +424,49 @@ func (w *lockTableWaiterImpl) pushRequestTxn( // because it was not waiting on any locks. If the pusher's request does end // up hitting a lock which the pushee fails to clean up, it will perform the // cleanup itself using pushLockTxn. - return err + // + // It may appear that there is a bug here in the handling of request-only + // dependency cycles. If such a cycle was broken by simultaneously aborting + // the transactions responsible for each of the request, there would be no + // guarantee that an aborted pusher would notice that its own transaction + // was aborted before it notices that its pushee's transaction was aborted. + // For example, in the simplest case, imagine two requests deadlocked on + // each other. If their transactions are both aborted and each push notices + // the pushee is aborted first, they will both return here triumphantly and + // wait for the other to exit its lock wait-queues, leading to deadlock. + // Even if they eventually pushed each other again, there would be no + // guarantee that the same thing wouldn't happen. + // + // However, such a situation is not possible in practice because such a + // dependency cycle is never constructed by the lockTable. The lockTable + // assigns each request a monotonically increasing sequence number upon its + // initial entrance to the lockTable. This sequence number is used to + // straighten out dependency chains of requests such that a request only + // waits on conflicting requests with lower sequence numbers than its own + // sequence number. This behavior guarantees that request-only dependency + // cycles are never constructed by the lockTable. Put differently, all + // dependency cycles must include at least one dependency on a lock and, + // therefore, one call to pushLockTxn. Unlike pushRequestTxn, pushLockTxn + // actively removes the conflicting lock and removes the dependency when it + // determines that its pushee transaction is aborted. This means that the + // call to pushLockTxn will continue to make forward progress in the case of + // a simultaneous abort of all transactions behind the members of the cycle, + // preventing such a hypothesized deadlock from ever materializing. + // + // Example: + // + // req(1, txn1), req(1, txn2) are both waiting on a lock held by txn3, and + // they respectively hold a reservation on key "a" and key "b". req(2, txn2) + // queues up behind the reservation on key "a" and req(2, txn1) queues up + // behind the reservation on key "b". Now the dependency cycle between txn1 + // and txn2 only involves requests, but some of the requests here also + // depend on a lock. So when both txn1, txn2 are aborted, the req(1, txn1), + // req(1, txn2) are guaranteed to eventually notice through self-directed + // QueryTxn requests and will exit the lockTable, allowing req(2, txn1) and + // req(2, txn2) to get the reservation and now they no longer depend on each + // other. + // + return nil } func (w *lockTableWaiterImpl) pushHeader(req Request) roachpb.Header { diff --git a/pkg/kv/kvserver/concurrency/lock_table_waiter_test.go b/pkg/kv/kvserver/concurrency/lock_table_waiter_test.go index b1d593f190f1..a30195f10d09 100644 --- a/pkg/kv/kvserver/concurrency/lock_table_waiter_test.go +++ b/pkg/kv/kvserver/concurrency/lock_table_waiter_test.go @@ -117,7 +117,7 @@ func TestLockTableWaiterWithTxn(t *testing.T) { w, _, g := setupLockTableWaiterTest() defer w.stopper.Stop(ctx) - g.state = waitingState{stateKind: doneWaiting} + g.state = waitingState{kind: doneWaiting} g.notify() err := w.WaitOn(ctx, makeReq(), g) @@ -187,7 +187,7 @@ func TestLockTableWaiterWithNonTxn(t *testing.T) { w, _, g := setupLockTableWaiterTest() defer w.stopper.Stop(ctx) - g.state = waitingState{stateKind: doneWaiting} + g.state = waitingState{kind: doneWaiting} g.notify() err := w.WaitOn(ctx, makeReq(), g) @@ -221,7 +221,7 @@ func TestLockTableWaiterWithNonTxn(t *testing.T) { }) } -func testWaitPush(t *testing.T, k stateKind, makeReq func() Request, expPushTS hlc.Timestamp) { +func testWaitPush(t *testing.T, k waitKind, makeReq func() Request, expPushTS hlc.Timestamp) { ctx := context.Background() keyA := roachpb.Key("keyA") testutils.RunTrueAndFalse(t, "lockHeld", func(t *testing.T, lockHeld bool) { @@ -232,12 +232,10 @@ func testWaitPush(t *testing.T, k stateKind, makeReq func() Request, expPushTS h req := makeReq() g.state = waitingState{ - stateKind: k, + kind: k, txn: &pusheeTxn.TxnMeta, - ts: pusheeTxn.WriteTimestamp, key: keyA, held: lockHeld, - access: spanset.SpanReadWrite, guardAccess: spanset.SpanReadOnly, } if waitAsWrite { @@ -287,12 +285,12 @@ func testWaitPush(t *testing.T, k stateKind, makeReq func() Request, expPushTS h require.Equal(t, keyA, intent.Key) require.Equal(t, pusheeTxn.ID, intent.Txn.ID) require.Equal(t, roachpb.ABORTED, intent.Status) - g.state = waitingState{stateKind: doneWaiting} + g.state = waitingState{kind: doneWaiting} g.notify() return nil } } else { - g.state = waitingState{stateKind: doneWaiting} + g.state = waitingState{kind: doneWaiting} g.notify() } return resp, nil @@ -304,12 +302,12 @@ func testWaitPush(t *testing.T, k stateKind, makeReq func() Request, expPushTS h }) } -func testWaitNoopUntilDone(t *testing.T, k stateKind, makeReq func() Request) { +func testWaitNoopUntilDone(t *testing.T, k waitKind, makeReq func() Request) { ctx := context.Background() w, _, g := setupLockTableWaiterTest() defer w.stopper.Stop(ctx) - g.state = waitingState{stateKind: k} + g.state = waitingState{kind: k} g.notify() defer notifyUntilDone(t, g)() @@ -326,7 +324,7 @@ func notifyUntilDone(t *testing.T, g *mockLockTableGuard) func() { <-g.stateObserved g.notify() <-g.stateObserved - g.state = waitingState{stateKind: doneWaiting} + g.state = waitingState{kind: doneWaiting} g.notify() <-g.stateObserved close(done) @@ -359,12 +357,10 @@ func TestLockTableWaiterIntentResolverError(t *testing.T) { pusheeTxn := makeTxnProto("pushee") lockHeld := sync g.state = waitingState{ - stateKind: waitForDistinguished, + kind: waitForDistinguished, txn: &pusheeTxn.TxnMeta, - ts: pusheeTxn.WriteTimestamp, key: keyA, held: lockHeld, - access: spanset.SpanReadWrite, guardAccess: spanset.SpanReadWrite, } diff --git a/pkg/kv/kvserver/concurrency/testdata/concurrency_manager/deadlocks b/pkg/kv/kvserver/concurrency/testdata/concurrency_manager/deadlocks index 667acc2d8857..32740c5cc87e 100644 --- a/pkg/kv/kvserver/concurrency/testdata/concurrency_manager/deadlocks +++ b/pkg/kv/kvserver/concurrency/testdata/concurrency_manager/deadlocks @@ -11,6 +11,8 @@ # txn2 proceeds and commits # ------------------------------------------------------------- +subtest lock_ordering + new-txn name=txn1 ts=10,1 epoch=0 ---- @@ -190,6 +192,8 @@ on-txn-updated txn=txn2 status=committed reset namespace ---- +subtest end + # ------------------------------------------------------------- # More complex deadlock due to lock ordering where not all of # the members of the deadlock are distinguished waiters. @@ -205,6 +209,8 @@ reset namespace # txn2 proceeds and commits # ------------------------------------------------------------- +subtest lock_ordering_complex + new-txn name=txn1 ts=10,1 epoch=0 ---- @@ -412,6 +418,8 @@ on-txn-updated txn=txn2 status=committed reset namespace ---- +subtest end + # ------------------------------------------------------------- # Deadlock due to request ordering. # @@ -429,6 +437,8 @@ reset namespace # txn3 proceeds and commits # ------------------------------------------------------------- +subtest request_ordering_reservation_aborted_pushing_lock_holder + new-txn name=txn1 ts=10,1 epoch=0 ---- @@ -632,6 +642,8 @@ on-txn-updated txn=txn3 status=committed reset namespace ---- +subtest end + # ------------------------------------------------------------- # Deadlock due to request ordering. # @@ -649,6 +661,8 @@ reset namespace # txn4 proceeds and commits # ------------------------------------------------------------- +subtest request_ordering_lock_holder_aborted_pushing_reservation + new-txn name=txn1 ts=10,1 epoch=0 ---- @@ -853,6 +867,8 @@ on-txn-updated txn=txn4 status=committed reset namespace ---- +subtest end + # ------------------------------------------------------------- # Deadlock due to request ordering. # @@ -873,6 +889,8 @@ reset namespace # txn5 proceeds and commits # ------------------------------------------------------------- +subtest request_ordering_reservation_aborted_pushing_reservation + new-txn name=txn1 ts=10,1 epoch=0 ---- @@ -1092,3 +1110,5 @@ on-txn-updated txn=txn5 status=committed reset namespace ---- + +subtest end diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/add_discovered b/pkg/kv/kvserver/concurrency/testdata/lock_table/add_discovered index c3c081b8afcd..fed77918440d 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/add_discovered +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/add_discovered @@ -82,7 +82,7 @@ new: state=doneWaiting guard-state r=req3 ---- -new: state=waitForDistinguished txn=txn2 ts=10,1 key="a" held=false guard-access=write +new: state=waitForDistinguished txn=txn2 key="a" held=false guard-access=write # -------------------------------- # Setup complete, test starts here @@ -103,7 +103,7 @@ start-waiting: true guard-state r=req2 ---- -new: state=waitForDistinguished txn=txn3 ts=10,1 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn3 key="a" held=true guard-access=write guard-state r=req3 ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/basic b/pkg/kv/kvserver/concurrency/testdata/lock_table/basic index 405563a7d81a..fe683c871ecf 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/basic +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/basic @@ -116,7 +116,7 @@ start-waiting: true guard-state r=req4 ---- -new: state=waitForDistinguished txn=txn1 ts=10,2 key="b" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="b" held=true guard-access=write # Release lock on b since epoch of txn1 has changed. update txn=txn1 ts=11,1 epoch=1 span=b @@ -134,7 +134,7 @@ local: num=0 guard-state r=req4 ---- -new: state=waitForDistinguished txn=txn1 ts=10,1 key="c" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="c" held=true guard-access=write # Release lock on c since epoch of txn1 has changed. update txn=txn1 ts=11,1 epoch=1 span=c,e @@ -224,7 +224,7 @@ start-waiting: true guard-state r=req4 ---- -new: state=waitForDistinguished txn=txn3 ts=6 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn3 key="a" held=true guard-access=write print ---- @@ -319,7 +319,7 @@ local: num=0 guard-state r=req6 ---- -new: state=waitForDistinguished txn=txn2 ts=8,12 key="b" held=false guard-access=write +new: state=waitForDistinguished txn=txn2 key="b" held=false guard-access=write # req7 from txn3 only wants to write to c @@ -348,7 +348,7 @@ start-waiting: true guard-state r=req7 ---- -new: state=waitForDistinguished txn=txn2 ts=8,12 key="c" held=false guard-access=write +new: state=waitForDistinguished txn=txn2 key="c" held=false guard-access=write print ---- @@ -398,11 +398,11 @@ local: num=0 guard-state r=req4 ---- -new: state=waitForDistinguished txn=txn3 ts=6 key="f" held=true guard-access=read +new: state=waitForDistinguished txn=txn3 key="f" held=true guard-access=read guard-state r=req6 ---- -old: state=waitForDistinguished txn=txn2 ts=8,12 key="b" held=false guard-access=write +old: state=waitForDistinguished txn=txn2 key="b" held=false guard-access=write print ---- @@ -513,11 +513,11 @@ local: num=0 guard-state r=req6 ---- -new: state=waitForDistinguished txn=txn2 ts=8,12 key="b" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="b" held=true guard-access=write guard-state r=req7 ---- -new: state=waitForDistinguished txn=txn2 ts=8,12 key="c" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="c" held=true guard-access=write print ---- @@ -590,7 +590,7 @@ new: state=doneWaiting guard-state r=req6 ---- -old: state=waitForDistinguished txn=txn2 ts=8,12 key="b" held=true guard-access=write +old: state=waitForDistinguished txn=txn2 key="b" held=true guard-access=write print ---- @@ -663,7 +663,7 @@ start-waiting: true guard-state r=req7 ---- -new: state=waitForDistinguished txn=txn1 ts=11,1 key="c" held=false guard-access=write +new: state=waitForDistinguished txn=txn1 key="c" held=false guard-access=write scan r=req6 ---- @@ -705,7 +705,7 @@ start-waiting: true guard-state r=req8 ---- -new: state=waitForDistinguished txn=txn1 ts=10,1 key="e" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="e" held=true guard-access=write dequeue r=req8 ---- @@ -764,7 +764,7 @@ start-waiting: true guard-state r=req10 ---- -new: state=waitForDistinguished txn=txn1 ts=10,1 key="c" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="c" held=true guard-access=write new-request r=req11 txn=txn3 ts=6 spans=w@c ---- @@ -775,7 +775,7 @@ start-waiting: true guard-state r=req11 ---- -new: state=waitFor txn=txn1 ts=10,1 key="c" held=true guard-access=write +new: state=waitFor txn=txn1 key="c" held=true guard-access=write new-request r=req12 txn=txn2 ts=8,12 spans=w@c ---- @@ -786,7 +786,7 @@ start-waiting: true guard-state r=req12 ---- -new: state=waitFor txn=txn1 ts=10,1 key="c" held=true guard-access=write +new: state=waitFor txn=txn1 key="c" held=true guard-access=write print ---- @@ -817,7 +817,7 @@ new: state=doneWaiting guard-state r=req11 ---- -new: state=waitForDistinguished txn=txn2 ts=8,12 key="c" held=false guard-access=write +new: state=waitForDistinguished txn=txn2 key="c" held=false guard-access=write guard-state r=req12 ---- @@ -850,7 +850,7 @@ local: num=0 guard-state r=req11 ---- -new: state=waitForDistinguished txn=txn2 ts=8,12 key="c" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="c" held=true guard-access=write # Since req10 that is also txn2 has acquired the lock, req12 does not need to wait here anymore. guard-state r=req12 @@ -899,7 +899,7 @@ local: num=0 guard-state r=req11 ---- -old: state=waitForDistinguished txn=txn2 ts=8,12 key="c" held=true guard-access=write +old: state=waitForDistinguished txn=txn2 key="c" held=true guard-access=write release txn=txn2 span=b,d ---- @@ -1070,7 +1070,7 @@ local: num=0 guard-state r=req18 ---- -new: state=waitFor txn=txn1 ts=9 key="d" held=true guard-access=write +new: state=waitFor txn=txn1 key="d" held=true guard-access=write print ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/clear b/pkg/kv/kvserver/concurrency/testdata/lock_table/clear index 000c7c703660..415ae0c1f243 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/clear +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/clear @@ -85,7 +85,7 @@ start-waiting: true guard-state r=req3 ---- -new: state=waitForDistinguished txn=txn1 ts=10,1 key="a" held=true guard-access=read +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=read # Similarly, a non-transactional write at a arrives and blocks. @@ -98,7 +98,7 @@ start-waiting: true guard-state r=req4 ---- -new: state=waitFor txn=txn1 ts=10,1 key="a" held=true guard-access=write +new: state=waitFor txn=txn1 key="a" held=true guard-access=write # txn3 tries to write to b which also has a lock held, so txn3 has to wait. @@ -111,7 +111,7 @@ start-waiting: true guard-state r=req5 ---- -new: state=waitForDistinguished txn=txn1 ts=10,1 key="b" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="b" held=true guard-access=write print ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/disable b/pkg/kv/kvserver/concurrency/testdata/lock_table/disable index 33992a96d05e..659df2f695a5 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/disable +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/disable @@ -88,7 +88,7 @@ start-waiting: true guard-state r=req2 ---- -new: state=waitForDistinguished txn=txn2 ts=10,1 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="a" held=true guard-access=write release txn=txn2 span=a ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/dup_access b/pkg/kv/kvserver/concurrency/testdata/lock_table/dup_access index cae9513ddfdb..dc87f1f644c0 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/dup_access +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/dup_access @@ -47,7 +47,7 @@ start-waiting: true guard-state r=req2 ---- -new: state=waitForDistinguished txn=txn1 ts=10 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=write print ---- @@ -134,7 +134,7 @@ start-waiting: true guard-state r=req4 ---- -new: state=waitForDistinguished txn=txn1 ts=10 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=write new-request r=req5 txn=txn3 ts=10 spans=w@b+w@c+r@b ---- @@ -145,7 +145,7 @@ start-waiting: true guard-state r=req5 ---- -new: state=waitForDistinguished txn=txn1 ts=10 key="b" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="b" held=true guard-access=write print ---- @@ -182,7 +182,7 @@ local: num=0 guard-state r=req5 ---- -new: state=waitForDistinguished txn=txn1 ts=10 key="c" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="c" held=true guard-access=write print ---- @@ -354,7 +354,7 @@ start-waiting: true guard-state r=req7 ---- -new: state=waitForDistinguished txn=txn1 ts=10 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=write new-request r=req8 txn=none ts=10 spans=w@b+w@c+r@b ---- @@ -365,7 +365,7 @@ start-waiting: true guard-state r=req8 ---- -new: state=waitForDistinguished txn=txn1 ts=10 key="b" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="b" held=true guard-access=write # req9 is just to prevent the lock for "b" from being gc'd and then a new one # created when req7 acquires "b", which due to the old snapshot held by req8 @@ -379,7 +379,7 @@ start-waiting: true guard-state r=req9 ---- -new: state=waitFor txn=txn1 ts=10 key="b" held=true guard-access=write +new: state=waitFor txn=txn1 key="b" held=true guard-access=write print ---- @@ -417,7 +417,7 @@ local: num=0 guard-state r=req8 ---- -new: state=waitForDistinguished txn=txn1 ts=10 key="c" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="c" held=true guard-access=write print ---- @@ -502,7 +502,7 @@ local: num=0 guard-state r=req8 ---- -new: state=waitForDistinguished txn=txn2 ts=10 key="b" held=true guard-access=read +new: state=waitForDistinguished txn=txn2 key="b" held=true guard-access=read print ---- @@ -585,7 +585,7 @@ start-waiting: true guard-state r=req11 ---- -new: state=waitForDistinguished txn=txn1 ts=10 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=write new-request r=req12 txn=txn3 ts=10 spans=w@b+r@b ---- @@ -596,7 +596,7 @@ start-waiting: true guard-state r=req12 ---- -new: state=waitForDistinguished txn=txn1 ts=10 key="b" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="b" held=true guard-access=write print ---- @@ -681,7 +681,7 @@ start-waiting: true guard-state r=req12 ---- -new: state=waitForDistinguished txn=txn2 ts=10 key="b" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="b" held=true guard-access=write dequeue r=req11 ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/lock_changes b/pkg/kv/kvserver/concurrency/testdata/lock_table/lock_changes index ee90e3fc38c6..581aec842664 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/lock_changes +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/lock_changes @@ -111,7 +111,7 @@ start-waiting: true guard-state r=req5 ---- -new: state=waitForDistinguished txn=txn1 ts=8 key="a" held=true guard-access=read +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=read print ---- @@ -141,7 +141,7 @@ local: num=0 guard-state r=req5 ---- -old: state=waitForDistinguished txn=txn1 ts=8 key="a" held=true guard-access=read +old: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=read acquire r=req6 k=a durability=u ---- @@ -170,7 +170,7 @@ start-waiting: true guard-state r=req7 ---- -new: state=waitForDistinguished txn=txn1 ts=14 key="a" held=true guard-access=read +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=read add-discovered r=req7 k=a txn=txn1 ---- @@ -184,4 +184,4 @@ local: num=0 guard-state r=req7 ---- -new: state=waitForDistinguished txn=txn1 ts=14 key="a" held=true guard-access=read +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=read diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/non_active_waiter b/pkg/kv/kvserver/concurrency/testdata/lock_table/non_active_waiter index e34fd414b7b4..fd625a2c66ae 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/non_active_waiter +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/non_active_waiter @@ -100,7 +100,7 @@ start-waiting: true guard-state r=req1 ---- -new: state=waitForDistinguished txn=txn2 ts=10 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="a" held=true guard-access=write print ---- @@ -138,7 +138,7 @@ local: num=0 guard-state r=req1 ---- -new: state=waitFor txn=txn2 ts=10 key="c" held=true guard-access=write +new: state=waitFor txn=txn2 key="c" held=true guard-access=write print ---- @@ -172,7 +172,7 @@ local: num=0 guard-state r=req1 ---- -new: state=waitForDistinguished txn=txn2 ts=10 key="b" held=true guard-access=read +new: state=waitForDistinguished txn=txn2 key="b" held=true guard-access=read guard-state r=req2 ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/non_txn_write b/pkg/kv/kvserver/concurrency/testdata/lock_table/non_txn_write index c5ede07c4011..d61fb9e01b0b 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/non_txn_write +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/non_txn_write @@ -137,7 +137,7 @@ new: state=doneWaiting guard-state r=req4 ---- -new: state=waitForDistinguished txn=txn2 ts=10 key="a" held=false guard-access=write +new: state=waitForDistinguished txn=txn2 key="a" held=false guard-access=write guard-state r=req5 ---- @@ -184,7 +184,7 @@ local: num=0 guard-state r=req4 ---- -new: state=waitForDistinguished txn=txn3 ts=10 key="b" held=false guard-access=write +new: state=waitForDistinguished txn=txn3 key="b" held=false guard-access=write guard-state r=req6 ---- @@ -261,11 +261,11 @@ start-waiting: true guard-state r=req4 ---- -new: state=waitForDistinguished txn=txn2 ts=10 key="c" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="c" held=true guard-access=write guard-state r=req5 ---- -new: state=waitFor txn=txn2 ts=10 key="c" held=true guard-access=write +new: state=waitFor txn=txn2 key="c" held=true guard-access=write # Release the lock. The non-transactional request does not acquire the reservation. diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/size_limit_exceeded b/pkg/kv/kvserver/concurrency/testdata/lock_table/size_limit_exceeded index 659947960767..1b023b54c594 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/size_limit_exceeded +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/size_limit_exceeded @@ -120,7 +120,7 @@ local: num=0 guard-state r=req2 ---- -new: state=waitForDistinguished txn=txn1 ts=10 key="b" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="b" held=true guard-access=write guard-state r=req3 ---- @@ -236,7 +236,7 @@ new: state=doneWaiting guard-state r=req6 ---- -new: state=waitElsewhere txn=txn1 ts=10 key="c" held=true guard-access=write +new: state=waitElsewhere txn=txn1 key="c" held=true guard-access=write scan r=req7 ---- @@ -244,4 +244,4 @@ start-waiting: true guard-state r=req7 ---- -new: state=waitForDistinguished txn=txn1 ts=10 key="d" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="d" held=true guard-access=write diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/update b/pkg/kv/kvserver/concurrency/testdata/lock_table/update index 62dc58457ffa..c888fcbdec3b 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/update +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/update @@ -65,7 +65,7 @@ start-waiting: true guard-state r=req2 ---- -new: state=waitForDistinguished txn=txn1 ts=10,1 key="a" held=true guard-access=read +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=read scan r=req3 ---- @@ -73,7 +73,7 @@ start-waiting: true guard-state r=req3 ---- -new: state=waitFor txn=txn1 ts=10,1 key="a" held=true guard-access=write +new: state=waitFor txn=txn1 key="a" held=true guard-access=write scan r=req4 ---- @@ -81,7 +81,7 @@ start-waiting: true guard-state r=req4 ---- -new: state=waitFor txn=txn1 ts=10,1 key="a" held=true guard-access=read +new: state=waitFor txn=txn1 key="a" held=true guard-access=read scan r=req5 ---- @@ -89,7 +89,7 @@ start-waiting: true guard-state r=req5 ---- -new: state=waitFor txn=txn1 ts=10,1 key="a" held=true guard-access=write +new: state=waitFor txn=txn1 key="a" held=true guard-access=write print ---- @@ -276,7 +276,7 @@ start-waiting: false guard-state r=req5 ---- -new: state=waitForDistinguished txn=txn3 ts=14,1 key="a" held=false guard-access=write +new: state=waitForDistinguished txn=txn3 key="a" held=false guard-access=write dequeue r=req3 ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/wait_self b/pkg/kv/kvserver/concurrency/testdata/lock_table/wait_self index 61aac49ceb09..f4fadda5b56a 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/wait_self +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/wait_self @@ -61,15 +61,15 @@ start-waiting: true guard-state r=req2 ---- -new: state=waitForDistinguished txn=txn1 ts=10 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=write guard-state r=req3 ---- -new: state=waitFor txn=txn1 ts=10 key="a" held=true guard-access=write +new: state=waitFor txn=txn1 key="a" held=true guard-access=write guard-state r=req4 ---- -new: state=waitFor txn=txn1 ts=10 key="a" held=true guard-access=write +new: state=waitFor txn=txn1 key="a" held=true guard-access=write print ---- @@ -100,7 +100,7 @@ new: state=doneWaiting guard-state r=req3 ---- -new: state=waitForDistinguished txn=txn2 ts=10 key="a" held=false guard-access=write +new: state=waitForDistinguished txn=txn2 key="a" held=false guard-access=write guard-state r=req4 ---- @@ -143,7 +143,7 @@ local: num=0 guard-state r=req3 ---- -new: state=waitForDistinguished txn=txn2 ts=10 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="a" held=true guard-access=write guard-state r=req4 ---- diff --git a/pkg/kv/kvserver/gc/gc.go b/pkg/kv/kvserver/gc/gc.go index 03a493ad9c65..192c269cf1d4 100644 --- a/pkg/kv/kvserver/gc/gc.go +++ b/pkg/kv/kvserver/gc/gc.go @@ -24,7 +24,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/config/zonepb" "github.com/cockroachdb/cockroach/pkg/keys" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/abortspan" - "github.com/cockroachdb/cockroach/pkg/kv/kvserver/concurrency/lock" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/storagebase" "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/cockroach/pkg/storage" @@ -413,7 +412,7 @@ func processLocalKeyRange( // If the transaction needs to be pushed or there are intents to // resolve, invoke the cleanup function. if !txn.Status.IsFinalized() || len(txn.LockSpans) > 0 { - return cleanupTxnIntentsAsyncFn(ctx, txn, roachpb.AsLockUpdates(txn, txn.LockSpans, lock.Replicated)) + return cleanupTxnIntentsAsyncFn(ctx, txn, roachpb.AsLockUpdates(txn, txn.LockSpans)) } b.FlushingAdd(ctx, key) return nil diff --git a/pkg/kv/kvserver/intentresolver/intent_resolver.go b/pkg/kv/kvserver/intentresolver/intent_resolver.go index 75e64dd36530..8f1685d40528 100644 --- a/pkg/kv/kvserver/intentresolver/intent_resolver.go +++ b/pkg/kv/kvserver/intentresolver/intent_resolver.go @@ -21,7 +21,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/kv" "github.com/cockroachdb/cockroach/pkg/kv/kvbase" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/batcheval/result" - "github.com/cockroachdb/cockroach/pkg/kv/kvserver/concurrency/lock" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/storagebase" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/txnwait" "github.com/cockroachdb/cockroach/pkg/roachpb" @@ -263,7 +262,7 @@ func updateIntentTxnStatus( // It must have been skipped. continue } - up := roachpb.MakeLockUpdateWithDur(&pushee, roachpb.Span{Key: intent.Key}, lock.Replicated) + up := roachpb.MakeLockUpdate(&pushee, roachpb.Span{Key: intent.Key}) results = append(results, up) } return results @@ -534,7 +533,7 @@ func (ir *IntentResolver) CleanupTxnIntentsAsync( return } defer release() - intents := roachpb.AsLockUpdates(et.Txn, et.Txn.LockSpans, lock.Replicated) + intents := roachpb.AsLockUpdates(et.Txn, et.Txn.LockSpans) if err := ir.cleanupFinishedTxnIntents(ctx, rangeID, et.Txn, intents, now, et.Poison, nil); err != nil { if ir.every.ShouldLog() { log.Warningf(ctx, "failed to cleanup transaction intents: %v", err) diff --git a/pkg/kv/kvserver/node_liveness.go b/pkg/kv/kvserver/node_liveness.go index 4b3e21b98c16..b5c9fac95434 100644 --- a/pkg/kv/kvserver/node_liveness.go +++ b/pkg/kv/kvserver/node_liveness.go @@ -438,7 +438,7 @@ func (nl *NodeLiveness) IsLive(nodeID roachpb.NodeID) (bool, error) { // liveness. The slice of engines will be written to before each heartbeat to // avoid maintaining liveness in the presence of disk stalls. func (nl *NodeLiveness) StartHeartbeat( - ctx context.Context, stopper *stop.Stopper, alive HeartbeatCallback, engines []storage.Engine, + ctx context.Context, stopper *stop.Stopper, engines []storage.Engine, alive HeartbeatCallback, ) { log.VEventf(ctx, 1, "starting liveness heartbeat") retryOpts := base.DefaultRetryOptions() @@ -903,9 +903,9 @@ func (nl *NodeLiveness) updateLivenessAttempt( return err } - nl.mu.Lock() + nl.mu.RLock() cb := nl.mu.heartbeatCallback - nl.mu.Unlock() + nl.mu.RUnlock() if cb != nil { cb(ctx) } diff --git a/pkg/roachpb/data.go b/pkg/roachpb/data.go index ead08d6a36b5..e80a9bb0a2dc 100644 --- a/pkg/roachpb/data.go +++ b/pkg/roachpb/data.go @@ -1875,27 +1875,25 @@ func AsIntents(txn *enginepb.TxnMeta, keys []Key) []Intent { return ret } -// MakeLockUpdate makes a lock update from the given span and txn. -// The function assumes that the lock has a replicated durability. -func MakeLockUpdate(txn *Transaction, span Span) LockUpdate { - return MakeLockUpdateWithDur(txn, span, lock.Replicated) +// MakeLockAcquisition makes a lock acquisition message from the given +// txn, key, and durability level. +func MakeLockAcquisition(txn *Transaction, key Key, dur lock.Durability) LockAcquisition { + return LockAcquisition{Span: Span{Key: key}, Txn: txn.TxnMeta, Durability: dur} } -// MakeLockUpdateWithDur makes a lock update from the given span, -// txn, and lock durability. -func MakeLockUpdateWithDur(txn *Transaction, span Span, dur lock.Durability) LockUpdate { - update := LockUpdate{Span: span} - update.SetTxn(txn) - update.Durability = dur - return update +// MakeLockUpdate makes a lock update from the given txn and span. +func MakeLockUpdate(txn *Transaction, span Span) LockUpdate { + u := LockUpdate{Span: span} + u.SetTxn(txn) + return u } -// AsLockUpdates takes a slice of spans and returns it as a slice -// of lock updates for the given transaction and lock durability. -func AsLockUpdates(txn *Transaction, spans []Span, dur lock.Durability) []LockUpdate { +// AsLockUpdates takes a slice of spans and returns it as a slice of +// lock updates. +func AsLockUpdates(txn *Transaction, spans []Span) []LockUpdate { ret := make([]LockUpdate, len(spans)) for i := range spans { - ret[i] = MakeLockUpdateWithDur(txn, spans[i], dur) + ret[i] = MakeLockUpdate(txn, spans[i]) } return ret } diff --git a/pkg/roachpb/data.pb.go b/pkg/roachpb/data.pb.go index a98dd79b7ff4..03e51e5f83ba 100644 --- a/pkg/roachpb/data.pb.go +++ b/pkg/roachpb/data.pb.go @@ -94,7 +94,7 @@ func (x ValueType) String() string { return proto.EnumName(ValueType_name, int32(x)) } func (ValueType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{0} + return fileDescriptor_data_f9077e6a844d1bb3, []int{0} } // ReplicaChangeType is a parameter of ChangeReplicasTrigger. @@ -118,7 +118,7 @@ func (x ReplicaChangeType) String() string { return proto.EnumName(ReplicaChangeType_name, int32(x)) } func (ReplicaChangeType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{1} + return fileDescriptor_data_f9077e6a844d1bb3, []int{1} } // TransactionStatus specifies possible states for a transaction. @@ -170,7 +170,7 @@ func (x TransactionStatus) String() string { return proto.EnumName(TransactionStatus_name, int32(x)) } func (TransactionStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{2} + return fileDescriptor_data_f9077e6a844d1bb3, []int{2} } // Span is a key range with an inclusive start Key and an exclusive end Key. @@ -187,7 +187,7 @@ type Span struct { func (m *Span) Reset() { *m = Span{} } func (*Span) ProtoMessage() {} func (*Span) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{0} + return fileDescriptor_data_f9077e6a844d1bb3, []int{0} } func (m *Span) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -239,7 +239,7 @@ func (m *Value) Reset() { *m = Value{} } func (m *Value) String() string { return proto.CompactTextString(m) } func (*Value) ProtoMessage() {} func (*Value) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{1} + return fileDescriptor_data_f9077e6a844d1bb3, []int{1} } func (m *Value) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -275,7 +275,7 @@ func (m *KeyValue) Reset() { *m = KeyValue{} } func (m *KeyValue) String() string { return proto.CompactTextString(m) } func (*KeyValue) ProtoMessage() {} func (*KeyValue) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{2} + return fileDescriptor_data_f9077e6a844d1bb3, []int{2} } func (m *KeyValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -313,7 +313,7 @@ func (m *StoreIdent) Reset() { *m = StoreIdent{} } func (m *StoreIdent) String() string { return proto.CompactTextString(m) } func (*StoreIdent) ProtoMessage() {} func (*StoreIdent) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{3} + return fileDescriptor_data_f9077e6a844d1bb3, []int{3} } func (m *StoreIdent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -353,7 +353,7 @@ func (m *SplitTrigger) Reset() { *m = SplitTrigger{} } func (m *SplitTrigger) String() string { return proto.CompactTextString(m) } func (*SplitTrigger) ProtoMessage() {} func (*SplitTrigger) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{4} + return fileDescriptor_data_f9077e6a844d1bb3, []int{4} } func (m *SplitTrigger) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -401,7 +401,7 @@ func (m *MergeTrigger) Reset() { *m = MergeTrigger{} } func (m *MergeTrigger) String() string { return proto.CompactTextString(m) } func (*MergeTrigger) ProtoMessage() {} func (*MergeTrigger) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{5} + return fileDescriptor_data_f9077e6a844d1bb3, []int{5} } func (m *MergeTrigger) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -471,7 +471,7 @@ type ChangeReplicasTrigger struct { func (m *ChangeReplicasTrigger) Reset() { *m = ChangeReplicasTrigger{} } func (*ChangeReplicasTrigger) ProtoMessage() {} func (*ChangeReplicasTrigger) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{6} + return fileDescriptor_data_f9077e6a844d1bb3, []int{6} } func (m *ChangeReplicasTrigger) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -513,7 +513,7 @@ func (m *ModifiedSpanTrigger) Reset() { *m = ModifiedSpanTrigger{} } func (m *ModifiedSpanTrigger) String() string { return proto.CompactTextString(m) } func (*ModifiedSpanTrigger) ProtoMessage() {} func (*ModifiedSpanTrigger) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{7} + return fileDescriptor_data_f9077e6a844d1bb3, []int{7} } func (m *ModifiedSpanTrigger) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -559,7 +559,7 @@ func (m *StickyBitTrigger) Reset() { *m = StickyBitTrigger{} } func (m *StickyBitTrigger) String() string { return proto.CompactTextString(m) } func (*StickyBitTrigger) ProtoMessage() {} func (*StickyBitTrigger) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{8} + return fileDescriptor_data_f9077e6a844d1bb3, []int{8} } func (m *StickyBitTrigger) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -598,7 +598,7 @@ func (m *InternalCommitTrigger) Reset() { *m = InternalCommitTrigger{} } func (m *InternalCommitTrigger) String() string { return proto.CompactTextString(m) } func (*InternalCommitTrigger) ProtoMessage() {} func (*InternalCommitTrigger) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{9} + return fileDescriptor_data_f9077e6a844d1bb3, []int{9} } func (m *InternalCommitTrigger) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -667,7 +667,7 @@ func (m *ObservedTimestamp) Reset() { *m = ObservedTimestamp{} } func (m *ObservedTimestamp) String() string { return proto.CompactTextString(m) } func (*ObservedTimestamp) ProtoMessage() {} func (*ObservedTimestamp) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{10} + return fileDescriptor_data_f9077e6a844d1bb3, []int{10} } func (m *ObservedTimestamp) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -903,7 +903,7 @@ type Transaction struct { func (m *Transaction) Reset() { *m = Transaction{} } func (*Transaction) ProtoMessage() {} func (*Transaction) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{11} + return fileDescriptor_data_f9077e6a844d1bb3, []int{11} } func (m *Transaction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -954,7 +954,7 @@ func (m *TransactionRecord) Reset() { *m = TransactionRecord{} } func (m *TransactionRecord) String() string { return proto.CompactTextString(m) } func (*TransactionRecord) ProtoMessage() {} func (*TransactionRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{12} + return fileDescriptor_data_f9077e6a844d1bb3, []int{12} } func (m *TransactionRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -994,7 +994,7 @@ func (m *Intent) Reset() { *m = Intent{} } func (m *Intent) String() string { return proto.CompactTextString(m) } func (*Intent) ProtoMessage() {} func (*Intent) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{13} + return fileDescriptor_data_f9077e6a844d1bb3, []int{13} } func (m *Intent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1031,7 +1031,7 @@ func (m *Intent_SingleKeySpan) Reset() { *m = Intent_SingleKeySpan{} } func (m *Intent_SingleKeySpan) String() string { return proto.CompactTextString(m) } func (*Intent_SingleKeySpan) ProtoMessage() {} func (*Intent_SingleKeySpan) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{13, 0} + return fileDescriptor_data_f9077e6a844d1bb3, []int{13, 0} } func (m *Intent_SingleKeySpan) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1056,6 +1056,43 @@ func (m *Intent_SingleKeySpan) XXX_DiscardUnknown() { var xxx_messageInfo_Intent_SingleKeySpan proto.InternalMessageInfo +// A LockAcquisition represents the action of a Transaction acquiring a lock +// with a specified durbility level over a Span of keys. +type LockAcquisition struct { + Span `protobuf:"bytes,1,opt,name=span,proto3,embedded=span" json:"span"` + Txn enginepb.TxnMeta `protobuf:"bytes,2,opt,name=txn,proto3" json:"txn"` + Durability lock.Durability `protobuf:"varint,3,opt,name=durability,proto3,enum=cockroach.kv.kvserver.concurrency.lock.Durability" json:"durability,omitempty"` +} + +func (m *LockAcquisition) Reset() { *m = LockAcquisition{} } +func (m *LockAcquisition) String() string { return proto.CompactTextString(m) } +func (*LockAcquisition) ProtoMessage() {} +func (*LockAcquisition) Descriptor() ([]byte, []int) { + return fileDescriptor_data_f9077e6a844d1bb3, []int{14} +} +func (m *LockAcquisition) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LockAcquisition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (dst *LockAcquisition) XXX_Merge(src proto.Message) { + xxx_messageInfo_LockAcquisition.Merge(dst, src) +} +func (m *LockAcquisition) XXX_Size() int { + return m.Size() +} +func (m *LockAcquisition) XXX_DiscardUnknown() { + xxx_messageInfo_LockAcquisition.DiscardUnknown(m) +} + +var xxx_messageInfo_LockAcquisition proto.InternalMessageInfo + // A LockUpdate is a Span together with Transaction state. LockUpdate messages // are used to update all locks held by the transaction within the span to the // transaction's authoritative state. As such, the message is used as input @@ -1066,14 +1103,13 @@ type LockUpdate struct { Txn enginepb.TxnMeta `protobuf:"bytes,2,opt,name=txn,proto3" json:"txn"` Status TransactionStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cockroach.roachpb.TransactionStatus" json:"status,omitempty"` IgnoredSeqNums []enginepb.IgnoredSeqNumRange `protobuf:"bytes,4,rep,name=ignored_seqnums,json=ignoredSeqnums,proto3" json:"ignored_seqnums"` - Durability lock.Durability `protobuf:"varint,5,opt,name=durability,proto3,enum=cockroach.kv.kvserver.concurrency.lock.Durability" json:"durability,omitempty"` } func (m *LockUpdate) Reset() { *m = LockUpdate{} } func (m *LockUpdate) String() string { return proto.CompactTextString(m) } func (*LockUpdate) ProtoMessage() {} func (*LockUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{14} + return fileDescriptor_data_f9077e6a844d1bb3, []int{15} } func (m *LockUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1110,7 +1146,7 @@ func (m *SequencedWrite) Reset() { *m = SequencedWrite{} } func (m *SequencedWrite) String() string { return proto.CompactTextString(m) } func (*SequencedWrite) ProtoMessage() {} func (*SequencedWrite) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{15} + return fileDescriptor_data_f9077e6a844d1bb3, []int{16} } func (m *SequencedWrite) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1174,7 +1210,7 @@ type Lease struct { func (m *Lease) Reset() { *m = Lease{} } func (*Lease) ProtoMessage() {} func (*Lease) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{16} + return fileDescriptor_data_f9077e6a844d1bb3, []int{17} } func (m *Lease) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1219,7 +1255,7 @@ func (m *AbortSpanEntry) Reset() { *m = AbortSpanEntry{} } func (m *AbortSpanEntry) String() string { return proto.CompactTextString(m) } func (*AbortSpanEntry) ProtoMessage() {} func (*AbortSpanEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{17} + return fileDescriptor_data_f9077e6a844d1bb3, []int{18} } func (m *AbortSpanEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1276,7 +1312,7 @@ func (m *LeafTxnInputState) Reset() { *m = LeafTxnInputState{} } func (m *LeafTxnInputState) String() string { return proto.CompactTextString(m) } func (*LeafTxnInputState) ProtoMessage() {} func (*LeafTxnInputState) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{18} + return fileDescriptor_data_f9077e6a844d1bb3, []int{19} } func (m *LeafTxnInputState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1329,7 +1365,7 @@ func (m *LeafTxnFinalState) Reset() { *m = LeafTxnFinalState{} } func (m *LeafTxnFinalState) String() string { return proto.CompactTextString(m) } func (*LeafTxnFinalState) ProtoMessage() {} func (*LeafTxnFinalState) Descriptor() ([]byte, []int) { - return fileDescriptor_data_0066accafc18e32c, []int{19} + return fileDescriptor_data_f9077e6a844d1bb3, []int{20} } func (m *LeafTxnFinalState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1370,6 +1406,7 @@ func init() { proto.RegisterType((*TransactionRecord)(nil), "cockroach.roachpb.TransactionRecord") proto.RegisterType((*Intent)(nil), "cockroach.roachpb.Intent") proto.RegisterType((*Intent_SingleKeySpan)(nil), "cockroach.roachpb.Intent.SingleKeySpan") + proto.RegisterType((*LockAcquisition)(nil), "cockroach.roachpb.LockAcquisition") proto.RegisterType((*LockUpdate)(nil), "cockroach.roachpb.LockUpdate") proto.RegisterType((*SequencedWrite)(nil), "cockroach.roachpb.SequencedWrite") proto.RegisterType((*Lease)(nil), "cockroach.roachpb.Lease") @@ -1850,6 +1887,36 @@ func (this *Intent_SingleKeySpan) Equal(that interface{}) bool { } return true } +func (this *LockAcquisition) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*LockAcquisition) + if !ok { + that2, ok := that.(LockAcquisition) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Span.Equal(&that1.Span) { + return false + } + if !this.Txn.Equal(&that1.Txn) { + return false + } + if this.Durability != that1.Durability { + return false + } + return true +} func (this *LockUpdate) Equal(that interface{}) bool { if that == nil { return this == nil @@ -1886,9 +1953,6 @@ func (this *LockUpdate) Equal(that interface{}) bool { return false } } - if this.Durability != that1.Durability { - return false - } return true } func (this *SequencedWrite) Equal(that interface{}) bool { @@ -2687,7 +2751,7 @@ func (m *Intent_SingleKeySpan) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *LockUpdate) Marshal() (dAtA []byte, err error) { +func (m *LockAcquisition) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2697,7 +2761,7 @@ func (m *LockUpdate) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *LockUpdate) MarshalTo(dAtA []byte) (int, error) { +func (m *LockAcquisition) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int @@ -2718,6 +2782,45 @@ func (m *LockUpdate) MarshalTo(dAtA []byte) (int, error) { return 0, err } i += n30 + if m.Durability != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintData(dAtA, i, uint64(m.Durability)) + } + return i, nil +} + +func (m *LockUpdate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LockUpdate) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintData(dAtA, i, uint64(m.Span.Size())) + n31, err := m.Span.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n31 + dAtA[i] = 0x12 + i++ + i = encodeVarintData(dAtA, i, uint64(m.Txn.Size())) + n32, err := m.Txn.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n32 if m.Status != 0 { dAtA[i] = 0x18 i++ @@ -2735,11 +2838,6 @@ func (m *LockUpdate) MarshalTo(dAtA []byte) (int, error) { i += n } } - if m.Durability != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintData(dAtA, i, uint64(m.Durability)) - } return i, nil } @@ -2790,48 +2888,48 @@ func (m *Lease) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintData(dAtA, i, uint64(m.Start.Size())) - n31, err := m.Start.MarshalTo(dAtA[i:]) + n33, err := m.Start.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n31 + i += n33 if m.Expiration != nil { dAtA[i] = 0x12 i++ i = encodeVarintData(dAtA, i, uint64(m.Expiration.Size())) - n32, err := m.Expiration.MarshalTo(dAtA[i:]) + n34, err := m.Expiration.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n32 + i += n34 } dAtA[i] = 0x1a i++ i = encodeVarintData(dAtA, i, uint64(m.Replica.Size())) - n33, err := m.Replica.MarshalTo(dAtA[i:]) + n35, err := m.Replica.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n33 + i += n35 if m.DeprecatedStartStasis != nil { dAtA[i] = 0x22 i++ i = encodeVarintData(dAtA, i, uint64(m.DeprecatedStartStasis.Size())) - n34, err := m.DeprecatedStartStasis.MarshalTo(dAtA[i:]) + n36, err := m.DeprecatedStartStasis.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n34 + i += n36 } if m.ProposedTS != nil { dAtA[i] = 0x2a i++ i = encodeVarintData(dAtA, i, uint64(m.ProposedTS.Size())) - n35, err := m.ProposedTS.MarshalTo(dAtA[i:]) + n37, err := m.ProposedTS.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n35 + i += n37 } if m.Epoch != 0 { dAtA[i] = 0x30 @@ -2870,11 +2968,11 @@ func (m *AbortSpanEntry) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintData(dAtA, i, uint64(m.Timestamp.Size())) - n36, err := m.Timestamp.MarshalTo(dAtA[i:]) + n38, err := m.Timestamp.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n36 + i += n38 if m.Priority != 0 { dAtA[i] = 0x18 i++ @@ -2901,11 +2999,11 @@ func (m *LeafTxnInputState) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintData(dAtA, i, uint64(m.Txn.Size())) - n37, err := m.Txn.MarshalTo(dAtA[i:]) + n39, err := m.Txn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n37 + i += n39 if m.RefreshInvalid { dAtA[i] = 0x38 i++ @@ -2964,11 +3062,11 @@ func (m *LeafTxnFinalState) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintData(dAtA, i, uint64(m.Txn.Size())) - n38, err := m.Txn.MarshalTo(dAtA[i:]) + n40, err := m.Txn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n38 + i += n40 if m.DeprecatedCommandCount != 0 { dAtA[i] = 0x18 i++ @@ -3580,6 +3678,22 @@ func (m *Intent_SingleKeySpan) Size() (n int) { return n } +func (m *LockAcquisition) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Span.Size() + n += 1 + l + sovData(uint64(l)) + l = m.Txn.Size() + n += 1 + l + sovData(uint64(l)) + if m.Durability != 0 { + n += 1 + sovData(uint64(m.Durability)) + } + return n +} + func (m *LockUpdate) Size() (n int) { if m == nil { return 0 @@ -3599,9 +3713,6 @@ func (m *LockUpdate) Size() (n int) { n += 1 + l + sovData(uint64(l)) } } - if m.Durability != 0 { - n += 1 + sovData(uint64(m.Durability)) - } return n } @@ -6030,7 +6141,7 @@ func (m *Intent_SingleKeySpan) Unmarshal(dAtA []byte) error { } return nil } -func (m *LockUpdate) Unmarshal(dAtA []byte) error { +func (m *LockAcquisition) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6053,10 +6164,10 @@ func (m *LockUpdate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LockUpdate: wiretype end group for non-group") + return fmt.Errorf("proto: LockAcquisition: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LockUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LockAcquisition: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -6121,9 +6232,9 @@ func (m *LockUpdate) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Durability", wireType) } - m.Status = 0 + m.Durability = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowData @@ -6133,14 +6244,64 @@ func (m *LockUpdate) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Status |= (TransactionStatus(b) & 0x7F) << shift + m.Durability |= (lock.Durability(b) & 0x7F) << shift if b < 0x80 { break } } - case 4: + default: + iNdEx = preIndex + skippy, err := skipData(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthData + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LockUpdate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowData + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LockUpdate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LockUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IgnoredSeqNums", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Span", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6164,16 +6325,45 @@ func (m *LockUpdate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.IgnoredSeqNums = append(m.IgnoredSeqNums, enginepb.IgnoredSeqNumRange{}) - if err := m.IgnoredSeqNums[len(m.IgnoredSeqNums)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Span.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Txn", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowData + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthData + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Txn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Durability", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } - m.Durability = 0 + m.Status = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowData @@ -6183,11 +6373,42 @@ func (m *LockUpdate) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Durability |= (lock.Durability(b) & 0x7F) << shift + m.Status |= (TransactionStatus(b) & 0x7F) << shift if b < 0x80 { break } } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IgnoredSeqNums", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowData + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthData + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IgnoredSeqNums = append(m.IgnoredSeqNums, enginepb.IgnoredSeqNumRange{}) + if err := m.IgnoredSeqNums[len(m.IgnoredSeqNums)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipData(dAtA[iNdEx:]) @@ -7111,157 +7332,158 @@ var ( ErrIntOverflowData = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("roachpb/data.proto", fileDescriptor_data_0066accafc18e32c) } - -var fileDescriptor_data_0066accafc18e32c = []byte{ - // 2369 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0xcd, 0x6f, 0xdb, 0xc8, - 0x15, 0x37, 0x2d, 0x4a, 0xa2, 0x9e, 0x3e, 0x4c, 0x4f, 0xe2, 0x44, 0xeb, 0xb4, 0x56, 0xaa, 0x6d, - 0xbb, 0x69, 0xd0, 0x95, 0x51, 0x67, 0xbb, 0x68, 0xd3, 0xa0, 0xa8, 0x64, 0x29, 0x89, 0x14, 0xcb, - 0xca, 0x52, 0x72, 0x16, 0xc9, 0xee, 0x82, 0xa5, 0xc8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 0x0f, 0xbd, 0x40, - 0x11, 0x4d, 0x46, 0x91, 0x25, 0xe3, 0xb5, 0xa3, 0x69, 0xe9, 0x72, 0x3d, 0xe4, 0xda, 0xc6, 0x87, - 0x9e, 0x2f, 0xcf, 0x92, 0x33, 0x13, 0xbe, 0x28, 0x97, 0x8d, 0x99, 0x5c, 0x06, 0x7a, 0x1f, 0x44, - 0x16, 0xa3, 0xc9, 0x79, 0x63, 0x54, 0x61, 0xfc, 0xa8, 0x0f, 0x97, 0x4d, 0xdb, 0xc3, 0xae, 0xad, - 0x0d, 0x55, 0xcd, 0x30, 0xe2, 0x66, 0x48, 0x9d, 0xd9, 0x0c, 0x2b, 0x01, 0x54, 0x95, 0x22, 0x85, - 0x26, 0xd8, 0x85, 0xb7, 0x42, 0x1d, 0x2e, 0xb6, 0x9c, 0x83, 0xb8, 0x96, 0xf4, 0x99, 0xb5, 0x84, - 0x1b, 0x56, 0x38, 0x56, 0xa0, 0xe7, 0xa6, 0x44, 0x5b, 0x0e, 0xab, 0xf9, 0x9f, 0x09, 0x70, 0xa1, - 0xed, 0x18, 0xe6, 0xae, 0x89, 0x0d, 0xda, 0xca, 0x82, 0x78, 0xfd, 0x2e, 0x20, 0x32, 0x21, 0x1e, - 0xb6, 0x54, 0xdd, 0xb1, 0x77, 0xcd, 0x81, 0x4a, 0x46, 0x9a, 0xcd, 0x62, 0x55, 0x52, 0x64, 0x4e, - 0xd9, 0x64, 0x04, 0xd6, 0xff, 0x1a, 0x80, 0x58, 0x91, 0x1d, 0x9a, 0x07, 0xd8, 0xc6, 0x84, 0x70, - 0x6e, 0x1e, 0x81, 0x97, 0x67, 0x6c, 0x98, 0x0a, 0x29, 0x32, 0x15, 0xd9, 0xf2, 0x25, 0xe8, 0x8a, - 0xdf, 0x86, 0x3e, 0x06, 0xb9, 0xeb, 0x99, 0xfa, 0xfe, 0xa4, 0x16, 0x95, 0xd4, 0x1a, 0x00, 0x61, - 0x6b, 0x6a, 0xdf, 0xf4, 0xfc, 0x32, 0x35, 0x5f, 0x93, 0x23, 0x01, 0x94, 0x8f, 0xfe, 0xa7, 0x04, - 0xac, 0x34, 0x7d, 0xb3, 0x6c, 0x3a, 0x96, 0x15, 0xe9, 0xa8, 0x43, 0x9e, 0xd0, 0x32, 0xae, 0x7a, - 0x7c, 0xc1, 0x57, 0x53, 0x9a, 0xb9, 0xff, 0xa8, 0xdc, 0x2b, 0x39, 0x12, 0x2f, 0xfe, 0x75, 0xc8, - 0x5b, 0xb4, 0xbe, 0x86, 0x28, 0x8b, 0xaf, 0x45, 0x89, 0xd7, 0x61, 0x25, 0x67, 0xc5, 0xab, 0xf2, - 0x4f, 0xe1, 0xb2, 0x5f, 0x23, 0x02, 0xf7, 0x87, 0x78, 0x09, 0x86, 0x77, 0x6d, 0x06, 0xde, 0xcc, - 0xca, 0xa3, 0xac, 0xe8, 0xaf, 0x29, 0x48, 0x2b, 0x96, 0xef, 0x77, 0xe6, 0xad, 0x10, 0x9f, 0x17, - 0xdb, 0x6f, 0xcf, 0xda, 0xef, 0xc9, 0x38, 0x51, 0x2e, 0x58, 0x33, 0x82, 0xe7, 0x03, 0x40, 0x91, - 0xb7, 0x42, 0x60, 0x9e, 0x70, 0x6f, 0xcf, 0x32, 0xe7, 0x2b, 0xee, 0x56, 0x64, 0xf2, 0xca, 0xca, - 0x4d, 0xe9, 0x53, 0x7f, 0x40, 0x2a, 0xff, 0x4a, 0x80, 0xe5, 0x4e, 0x9f, 0x8d, 0x88, 0x46, 0xe8, - 0xed, 0x78, 0x9b, 0x17, 0xe6, 0x68, 0xf3, 0x6f, 0x60, 0x66, 0x92, 0x82, 0x91, 0xad, 0xfc, 0xe7, - 0x34, 0x64, 0x7b, 0xae, 0x66, 0x13, 0x4d, 0xf7, 0x4c, 0xc7, 0x46, 0x55, 0x10, 0xe9, 0x48, 0xea, - 0xc7, 0xcf, 0xdb, 0xa7, 0xb5, 0xad, 0xde, 0xa1, 0xdd, 0xc6, 0x9e, 0x56, 0x93, 0x28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xf2, 0x02, 0x42, 0x50, 0x50, 0x1a, 0xed, 0xce, 0x83, 0x46, 0xb8, 0x26, 0xac, - 0x8a, 0x9f, 0xfe, 0x76, 0x6d, 0xe1, 0x7a, 0xe7, 0xd8, 0xf8, 0xce, 0xfb, 0x3e, 0x3d, 0xca, 0xfd, - 0xc6, 0x76, 0xbd, 0xb9, 0x7d, 0x47, 0x5e, 0xa0, 0x2f, 0xdd, 0x5e, 0xf5, 0x0e, 0x7d, 0x49, 0xa0, - 0x3c, 0x64, 0x36, 0x3b, 0xed, 0x76, 0xb3, 0xd7, 0x6b, 0xd4, 0x65, 0x81, 0xd2, 0xaa, 0xb5, 0x8e, - 0x42, 0x5f, 0x16, 0x39, 0x60, 0xed, 0x3b, 0xcf, 0xfe, 0xb1, 0xb6, 0xf0, 0xec, 0x68, 0x4d, 0x78, - 0x7e, 0xb4, 0x26, 0x7c, 0x7e, 0xb4, 0x26, 0xfc, 0xfd, 0x68, 0x4d, 0xf8, 0xec, 0xc5, 0xda, 0xc2, - 0xf3, 0x17, 0x6b, 0x0b, 0x9f, 0xbf, 0x58, 0x5b, 0x78, 0x94, 0xf6, 0x9d, 0xdc, 0x4f, 0xb1, 0xff, - 0x07, 0xdd, 0xf8, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x17, 0x72, 0x14, 0xcc, 0xe7, 0x1a, 0x00, - 0x00, +func init() { proto.RegisterFile("roachpb/data.proto", fileDescriptor_data_f9077e6a844d1bb3) } + +var fileDescriptor_data_f9077e6a844d1bb3 = []byte{ + // 2388 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0xcd, 0x73, 0x1b, 0x49, + 0x15, 0xf7, 0x58, 0x23, 0x69, 0xf4, 0xf4, 0xe1, 0x71, 0x27, 0x4e, 0x14, 0x07, 0xac, 0xa0, 0x05, + 0x36, 0xa4, 0x58, 0xb9, 0x70, 0x96, 0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 0xc4, 0xb5, 0xc4, 0x19, 0x75, + 0x5c, 0x89, 0xe0, 0xb6, 0x39, 0x5a, 0x60, 0x29, 0x84, 0x61, 0x39, 0xa6, 0xcb, 0xc6, 0x87, 0x5e, + 0xa0, 0x88, 0x26, 0xa3, 0xc8, 0x92, 0xf1, 0xfa, 0xd1, 0xa4, 0x74, 0xb9, 0x1e, 0x72, 0x6d, 0xe2, + 0x43, 0xcf, 0x97, 0x67, 0xc9, 0x99, 0x09, 0x07, 0xca, 0x65, 0x63, 0x2a, 0x97, 0x81, 0xde, 0x03, + 0x91, 0xc5, 0x68, 0x72, 0xd6, 0x18, 0x55, 0x18, 0x3f, 0xea, 0xc1, 0x65, 0xd3, 0xf6, 0xb0, 0x6b, + 0x6b, 0x03, 0x55, 0x33, 0x8c, 0xb8, 0x19, 0x52, 0x67, 0x36, 0xc3, 0x52, 0x00, 0x55, 0xa5, 0x48, + 0xa1, 0x09, 0x76, 0xe0, 0x4a, 0xa8, 0xc3, 0xc5, 0x96, 0x73, 0x10, 0xd7, 0x92, 0x3e, 0xb3, 0x96, + 0x70, 0xc1, 0x0a, 0xc7, 0x0a, 0xf4, 0xdc, 0x92, 0xe8, 0x91, 0xc3, 0x6a, 0xfe, 0xa7, 0x02, 0x5c, + 0x68, 0x3b, 0x86, 0xb9, 0x63, 0x62, 0x83, 0x1e, 0x65, 0x41, 0xbc, 0x7e, 0x1b, 0x10, 0x19, 0x13, + 0x0f, 0x5b, 0xaa, 0xee, 0xd8, 0x3b, 0x66, 0x5f, 0x25, 0x43, 0xcd, 0x66, 0xb1, 0x2a, 0x29, 0x32, + 0xa7, 0xac, 0x33, 0x02, 0x3b, 0xff, 0x1a, 0x80, 0x58, 0x91, 0x1d, 0x98, 0x07, 0xd8, 0xc6, 0x84, + 0x70, 0x6e, 0x1e, 0x81, 0x97, 0xa7, 0x2c, 0x98, 0x0a, 0x29, 0x32, 0x15, 0xd9, 0xf0, 0x25, 0xe8, + 0x8c, 0x7f, 0x0c, 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, 0x4c, 0x49, 0x29, 0xf1, 0xbf, + 0x9a, 0x52, 0xdc, 0x6e, 0xbf, 0x10, 0xa0, 0x70, 0x3c, 0xe5, 0x4f, 0x7b, 0x43, 0xfa, 0x08, 0x24, + 0xe2, 0x33, 0xfb, 0xcf, 0x32, 0x3f, 0x7a, 0x39, 0x29, 0xdd, 0x9e, 0xe9, 0xe1, 0xe7, 0xd5, 0x17, + 0x3c, 0x6a, 0xc2, 0x0e, 0xde, 0x57, 0x42, 0xc4, 0x58, 0x6b, 0xf6, 0xef, 0x04, 0x24, 0x37, 0xb0, + 0x46, 0x30, 0xfa, 0x3e, 0x24, 0xf9, 0x3d, 0xff, 0x0c, 0x97, 0x07, 0x2e, 0x81, 0x3e, 0x06, 0xc0, + 0x87, 0x43, 0xd3, 0xd5, 0xa8, 0xb5, 0x67, 0xeb, 0x16, 0x57, 0xfe, 0x35, 0x29, 0x2d, 0xc7, 0xb6, + 0x70, 0xab, 0xec, 0x6a, 0xb6, 0x61, 0x8f, 0x06, 0x03, 0xad, 0x37, 0xc0, 0x65, 0x25, 0x06, 0x88, + 0xea, 0x90, 0x0e, 0xee, 0xec, 0x89, 0x33, 0xdf, 0xd9, 0x03, 0x51, 0x34, 0x82, 0x58, 0x37, 0xc5, + 0x9f, 0x34, 0xe8, 0x2f, 0x31, 0x83, 0xe7, 0x93, 0x73, 0xae, 0x78, 0x29, 0x42, 0x67, 0xef, 0x1e, + 0x1d, 0x86, 0x8d, 0x36, 0x21, 0x3b, 0x74, 0x9d, 0xa1, 0x43, 0x68, 0x7f, 0x45, 0x66, 0x3b, 0x9a, + 0x0a, 0x47, 0x93, 0x12, 0x3c, 0xf0, 0xa5, 0xba, 0x1d, 0x05, 0x02, 0x84, 0x2e, 0x41, 0x17, 0x21, + 0x89, 0x87, 0x8e, 0xbe, 0xcb, 0xda, 0xc8, 0x84, 0xc2, 0x07, 0xe8, 0x9d, 0x58, 0xb8, 0xd0, 0x56, + 0x30, 0x51, 0x5b, 0x7c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xd3, 0xd6, 0x06, 0xe7, 0xb3, + 0xff, 0xf7, 0xa0, 0x18, 0x7f, 0x22, 0x74, 0x2c, 0x4b, 0xb3, 0xe9, 0xdf, 0x91, 0xed, 0xf1, 0x50, + 0x52, 0x62, 0x4f, 0x88, 0xeb, 0x9c, 0xbc, 0x4e, 0xa9, 0xa8, 0x06, 0xf9, 0xc0, 0x73, 0xbc, 0xb3, + 0x13, 0x67, 0xe9, 0xec, 0x72, 0xbe, 0x0c, 0x6f, 0xee, 0x66, 0xf5, 0x7e, 0x68, 0x92, 0xd0, 0x0c, + 0xbc, 0x63, 0xba, 0xf1, 0x27, 0x01, 0x32, 0xec, 0xdd, 0x9f, 0xbd, 0x49, 0x66, 0x21, 0xbd, 0xbd, + 0x79, 0x7f, 0x73, 0xeb, 0x83, 0x4d, 0x79, 0x0e, 0xa5, 0x21, 0xd1, 0xdc, 0xec, 0xca, 0x02, 0xca, + 0x40, 0xf2, 0xce, 0xc6, 0x56, 0xb5, 0x2b, 0xcf, 0xd3, 0xcf, 0xda, 0xa3, 0x6e, 0xa3, 0x23, 0x27, + 0xd0, 0x05, 0x58, 0xa8, 0x37, 0x36, 0x9a, 0xed, 0x66, 0xb7, 0x51, 0x57, 0xf9, 0xa4, 0x84, 0x24, + 0x10, 0xbb, 0xcd, 0x76, 0x43, 0x16, 0x29, 0x54, 0xbd, 0xb1, 0xde, 0x6c, 0x57, 0x37, 0xe4, 0x24, + 0x5a, 0x82, 0xc5, 0x88, 0x37, 0x98, 0xce, 0xa0, 0x1c, 0x48, 0xf5, 0x6d, 0xa5, 0xda, 0x6d, 0x6e, + 0x6d, 0xca, 0x29, 0x04, 0x90, 0xa2, 0xb2, 0xdd, 0xc7, 0x72, 0x8e, 0xea, 0xbe, 0xdb, 0xd8, 0x92, + 0xf3, 0x54, 0x61, 0x77, 0xfb, 0xc1, 0x46, 0x43, 0x06, 0xca, 0x5d, 0x6b, 0x76, 0xab, 0x8a, 0x52, + 0x7d, 0x24, 0x67, 0x51, 0x01, 0x80, 0x72, 0x77, 0x1a, 0x4a, 0xb3, 0xd1, 0x91, 0x8d, 0x32, 0x6d, + 0x03, 0xd3, 0x37, 0x7e, 0x08, 0x8b, 0x27, 0xde, 0x5f, 0xd1, 0x02, 0x64, 0xab, 0xf5, 0xba, 0xaa, + 0x34, 0x1e, 0x6c, 0x34, 0xd7, 0xab, 0xf2, 0x1c, 0x42, 0x50, 0x50, 0x1a, 0xed, 0xad, 0x87, 0x8d, + 0x70, 0x4e, 0x58, 0x16, 0x3f, 0xf9, 0xd5, 0xca, 0xdc, 0x8d, 0xad, 0x63, 0x97, 0x09, 0x7e, 0x46, + 0xd3, 0xad, 0x3c, 0x68, 0x6c, 0xd6, 0x9b, 0x9b, 0x77, 0xe5, 0x39, 0x3a, 0xe8, 0x74, 0xab, 0x77, + 0xe9, 0x20, 0x81, 0xf2, 0x90, 0x59, 0xdf, 0x6a, 0xb7, 0x9b, 0xdd, 0x6e, 0xa3, 0x2e, 0x0b, 0x94, + 0x56, 0xad, 0x6d, 0x29, 0x74, 0x30, 0xcf, 0x01, 0x6b, 0xdf, 0x7a, 0xf6, 0xf7, 0x95, 0xb9, 0x67, + 0x47, 0x2b, 0xc2, 0xf3, 0xa3, 0x15, 0xe1, 0xb3, 0xa3, 0x15, 0xe1, 0x6f, 0x47, 0x2b, 0xc2, 0xa7, + 0x2f, 0x56, 0xe6, 0x9e, 0xbf, 0x58, 0x99, 0xfb, 0xec, 0xc5, 0xca, 0xdc, 0xe3, 0xb4, 0xef, 0xe4, + 0x5e, 0x8a, 0xfd, 0x77, 0xea, 0xe6, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x66, 0x70, 0x5a, 0x78, + 0x75, 0x1b, 0x00, 0x00, } diff --git a/pkg/roachpb/data.proto b/pkg/roachpb/data.proto index 599a8909543f..1e616a572578 100644 --- a/pkg/roachpb/data.proto +++ b/pkg/roachpb/data.proto @@ -565,6 +565,16 @@ message Intent { storage.enginepb.TxnMeta txn = 2 [(gogoproto.nullable) = false]; } +// A LockAcquisition represents the action of a Transaction acquiring a lock +// with a specified durbility level over a Span of keys. +message LockAcquisition { + option (gogoproto.equal) = true; + + Span span = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; + storage.enginepb.TxnMeta txn = 2 [(gogoproto.nullable) = false]; + kv.kvserver.concurrency.lock.Durability durability = 3; +} + // A LockUpdate is a Span together with Transaction state. LockUpdate messages // are used to update all locks held by the transaction within the span to the // transaction's authoritative state. As such, the message is used as input @@ -577,7 +587,6 @@ message LockUpdate { storage.enginepb.TxnMeta txn = 2 [(gogoproto.nullable) = false]; TransactionStatus status = 3; repeated storage.enginepb.IgnoredSeqNumRange ignored_seqnums = 4 [(gogoproto.nullable) = false, (gogoproto.customname) = "IgnoredSeqNums"]; - kv.kvserver.concurrency.lock.Durability durability = 5; } // A SequencedWrite is a point write to a key with a certain sequence number. diff --git a/pkg/roachpb/data_test.go b/pkg/roachpb/data_test.go index 9fd0b2464a11..2019a822e05a 100644 --- a/pkg/roachpb/data_test.go +++ b/pkg/roachpb/data_test.go @@ -21,7 +21,6 @@ import ( "time" "github.com/cockroachdb/apd" - "github.com/cockroachdb/cockroach/pkg/kv/kvserver/concurrency/lock" "github.com/cockroachdb/cockroach/pkg/storage/enginepb" "github.com/cockroachdb/cockroach/pkg/testutils/zerofields" "github.com/cockroachdb/cockroach/pkg/util" @@ -1926,13 +1925,11 @@ func TestAsLockUpdates(t *testing.T) { txn.Status = COMMITTED txn.IgnoredSeqNums = []enginepb.IgnoredSeqNumRange{{Start: 0, End: 0}} - dur := lock.Unreplicated spans := []Span{{Key: Key("a"), EndKey: Key("b")}} - for _, intent := range AsLockUpdates(&txn, spans, dur) { + for _, intent := range AsLockUpdates(&txn, spans) { require.Equal(t, txn.Status, intent.Status) require.Equal(t, txn.IgnoredSeqNums, intent.IgnoredSeqNums) require.Equal(t, txn.TxnMeta, intent.Txn) - require.Equal(t, dur, intent.Durability) } } diff --git a/pkg/server/init.go b/pkg/server/init.go index f3d4b6897ff6..1195c5913224 100644 --- a/pkg/server/init.go +++ b/pkg/server/init.go @@ -29,8 +29,8 @@ import ( "github.com/cockroachdb/errors" ) -// ErrClusterInitialized is reported when the Boostrap RPC is ran on -// a node already part of an initialized cluster. +// ErrClusterInitialized is reported when the Boostrap RPC is run on +// a node that is already part of an initialized cluster. var ErrClusterInitialized = fmt.Errorf("cluster has already been initialized") // initServer handles the bootstrapping process. It is instantiated early in the diff --git a/pkg/server/server.go b/pkg/server/server.go index 9163b18f26e8..e7ee10fb7fdb 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -168,7 +168,7 @@ type Server struct { sqlServer *sqlServer - // The fields below are populated at start time, i.e. in `(*Server).Start`. + // The following fields are populated at start time, i.e. in `(*Server).Start`. startTime time.Time engines Engines @@ -1450,14 +1450,14 @@ func (s *Server) Start(ctx context.Context) error { // Begin the node liveness heartbeat. Add a callback which records the local // store "last up" timestamp for every store whenever the liveness record is // updated. - s.nodeLiveness.StartHeartbeat(ctx, s.stopper, func(ctx context.Context) { + s.nodeLiveness.StartHeartbeat(ctx, s.stopper, s.engines, func(ctx context.Context) { now := s.clock.Now() if err := s.node.stores.VisitStores(func(s *kvserver.Store) error { return s.WriteLastUpTimestamp(ctx, now) }); err != nil { log.Warning(ctx, errors.Wrap(err, "writing last up timestamp")) } - }, s.engines) + }) // Begin recording status summaries. s.node.startWriteNodeStatus(DefaultMetricsSampleInterval) diff --git a/pkg/server/server_sql.go b/pkg/server/server_sql.go index 96a0d47f9d54..c0411395dd30 100644 --- a/pkg/server/server_sql.go +++ b/pkg/server/server_sql.go @@ -136,7 +136,7 @@ type sqlServerArgs struct { stopper *stop.Stopper // SQL uses the clock to assign timestamps to transactions, among many - // others. + // other things. clock *hlc.Clock // The executorConfig uses the provider. @@ -300,7 +300,6 @@ func newSQLServer(ctx context.Context, cfg sqlServerArgs) (*sqlServer, error) { RuntimeStats: cfg.runtime, DB: cfg.db, Executor: cfg.circularInternalExecutor, - FlowDB: cfg.db, RPCContext: cfg.rpcContext, Stopper: cfg.stopper, NodeID: cfg.nodeIDContainer, diff --git a/pkg/sql/distsql/server.go b/pkg/sql/distsql/server.go index 602aad5b2380..697138d97b02 100644 --- a/pkg/sql/distsql/server.go +++ b/pkg/sql/distsql/server.go @@ -226,7 +226,7 @@ func (ds *ServerImpl) setupFlow( } // The flow will run in a LeafTxn because we do not want each distributed // Txn to heartbeat the transaction. - return kv.NewLeafTxn(ctx, ds.FlowDB, req.Flow.Gateway, tis), nil + return kv.NewLeafTxn(ctx, ds.DB, req.Flow.Gateway, tis), nil } var evalCtx *tree.EvalContext diff --git a/pkg/sql/execinfra/server_config.go b/pkg/sql/execinfra/server_config.go index 1e8ceb109469..b4d5b4ae110b 100644 --- a/pkg/sql/execinfra/server_config.go +++ b/pkg/sql/execinfra/server_config.go @@ -90,11 +90,6 @@ type ServerConfig struct { // whereas this one isn't. Executor sqlutil.InternalExecutor - // FlowDB is the DB that flows should use for interacting with the database. - // This DB has to be set such that it bypasses the local TxnCoordSender. We - // want only the TxnCoordSender on the gateway to be involved with requests - // performed by DistSQL. - FlowDB *kv.DB RPCContext *rpc.Context Stopper *stop.Stopper TestingKnobs TestingKnobs diff --git a/pkg/storage/bench_test.go b/pkg/storage/bench_test.go index 0a48ce2c5ee0..75a8fa1b4c77 100644 --- a/pkg/storage/bench_test.go +++ b/pkg/storage/bench_test.go @@ -21,7 +21,6 @@ import ( "time" "github.com/cockroachdb/cockroach/pkg/base" - "github.com/cockroachdb/cockroach/pkg/kv/kvserver/concurrency/lock" "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/cockroach/pkg/settings/cluster" "github.com/cockroachdb/cockroach/pkg/storage/enginepb" @@ -231,10 +230,9 @@ func setupMVCCData( txnMeta := txn.TxnMeta txnMeta.WriteTimestamp = hlc.Timestamp{WallTime: int64(counts[idx]) * 5} if _, err := MVCCResolveWriteIntent(ctx, batch, nil /* ms */, roachpb.LockUpdate{ - Span: roachpb.Span{Key: key}, - Status: roachpb.COMMITTED, - Txn: txnMeta, - Durability: lock.Replicated, + Span: roachpb.Span{Key: key}, + Status: roachpb.COMMITTED, + Txn: txnMeta, }); err != nil { b.Fatal(err) } diff --git a/pkg/testutils/localtestcluster/local_test_cluster.go b/pkg/testutils/localtestcluster/local_test_cluster.go index 2f8479b2a2ab..54d0a6aca6c6 100644 --- a/pkg/testutils/localtestcluster/local_test_cluster.go +++ b/pkg/testutils/localtestcluster/local_test_cluster.go @@ -206,7 +206,7 @@ func (ltc *LocalTestCluster) Start(t testing.TB, baseCtx *base.Config, initFacto } if !ltc.DisableLivenessHeartbeat { - cfg.NodeLiveness.StartHeartbeat(ctx, ltc.Stopper, nil /* alive */, []storage.Engine{ltc.Eng}) + cfg.NodeLiveness.StartHeartbeat(ctx, ltc.Stopper, []storage.Engine{ltc.Eng}, nil /* alive */) } if err := ltc.Store.Start(ctx, ltc.Stopper); err != nil {