diff --git a/c-deps/libroach/protos/roachpb/data.pb.cc b/c-deps/libroach/protos/roachpb/data.pb.cc index 63a5359cbb7f..0e2245dc9ae2 100644 --- a/c-deps/libroach/protos/roachpb/data.pb.cc +++ b/c-deps/libroach/protos/roachpb/data.pb.cc @@ -23,9 +23,11 @@ extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fdata_2eproto ::google::protob extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_ModifiedSpanTrigger; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_ObservedTimestamp; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_SplitTrigger; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TransactionKnowledge; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Value; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fdata_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_Intent; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fdata_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_MergeTrigger; -extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fdata_2eproto ::google::protobuf::internal::SCCInfo<4> scc_info_Transaction; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fdata_2eproto ::google::protobuf::internal::SCCInfo<5> scc_info_Transaction; } // namespace protobuf_roachpb_2fdata_2eproto namespace protobuf_roachpb_2fmetadata_2eproto { extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fmetadata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ReplicaDescriptor; @@ -97,6 +99,11 @@ class TransactionDefaultTypeInternal { ::google::protobuf::internal::ExplicitlyConstructed _instance; } _Transaction_default_instance_; +class TransactionKnowledgeDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TransactionKnowledge_default_instance_; class IntentDefaultTypeInternal { public: ::google::protobuf::internal::ExplicitlyConstructed @@ -289,12 +296,28 @@ static void InitDefaultsTransaction() { ::cockroach::roachpb::Transaction::InitAsDefaultInstance(); } -::google::protobuf::internal::SCCInfo<4> scc_info_Transaction = - {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 4, InitDefaultsTransaction}, { +::google::protobuf::internal::SCCInfo<5> scc_info_Transaction = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 5, InitDefaultsTransaction}, { &protobuf_storage_2fengine_2fenginepb_2fmvcc3_2eproto::scc_info_TxnMeta.base, &protobuf_util_2fhlc_2ftimestamp_2eproto::scc_info_Timestamp.base, &protobuf_roachpb_2fdata_2eproto::scc_info_ObservedTimestamp.base, - &protobuf_roachpb_2fdata_2eproto::scc_info_Span.base,}}; + &protobuf_roachpb_2fdata_2eproto::scc_info_Span.base, + &protobuf_roachpb_2fdata_2eproto::scc_info_TransactionKnowledge.base,}}; + +static void InitDefaultsTransactionKnowledge() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::cockroach::roachpb::_TransactionKnowledge_default_instance_; + new (ptr) ::cockroach::roachpb::TransactionKnowledge(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::cockroach::roachpb::TransactionKnowledge::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_TransactionKnowledge = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTransactionKnowledge}, { + &protobuf_roachpb_2fdata_2eproto::scc_info_Intent.base,}}; static void InitDefaultsIntent() { GOOGLE_PROTOBUF_VERIFY_VERSION; @@ -386,6 +409,7 @@ void InitDefaults() { ::google::protobuf::internal::InitSCC(&scc_info_InternalCommitTrigger.base); ::google::protobuf::internal::InitSCC(&scc_info_ObservedTimestamp.base); ::google::protobuf::internal::InitSCC(&scc_info_Transaction.base); + ::google::protobuf::internal::InitSCC(&scc_info_TransactionKnowledge.base); ::google::protobuf::internal::InitSCC(&scc_info_Intent.base); ::google::protobuf::internal::InitSCC(&scc_info_SequencedWrite.base); ::google::protobuf::internal::InitSCC(&scc_info_Lease.base); @@ -3009,6 +3033,8 @@ void Transaction::InitAsDefaultInstance() { ::cockroach::util::hlc::Timestamp::internal_default_instance()); ::cockroach::roachpb::_Transaction_default_instance_._instance.get_mutable()->epoch_zero_timestamp_ = const_cast< ::cockroach::util::hlc::Timestamp*>( ::cockroach::util::hlc::Timestamp::internal_default_instance()); + ::cockroach::roachpb::_Transaction_default_instance_._instance.get_mutable()->knowledge_ = const_cast< ::cockroach::roachpb::TransactionKnowledge*>( + ::cockroach::roachpb::TransactionKnowledge::internal_default_instance()); } void Transaction::clear_meta() { if (GetArenaNoVirtual() == NULL && meta_ != NULL) { @@ -3061,6 +3087,7 @@ const int Transaction::kRetryOnPushFieldNumber; const int Transaction::kIntentsFieldNumber; const int Transaction::kEpochZeroTimestampFieldNumber; const int Transaction::kOrigTimestampWasObservedFieldNumber; +const int Transaction::kKnowledgeFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Transaction::Transaction() @@ -3110,6 +3137,11 @@ Transaction::Transaction(const Transaction& from) } else { refreshed_timestamp_ = NULL; } + if (from.has_knowledge()) { + knowledge_ = new ::cockroach::roachpb::TransactionKnowledge(*from.knowledge_); + } else { + knowledge_ = NULL; + } ::memcpy(&status_, &from.status_, static_cast(reinterpret_cast(&orig_timestamp_was_observed_) - reinterpret_cast(&status_)) + sizeof(orig_timestamp_was_observed_)); @@ -3136,6 +3168,7 @@ void Transaction::SharedDtor() { if (this != internal_default_instance()) delete max_timestamp_; if (this != internal_default_instance()) delete epoch_zero_timestamp_; if (this != internal_default_instance()) delete refreshed_timestamp_; + if (this != internal_default_instance()) delete knowledge_; } void Transaction::SetCachedSize(int size) const { @@ -3180,6 +3213,10 @@ void Transaction::Clear() { delete refreshed_timestamp_; } refreshed_timestamp_ = NULL; + if (GetArenaNoVirtual() == NULL && knowledge_ != NULL) { + delete knowledge_; + } + knowledge_ = NULL; ::memset(&status_, 0, static_cast( reinterpret_cast(&orig_timestamp_was_observed_) - reinterpret_cast(&status_)) + sizeof(orig_timestamp_was_observed_)); @@ -3377,6 +3414,18 @@ bool Transaction::MergePartialFromCodedStream( break; } + // .cockroach.roachpb.TransactionKnowledge knowledge = 17; + case 17: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(138u /* 138 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_knowledge())); + } else { + goto handle_unusual; + } + break; + } + default: { handle_unusual: if (tag == 0) { @@ -3485,6 +3534,12 @@ void Transaction::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormatLite::WriteBool(16, this->orig_timestamp_was_observed(), output); } + // .cockroach.roachpb.TransactionKnowledge knowledge = 17; + if (this->has_knowledge()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 17, this->_internal_knowledge(), 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.Transaction) @@ -3559,6 +3614,13 @@ size_t Transaction::ByteSizeLong() const { *refreshed_timestamp_); } + // .cockroach.roachpb.TransactionKnowledge knowledge = 17; + if (this->has_knowledge()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *knowledge_); + } + // .cockroach.roachpb.TransactionStatus status = 4; if (this->status() != 0) { total_size += 1 + @@ -3626,6 +3688,9 @@ void Transaction::MergeFrom(const Transaction& from) { if (from.has_refreshed_timestamp()) { mutable_refreshed_timestamp()->::cockroach::util::hlc::Timestamp::MergeFrom(from.refreshed_timestamp()); } + if (from.has_knowledge()) { + mutable_knowledge()->::cockroach::roachpb::TransactionKnowledge::MergeFrom(from.knowledge()); + } if (from.status() != 0) { set_status(from.status()); } @@ -3670,6 +3735,7 @@ void Transaction::InternalSwap(Transaction* other) { swap(max_timestamp_, other->max_timestamp_); swap(epoch_zero_timestamp_, other->epoch_zero_timestamp_); swap(refreshed_timestamp_, other->refreshed_timestamp_); + swap(knowledge_, other->knowledge_); swap(status_, other->status_); swap(writing_, other->writing_); swap(write_too_old_, other->write_too_old_); @@ -3683,6 +3749,221 @@ ::std::string Transaction::GetTypeName() const { } +// =================================================================== + +void TransactionKnowledge::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TransactionKnowledge::kEpochFieldNumber; +const int TransactionKnowledge::kKnownDispositionsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TransactionKnowledge::TransactionKnowledge() + : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_roachpb_2fdata_2eproto::scc_info_TransactionKnowledge.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:cockroach.roachpb.TransactionKnowledge) +} +TransactionKnowledge::TransactionKnowledge(const TransactionKnowledge& from) + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + known_dispositions_(from.known_dispositions_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + epoch_ = from.epoch_; + // @@protoc_insertion_point(copy_constructor:cockroach.roachpb.TransactionKnowledge) +} + +void TransactionKnowledge::SharedCtor() { + epoch_ = 0; +} + +TransactionKnowledge::~TransactionKnowledge() { + // @@protoc_insertion_point(destructor:cockroach.roachpb.TransactionKnowledge) + SharedDtor(); +} + +void TransactionKnowledge::SharedDtor() { +} + +void TransactionKnowledge::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const TransactionKnowledge& TransactionKnowledge::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_roachpb_2fdata_2eproto::scc_info_TransactionKnowledge.base); + return *internal_default_instance(); +} + + +void TransactionKnowledge::Clear() { +// @@protoc_insertion_point(message_clear_start:cockroach.roachpb.TransactionKnowledge) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + known_dispositions_.Clear(); + epoch_ = 0; + _internal_metadata_.Clear(); +} + +bool TransactionKnowledge::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.TransactionKnowledge) + 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)) { + // int32 epoch = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &epoch_))); + } 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, add_known_dispositions())); + } 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.TransactionKnowledge) + return true; +failure: + // @@protoc_insertion_point(parse_failure:cockroach.roachpb.TransactionKnowledge) + return false; +#undef DO_ +} + +void TransactionKnowledge::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:cockroach.roachpb.TransactionKnowledge) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 epoch = 1; + if (this->epoch() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->epoch(), output); + } + + for (unsigned int i = 0, + n = static_cast(this->known_dispositions_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, + this->known_dispositions(static_cast(i)), + 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.TransactionKnowledge) +} + +size_t TransactionKnowledge::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:cockroach.roachpb.TransactionKnowledge) + size_t total_size = 0; + + total_size += (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()).size(); + + { + unsigned int count = static_cast(this->known_dispositions_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->known_dispositions(static_cast(i))); + } + } + + // int32 epoch = 1; + if (this->epoch() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->epoch()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TransactionKnowledge::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void TransactionKnowledge::MergeFrom(const TransactionKnowledge& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:cockroach.roachpb.TransactionKnowledge) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + known_dispositions_.MergeFrom(from.known_dispositions_); + if (from.epoch() != 0) { + set_epoch(from.epoch()); + } +} + +void TransactionKnowledge::CopyFrom(const TransactionKnowledge& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:cockroach.roachpb.TransactionKnowledge) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TransactionKnowledge::IsInitialized() const { + return true; +} + +void TransactionKnowledge::Swap(TransactionKnowledge* other) { + if (other == this) return; + InternalSwap(other); +} +void TransactionKnowledge::InternalSwap(TransactionKnowledge* other) { + using std::swap; + CastToBase(&known_dispositions_)->InternalSwap(CastToBase(&other->known_dispositions_)); + swap(epoch_, other->epoch_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::std::string TransactionKnowledge::GetTypeName() const { + return "cockroach.roachpb.TransactionKnowledge"; +} + + // =================================================================== void Intent::InitAsDefaultInstance() { @@ -5330,6 +5611,9 @@ template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::cockroach::roachpb::ObservedTime template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::cockroach::roachpb::Transaction* Arena::CreateMaybeMessage< ::cockroach::roachpb::Transaction >(Arena* arena) { return Arena::CreateInternal< ::cockroach::roachpb::Transaction >(arena); } +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::cockroach::roachpb::TransactionKnowledge* Arena::CreateMaybeMessage< ::cockroach::roachpb::TransactionKnowledge >(Arena* arena) { + return Arena::CreateInternal< ::cockroach::roachpb::TransactionKnowledge >(arena); +} template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::cockroach::roachpb::Intent* Arena::CreateMaybeMessage< ::cockroach::roachpb::Intent >(Arena* arena) { return Arena::CreateInternal< ::cockroach::roachpb::Intent >(arena); } diff --git a/c-deps/libroach/protos/roachpb/data.pb.h b/c-deps/libroach/protos/roachpb/data.pb.h index f04d218de594..8006d3df9adf 100644 --- a/c-deps/libroach/protos/roachpb/data.pb.h +++ b/c-deps/libroach/protos/roachpb/data.pb.h @@ -42,7 +42,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[16]; + static const ::google::protobuf::internal::ParseTable schema[17]; static const ::google::protobuf::internal::FieldMetadata field_metadata[]; static const ::google::protobuf::internal::SerializationTable serialization_table[]; static const ::google::protobuf::uint32 offsets[]; @@ -92,6 +92,9 @@ extern StoreIdentDefaultTypeInternal _StoreIdent_default_instance_; class Transaction; class TransactionDefaultTypeInternal; extern TransactionDefaultTypeInternal _Transaction_default_instance_; +class TransactionKnowledge; +class TransactionKnowledgeDefaultTypeInternal; +extern TransactionKnowledgeDefaultTypeInternal _TransactionKnowledge_default_instance_; class TxnCoordMeta; class TxnCoordMetaDefaultTypeInternal; extern TxnCoordMetaDefaultTypeInternal _TxnCoordMeta_default_instance_; @@ -116,6 +119,7 @@ template<> ::cockroach::roachpb::Span* Arena::CreateMaybeMessage<::cockroach::ro template<> ::cockroach::roachpb::SplitTrigger* Arena::CreateMaybeMessage<::cockroach::roachpb::SplitTrigger>(Arena*); template<> ::cockroach::roachpb::StoreIdent* Arena::CreateMaybeMessage<::cockroach::roachpb::StoreIdent>(Arena*); template<> ::cockroach::roachpb::Transaction* Arena::CreateMaybeMessage<::cockroach::roachpb::Transaction>(Arena*); +template<> ::cockroach::roachpb::TransactionKnowledge* Arena::CreateMaybeMessage<::cockroach::roachpb::TransactionKnowledge>(Arena*); template<> ::cockroach::roachpb::TxnCoordMeta* Arena::CreateMaybeMessage<::cockroach::roachpb::TxnCoordMeta>(Arena*); template<> ::cockroach::roachpb::Value* Arena::CreateMaybeMessage<::cockroach::roachpb::Value>(Arena*); } // namespace protobuf @@ -1602,6 +1606,18 @@ class Transaction : public ::google::protobuf::MessageLite /* @@protoc_insertion ::cockroach::util::hlc::Timestamp* mutable_refreshed_timestamp(); void set_allocated_refreshed_timestamp(::cockroach::util::hlc::Timestamp* refreshed_timestamp); + // .cockroach.roachpb.TransactionKnowledge knowledge = 17; + bool has_knowledge() const; + void clear_knowledge(); + static const int kKnowledgeFieldNumber = 17; + private: + const ::cockroach::roachpb::TransactionKnowledge& _internal_knowledge() const; + public: + const ::cockroach::roachpb::TransactionKnowledge& knowledge() const; + ::cockroach::roachpb::TransactionKnowledge* release_knowledge(); + ::cockroach::roachpb::TransactionKnowledge* mutable_knowledge(); + void set_allocated_knowledge(::cockroach::roachpb::TransactionKnowledge* knowledge); + // .cockroach.roachpb.TransactionStatus status = 4; void clear_status(); static const int kStatusFieldNumber = 4; @@ -1645,6 +1661,7 @@ class Transaction : public ::google::protobuf::MessageLite /* @@protoc_insertion ::cockroach::util::hlc::Timestamp* max_timestamp_; ::cockroach::util::hlc::Timestamp* epoch_zero_timestamp_; ::cockroach::util::hlc::Timestamp* refreshed_timestamp_; + ::cockroach::roachpb::TransactionKnowledge* knowledge_; int status_; bool writing_; bool write_too_old_; @@ -1655,6 +1672,119 @@ class Transaction : public ::google::protobuf::MessageLite /* @@protoc_insertion }; // ------------------------------------------------------------------- +class TransactionKnowledge : public ::google::protobuf::MessageLite /* @@protoc_insertion_point(class_definition:cockroach.roachpb.TransactionKnowledge) */ { + public: + TransactionKnowledge(); + virtual ~TransactionKnowledge(); + + TransactionKnowledge(const TransactionKnowledge& from); + + inline TransactionKnowledge& operator=(const TransactionKnowledge& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TransactionKnowledge(TransactionKnowledge&& from) noexcept + : TransactionKnowledge() { + *this = ::std::move(from); + } + + inline TransactionKnowledge& operator=(TransactionKnowledge&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const TransactionKnowledge& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TransactionKnowledge* internal_default_instance() { + return reinterpret_cast( + &_TransactionKnowledge_default_instance_); + } + static constexpr int kIndexInFileMessages = + 11; + + void Swap(TransactionKnowledge* other); + friend void swap(TransactionKnowledge& a, TransactionKnowledge& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TransactionKnowledge* New() const final { + return CreateMaybeMessage(NULL); + } + + TransactionKnowledge* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from) + final; + void CopyFrom(const TransactionKnowledge& from); + void MergeFrom(const TransactionKnowledge& 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(TransactionKnowledge* 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 ------------------------------------------------------- + + int known_dispositions_size() const; + void clear_known_dispositions(); + static const int kKnownDispositionsFieldNumber = 2; + ::cockroach::roachpb::Intent* mutable_known_dispositions(int index); + ::google::protobuf::RepeatedPtrField< ::cockroach::roachpb::Intent >* + mutable_known_dispositions(); + const ::cockroach::roachpb::Intent& known_dispositions(int index) const; + ::cockroach::roachpb::Intent* add_known_dispositions(); + const ::google::protobuf::RepeatedPtrField< ::cockroach::roachpb::Intent >& + known_dispositions() const; + + // int32 epoch = 1; + void clear_epoch(); + static const int kEpochFieldNumber = 1; + ::google::protobuf::int32 epoch() const; + void set_epoch(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:cockroach.roachpb.TransactionKnowledge) + private: + + ::google::protobuf::internal::InternalMetadataWithArenaLite _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::cockroach::roachpb::Intent > known_dispositions_; + ::google::protobuf::int32 epoch_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_roachpb_2fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + class Intent : public ::google::protobuf::MessageLite /* @@protoc_insertion_point(class_definition:cockroach.roachpb.Intent) */ { public: Intent(); @@ -1689,7 +1819,7 @@ class Intent : public ::google::protobuf::MessageLite /* @@protoc_insertion_poin &_Intent_default_instance_); } static constexpr int kIndexInFileMessages = - 11; + 12; void Swap(Intent* other); friend void swap(Intent& a, Intent& b) { @@ -1814,7 +1944,7 @@ class SequencedWrite : public ::google::protobuf::MessageLite /* @@protoc_insert &_SequencedWrite_default_instance_); } static constexpr int kIndexInFileMessages = - 12; + 13; void Swap(SequencedWrite* other); friend void swap(SequencedWrite& a, SequencedWrite& b) { @@ -1929,7 +2059,7 @@ class Lease : public ::google::protobuf::MessageLite /* @@protoc_insertion_point &_Lease_default_instance_); } static constexpr int kIndexInFileMessages = - 13; + 14; void Swap(Lease* other); friend void swap(Lease& a, Lease& b) { @@ -2096,7 +2226,7 @@ class AbortSpanEntry : public ::google::protobuf::MessageLite /* @@protoc_insert &_AbortSpanEntry_default_instance_); } static constexpr int kIndexInFileMessages = - 14; + 15; void Swap(AbortSpanEntry* other); friend void swap(AbortSpanEntry& a, AbortSpanEntry& b) { @@ -2223,7 +2353,7 @@ class TxnCoordMeta : public ::google::protobuf::MessageLite /* @@protoc_insertio &_TxnCoordMeta_default_instance_); } static constexpr int kIndexInFileMessages = - 15; + 16; void Swap(TxnCoordMeta* other); friend void swap(TxnCoordMeta& a, TxnCoordMeta& b) { @@ -3989,6 +4119,107 @@ inline void Transaction::set_orig_timestamp_was_observed(bool value) { // @@protoc_insertion_point(field_set:cockroach.roachpb.Transaction.orig_timestamp_was_observed) } +// .cockroach.roachpb.TransactionKnowledge knowledge = 17; +inline bool Transaction::has_knowledge() const { + return this != internal_default_instance() && knowledge_ != NULL; +} +inline void Transaction::clear_knowledge() { + if (GetArenaNoVirtual() == NULL && knowledge_ != NULL) { + delete knowledge_; + } + knowledge_ = NULL; +} +inline const ::cockroach::roachpb::TransactionKnowledge& Transaction::_internal_knowledge() const { + return *knowledge_; +} +inline const ::cockroach::roachpb::TransactionKnowledge& Transaction::knowledge() const { + const ::cockroach::roachpb::TransactionKnowledge* p = knowledge_; + // @@protoc_insertion_point(field_get:cockroach.roachpb.Transaction.knowledge) + return p != NULL ? *p : *reinterpret_cast( + &::cockroach::roachpb::_TransactionKnowledge_default_instance_); +} +inline ::cockroach::roachpb::TransactionKnowledge* Transaction::release_knowledge() { + // @@protoc_insertion_point(field_release:cockroach.roachpb.Transaction.knowledge) + + ::cockroach::roachpb::TransactionKnowledge* temp = knowledge_; + knowledge_ = NULL; + return temp; +} +inline ::cockroach::roachpb::TransactionKnowledge* Transaction::mutable_knowledge() { + + if (knowledge_ == NULL) { + auto* p = CreateMaybeMessage<::cockroach::roachpb::TransactionKnowledge>(GetArenaNoVirtual()); + knowledge_ = p; + } + // @@protoc_insertion_point(field_mutable:cockroach.roachpb.Transaction.knowledge) + return knowledge_; +} +inline void Transaction::set_allocated_knowledge(::cockroach::roachpb::TransactionKnowledge* knowledge) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete knowledge_; + } + if (knowledge) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + knowledge = ::google::protobuf::internal::GetOwnedMessage( + message_arena, knowledge, submessage_arena); + } + + } else { + + } + knowledge_ = knowledge; + // @@protoc_insertion_point(field_set_allocated:cockroach.roachpb.Transaction.knowledge) +} + +// ------------------------------------------------------------------- + +// TransactionKnowledge + +// int32 epoch = 1; +inline void TransactionKnowledge::clear_epoch() { + epoch_ = 0; +} +inline ::google::protobuf::int32 TransactionKnowledge::epoch() const { + // @@protoc_insertion_point(field_get:cockroach.roachpb.TransactionKnowledge.epoch) + return epoch_; +} +inline void TransactionKnowledge::set_epoch(::google::protobuf::int32 value) { + + epoch_ = value; + // @@protoc_insertion_point(field_set:cockroach.roachpb.TransactionKnowledge.epoch) +} + +inline int TransactionKnowledge::known_dispositions_size() const { + return known_dispositions_.size(); +} +inline void TransactionKnowledge::clear_known_dispositions() { + known_dispositions_.Clear(); +} +inline ::cockroach::roachpb::Intent* TransactionKnowledge::mutable_known_dispositions(int index) { + // @@protoc_insertion_point(field_mutable:cockroach.roachpb.TransactionKnowledge.known_dispositions) + return known_dispositions_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::cockroach::roachpb::Intent >* +TransactionKnowledge::mutable_known_dispositions() { + // @@protoc_insertion_point(field_mutable_list:cockroach.roachpb.TransactionKnowledge.known_dispositions) + return &known_dispositions_; +} +inline const ::cockroach::roachpb::Intent& TransactionKnowledge::known_dispositions(int index) const { + // @@protoc_insertion_point(field_get:cockroach.roachpb.TransactionKnowledge.known_dispositions) + return known_dispositions_.Get(index); +} +inline ::cockroach::roachpb::Intent* TransactionKnowledge::add_known_dispositions() { + // @@protoc_insertion_point(field_add:cockroach.roachpb.TransactionKnowledge.known_dispositions) + return known_dispositions_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::cockroach::roachpb::Intent >& +TransactionKnowledge::known_dispositions() const { + // @@protoc_insertion_point(field_list:cockroach.roachpb.TransactionKnowledge.known_dispositions) + return known_dispositions_; +} + // ------------------------------------------------------------------- // Intent @@ -4808,6 +5039,8 @@ TxnCoordMeta::outstanding_writes() const { // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/pkg/roachpb/api.pb.go b/pkg/roachpb/api.pb.go index 93c349c51238..c774f6be7165 100644 --- a/pkg/roachpb/api.pb.go +++ b/pkg/roachpb/api.pb.go @@ -127,6 +127,7 @@ InternalCommitTrigger ObservedTimestamp Transaction + TransactionKnowledge Intent SequencedWrite Lease diff --git a/pkg/roachpb/data.go b/pkg/roachpb/data.go index a7a6d9afbd72..3384e5a3ec0f 100644 --- a/pkg/roachpb/data.go +++ b/pkg/roachpb/data.go @@ -785,7 +785,7 @@ func (meta *TxnCoordMeta) StripLeafToRoot() *TxnCoordMeta { // LastActive returns the last timestamp at which client activity definitely // occurred, i.e. the maximum of OrigTimestamp and LastHeartbeat. -func (t Transaction) LastActive() hlc.Timestamp { +func (t *Transaction) LastActive() hlc.Timestamp { ts := t.LastHeartbeat if ts.Less(t.OrigTimestamp) { ts = t.OrigTimestamp @@ -817,6 +817,58 @@ func (t *Transaction) AssertInitialized(ctx context.Context) { } } +// Update merges the two TransactionKnowledge structs. +func (tk *TransactionKnowledge) Update(o *TransactionKnowledge) *TransactionKnowledge { + if o != nil { + if tk == nil || o.Epoch > tk.Epoch { + return o + } + } + return tk +} + +// KnownDisposition returns whether the disposition of the specified +// transaction is known to this transaction. If so, the other transaction's +// status is returned. The status will always be authoritative, so it will +// never be PENDING. +func (tk *TransactionKnowledge) KnownDisposition(otherID uuid.UUID) (bool, Intent) { + if tk == nil { + return false, Intent{} + } + for _, other := range tk.KnownDispositions { + if other.Txn.ID == otherID { + return true, other + } + } + return false, Intent{} +} + +// RememberDisposition remembers the state of the provided transaction. +func (tk *TransactionKnowledge) RememberDisposition( + meta enginepb.TxnMeta, status TransactionStatus, +) *TransactionKnowledge { + if status == PENDING { + // Don't remember anything about pending Txns. + return tk + } + + if tk == nil { + tk = new(TransactionKnowledge) + } else { + tk.Epoch++ + } + + state := Intent{Txn: meta, Status: status} + const maxKnowledge = 4 + if l := len(tk.KnownDispositions); l < maxKnowledge { + tk.KnownDispositions = append(tk.KnownDispositions, state) + } else { + copy(tk.KnownDispositions[1:], tk.KnownDispositions[:l-1]) + tk.KnownDispositions[l-1] = state + } + return tk +} + // MakePriority generates a random priority value, biased by the specified // userPriority. If userPriority=100, the random priority will be 100x more // likely to be greater than if userPriority=1. If userPriority = 0.1, the @@ -1016,6 +1068,9 @@ func (t *Transaction) Update(o *Transaction) { t.EpochZeroTimestamp = o.EpochZeroTimestamp } } + + // Update knowledge about other transactions. + t.Knowledge = t.Knowledge.Update(o.Knowledge) } // UpgradePriority sets transaction priority to the maximum of current diff --git a/pkg/roachpb/data.pb.go b/pkg/roachpb/data.pb.go index 797daf8f530c..5cf9ae808139 100644 --- a/pkg/roachpb/data.pb.go +++ b/pkg/roachpb/data.pb.go @@ -484,12 +484,24 @@ type Transaction struct { // which commit at a higher timestamp without resorting to a // client-side retry. OrigTimestampWasObserved bool `protobuf:"varint,16,opt,name=orig_timestamp_was_observed,json=origTimestampWasObserved,proto3" json:"orig_timestamp_was_observed,omitempty"` + // TODO + Knowledge *TransactionKnowledge `protobuf:"bytes,17,opt,name=knowledge" json:"knowledge,omitempty"` } func (m *Transaction) Reset() { *m = Transaction{} } func (*Transaction) ProtoMessage() {} func (*Transaction) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{10} } +type TransactionKnowledge struct { + Epoch int32 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` + KnownDispositions []Intent `protobuf:"bytes,2,rep,name=known_dispositions,json=knownDispositions" json:"known_dispositions"` +} + +func (m *TransactionKnowledge) Reset() { *m = TransactionKnowledge{} } +func (m *TransactionKnowledge) String() string { return proto.CompactTextString(m) } +func (*TransactionKnowledge) ProtoMessage() {} +func (*TransactionKnowledge) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{11} } + // A Intent is a Span together with a Transaction metadata and its status. type Intent struct { Span `protobuf:"bytes,1,opt,name=span,embedded=span" json:"span"` @@ -500,7 +512,7 @@ type Intent struct { func (m *Intent) Reset() { *m = Intent{} } func (m *Intent) String() string { return proto.CompactTextString(m) } func (*Intent) ProtoMessage() {} -func (*Intent) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{11} } +func (*Intent) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{12} } // A SequencedWrite is a point write to a key with a certain sequence number. // @@ -517,7 +529,7 @@ type SequencedWrite struct { func (m *SequencedWrite) Reset() { *m = SequencedWrite{} } func (m *SequencedWrite) String() string { return proto.CompactTextString(m) } func (*SequencedWrite) ProtoMessage() {} -func (*SequencedWrite) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{12} } +func (*SequencedWrite) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{13} } // Lease contains information about range leases including the // expiration and lease holder. @@ -557,7 +569,7 @@ type Lease struct { func (m *Lease) Reset() { *m = Lease{} } func (*Lease) ProtoMessage() {} -func (*Lease) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{13} } +func (*Lease) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{14} } // AbortSpanEntry contains information about a transaction which has // been aborted. It's written to a range's AbortSpan if the range @@ -578,7 +590,7 @@ type AbortSpanEntry struct { func (m *AbortSpanEntry) Reset() { *m = AbortSpanEntry{} } func (m *AbortSpanEntry) String() string { return proto.CompactTextString(m) } func (*AbortSpanEntry) ProtoMessage() {} -func (*AbortSpanEntry) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{14} } +func (*AbortSpanEntry) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{15} } // TxnCoordMeta is metadata held by a transaction coordinator. This // message is defined here because it is used in several layers of the @@ -628,7 +640,7 @@ type TxnCoordMeta struct { func (m *TxnCoordMeta) Reset() { *m = TxnCoordMeta{} } func (m *TxnCoordMeta) String() string { return proto.CompactTextString(m) } func (*TxnCoordMeta) ProtoMessage() {} -func (*TxnCoordMeta) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{15} } +func (*TxnCoordMeta) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{16} } func init() { proto.RegisterType((*Span)(nil), "cockroach.roachpb.Span") @@ -642,6 +654,7 @@ func init() { proto.RegisterType((*InternalCommitTrigger)(nil), "cockroach.roachpb.InternalCommitTrigger") proto.RegisterType((*ObservedTimestamp)(nil), "cockroach.roachpb.ObservedTimestamp") proto.RegisterType((*Transaction)(nil), "cockroach.roachpb.Transaction") + proto.RegisterType((*TransactionKnowledge)(nil), "cockroach.roachpb.TransactionKnowledge") proto.RegisterType((*Intent)(nil), "cockroach.roachpb.Intent") proto.RegisterType((*SequencedWrite)(nil), "cockroach.roachpb.SequencedWrite") proto.RegisterType((*Lease)(nil), "cockroach.roachpb.Lease") @@ -961,6 +974,41 @@ func (this *Transaction) Equal(that interface{}) bool { if this.OrigTimestampWasObserved != that1.OrigTimestampWasObserved { return false } + if !this.Knowledge.Equal(that1.Knowledge) { + return false + } + return true +} +func (this *TransactionKnowledge) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*TransactionKnowledge) + if !ok { + that2, ok := that.(TransactionKnowledge) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Epoch != that1.Epoch { + return false + } + if len(this.KnownDispositions) != len(that1.KnownDispositions) { + return false + } + for i := range this.KnownDispositions { + if !this.KnownDispositions[i].Equal(&that1.KnownDispositions[i]) { + return false + } + } return true } func (this *Intent) Equal(that interface{}) bool { @@ -1552,6 +1600,53 @@ func (m *Transaction) MarshalTo(dAtA []byte) (int, error) { } i++ } + if m.Knowledge != nil { + dAtA[i] = 0x8a + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintData(dAtA, i, uint64(m.Knowledge.Size())) + n23, err := m.Knowledge.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n23 + } + return i, nil +} + +func (m *TransactionKnowledge) 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 *TransactionKnowledge) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Epoch != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintData(dAtA, i, uint64(m.Epoch)) + } + if len(m.KnownDispositions) > 0 { + for _, msg := range m.KnownDispositions { + dAtA[i] = 0x12 + i++ + i = encodeVarintData(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } return i, nil } @@ -1573,19 +1668,19 @@ func (m *Intent) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintData(dAtA, i, uint64(m.Span.Size())) - n23, err := m.Span.MarshalTo(dAtA[i:]) + n24, err := m.Span.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n23 + i += n24 dAtA[i] = 0x12 i++ i = encodeVarintData(dAtA, i, uint64(m.Txn.Size())) - n24, err := m.Txn.MarshalTo(dAtA[i:]) + n25, err := m.Txn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n24 + i += n25 if m.Status != 0 { dAtA[i] = 0x18 i++ @@ -1641,48 +1736,48 @@ func (m *Lease) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintData(dAtA, i, uint64(m.Start.Size())) - n25, err := m.Start.MarshalTo(dAtA[i:]) + n26, err := m.Start.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n25 + i += n26 if m.Expiration != nil { dAtA[i] = 0x12 i++ i = encodeVarintData(dAtA, i, uint64(m.Expiration.Size())) - n26, err := m.Expiration.MarshalTo(dAtA[i:]) + n27, err := m.Expiration.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n26 + i += n27 } dAtA[i] = 0x1a i++ i = encodeVarintData(dAtA, i, uint64(m.Replica.Size())) - n27, err := m.Replica.MarshalTo(dAtA[i:]) + n28, err := m.Replica.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n27 + i += n28 if m.DeprecatedStartStasis != nil { dAtA[i] = 0x22 i++ i = encodeVarintData(dAtA, i, uint64(m.DeprecatedStartStasis.Size())) - n28, err := m.DeprecatedStartStasis.MarshalTo(dAtA[i:]) + n29, err := m.DeprecatedStartStasis.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n28 + i += n29 } if m.ProposedTS != nil { dAtA[i] = 0x2a i++ i = encodeVarintData(dAtA, i, uint64(m.ProposedTS.Size())) - n29, err := m.ProposedTS.MarshalTo(dAtA[i:]) + n30, err := m.ProposedTS.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n29 + i += n30 } if m.Epoch != 0 { dAtA[i] = 0x30 @@ -1721,11 +1816,11 @@ func (m *AbortSpanEntry) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintData(dAtA, i, uint64(m.Timestamp.Size())) - n30, err := m.Timestamp.MarshalTo(dAtA[i:]) + n31, err := m.Timestamp.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n30 + i += n31 if m.Priority != 0 { dAtA[i] = 0x18 i++ @@ -1752,11 +1847,11 @@ func (m *TxnCoordMeta) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintData(dAtA, i, uint64(m.Txn.Size())) - n31, err := m.Txn.MarshalTo(dAtA[i:]) + n32, err := m.Txn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n31 + i += n32 if len(m.Intents) > 0 { for _, msg := range m.Intents { dAtA[i] = 0x12 @@ -1908,6 +2003,40 @@ func NewPopulatedTransaction(r randyData, easy bool) *Transaction { v13 := cockroach_util_hlc.NewPopulatedTimestamp(r, easy) this.RefreshedTimestamp = *v13 this.OrigTimestampWasObserved = bool(bool(r.Intn(2) == 0)) + if r.Intn(10) != 0 { + this.Knowledge = NewPopulatedTransactionKnowledge(r, easy) + } + if !easy && r.Intn(10) != 0 { + } + return this +} + +func NewPopulatedTransactionKnowledge(r randyData, easy bool) *TransactionKnowledge { + this := &TransactionKnowledge{} + this.Epoch = int32(r.Int31()) + if r.Intn(2) == 0 { + this.Epoch *= -1 + } + if r.Intn(10) != 0 { + v14 := r.Intn(5) + this.KnownDispositions = make([]Intent, v14) + for i := 0; i < v14; i++ { + v15 := NewPopulatedIntent(r, easy) + this.KnownDispositions[i] = *v15 + } + } + if !easy && r.Intn(10) != 0 { + } + return this +} + +func NewPopulatedIntent(r randyData, easy bool) *Intent { + this := &Intent{} + v16 := NewPopulatedSpan(r, easy) + this.Span = *v16 + v17 := cockroach_storage_engine_enginepb.NewPopulatedTxnMeta(r, easy) + this.Txn = *v17 + this.Status = TransactionStatus([]int32{0, 1, 2}[r.Intn(3)]) if !easy && r.Intn(10) != 0 { } return this @@ -1915,13 +2044,13 @@ func NewPopulatedTransaction(r randyData, easy bool) *Transaction { func NewPopulatedLease(r randyData, easy bool) *Lease { this := &Lease{} - v14 := cockroach_util_hlc.NewPopulatedTimestamp(r, easy) - this.Start = *v14 + v18 := cockroach_util_hlc.NewPopulatedTimestamp(r, easy) + this.Start = *v18 if r.Intn(10) != 0 { this.Expiration = cockroach_util_hlc.NewPopulatedTimestamp(r, easy) } - v15 := NewPopulatedReplicaDescriptor(r, easy) - this.Replica = *v15 + v19 := NewPopulatedReplicaDescriptor(r, easy) + this.Replica = *v19 if r.Intn(10) != 0 { this.DeprecatedStartStasis = cockroach_util_hlc.NewPopulatedTimestamp(r, easy) } @@ -1943,13 +2072,13 @@ func NewPopulatedLease(r randyData, easy bool) *Lease { func NewPopulatedAbortSpanEntry(r randyData, easy bool) *AbortSpanEntry { this := &AbortSpanEntry{} - v16 := r.Intn(100) - this.Key = make(Key, v16) - for i := 0; i < v16; i++ { + v20 := r.Intn(100) + this.Key = make(Key, v20) + for i := 0; i < v20; i++ { this.Key[i] = byte(r.Intn(256)) } - v17 := cockroach_util_hlc.NewPopulatedTimestamp(r, easy) - this.Timestamp = *v17 + v21 := cockroach_util_hlc.NewPopulatedTimestamp(r, easy) + this.Timestamp = *v21 this.Priority = int32(r.Int31()) if r.Intn(2) == 0 { this.Priority *= -1 @@ -1978,9 +2107,9 @@ func randUTF8RuneData(r randyData) rune { return rune(ru + 61) } func randStringData(r randyData) string { - v18 := r.Intn(100) - tmps := make([]rune, v18) - for i := 0; i < v18; i++ { + v22 := r.Intn(100) + tmps := make([]rune, v22) + for i := 0; i < v22; i++ { tmps[i] = randUTF8RuneData(r) } return string(tmps) @@ -2002,11 +2131,11 @@ func randFieldData(dAtA []byte, r randyData, fieldNumber int, wire int) []byte { switch wire { case 0: dAtA = encodeVarintPopulateData(dAtA, uint64(key)) - v19 := r.Int63() + v23 := r.Int63() if r.Intn(2) == 0 { - v19 *= -1 + v23 *= -1 } - dAtA = encodeVarintPopulateData(dAtA, uint64(v19)) + dAtA = encodeVarintPopulateData(dAtA, uint64(v23)) case 1: dAtA = encodeVarintPopulateData(dAtA, uint64(key)) dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) @@ -2219,6 +2348,25 @@ func (m *Transaction) Size() (n int) { if m.OrigTimestampWasObserved { n += 3 } + if m.Knowledge != nil { + l = m.Knowledge.Size() + n += 2 + l + sovData(uint64(l)) + } + return n +} + +func (m *TransactionKnowledge) Size() (n int) { + var l int + _ = l + if m.Epoch != 0 { + n += 1 + sovData(uint64(m.Epoch)) + } + if len(m.KnownDispositions) > 0 { + for _, e := range m.KnownDispositions { + l = e.Size() + n += 1 + l + sovData(uint64(l)) + } + } return n } @@ -4009,6 +4157,139 @@ func (m *Transaction) Unmarshal(dAtA []byte) error { } } m.OrigTimestampWasObserved = bool(v != 0) + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Knowledge", 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 m.Knowledge == nil { + m.Knowledge = &TransactionKnowledge{} + } + if err := m.Knowledge.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + 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 *TransactionKnowledge) 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: TransactionKnowledge: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransactionKnowledge: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Epoch", wireType) + } + m.Epoch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowData + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Epoch |= (int32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KnownDispositions", 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.KnownDispositions = append(m.KnownDispositions, Intent{}) + if err := m.KnownDispositions[len(m.KnownDispositions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipData(dAtA[iNdEx:]) @@ -5007,124 +5288,129 @@ var ( func init() { proto.RegisterFile("roachpb/data.proto", fileDescriptorData) } var fileDescriptorData = []byte{ - // 1903 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4d, 0x6f, 0xdb, 0xc8, - 0xf9, 0x37, 0xf5, 0x62, 0x51, 0x8f, 0x5e, 0x4c, 0x8f, 0xe3, 0x44, 0x7f, 0x2f, 0xfe, 0x52, 0x56, - 0x5b, 0xb4, 0x41, 0xb0, 0x2b, 0xa3, 0x49, 0x5f, 0x8d, 0xb6, 0x80, 0xde, 0x92, 0x30, 0xb1, 0x64, - 0x83, 0xa2, 0x1d, 0x6c, 0x16, 0x0b, 0x96, 0x22, 0xc7, 0x12, 0x11, 0x89, 0x64, 0x87, 0x23, 0xc7, - 0xda, 0x4f, 0xb0, 0xb7, 0xee, 0xa1, 0x87, 0x1e, 0x03, 0xf4, 0xd6, 0x2f, 0xd0, 0x7e, 0x83, 0xe6, - 0x52, 0x60, 0x6f, 0x2d, 0x7a, 0x10, 0x5a, 0xf5, 0xd2, 0xa2, 0xb7, 0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0x71, 0x04, 0x84, 0x20, 0xe5, 0x9a, 0x63, 0x71, 0xbb, 0x66, - 0x35, 0x3e, 0x46, 0x3f, 0x82, 0x4d, 0xc6, 0x84, 0x13, 0x41, 0x85, 0xab, 0x19, 0x23, 0xe6, 0x4d, - 0x8f, 0xeb, 0x6a, 0xa1, 0x0d, 0x7a, 0x0a, 0xc5, 0x91, 0x19, 0x50, 0x63, 0x88, 0x4d, 0x42, 0xfb, - 0xd8, 0xbc, 0x11, 0xc9, 0x15, 0x98, 0xe9, 0x93, 0xc8, 0x92, 0x61, 0x79, 0xc4, 0x19, 0x18, 0xcb, - 0x48, 0x6e, 0xde, 0x00, 0x8b, 0x99, 0x2e, 0xf3, 0xf7, 0x04, 0x0a, 0x63, 0xf3, 0x22, 0x06, 0x95, - 0x59, 0x1f, 0x2a, 0x3f, 0x36, 0x2f, 0x96, 0x48, 0x9f, 0xc0, 0x8e, 0x17, 0x96, 0xc7, 0x12, 0x2e, - 0x28, 0xc9, 0xef, 0x24, 0xb3, 0x2b, 0xc5, 0x14, 0xc2, 0x22, 0xef, 0xdf, 0x17, 0x02, 0x54, 0x82, - 0xcc, 0x2b, 0xe2, 0x50, 0xc7, 0x1d, 0x94, 0xb2, 0x9c, 0x5a, 0xa2, 0x29, 0xfa, 0x3e, 0x64, 0x1c, - 0x97, 0x62, 0x97, 0x06, 0xa5, 0x1c, 0xdf, 0xea, 0x5d, 0x34, 0x12, 0x31, 0x6f, 0xa8, 0x8d, 0xaa, - 0x50, 0x60, 0x18, 0xd8, 0xa0, 0x9e, 0x67, 0x78, 0x23, 0xbb, 0x94, 0xe7, 0xc0, 0x39, 0x2e, 0xd4, - 0x3d, 0xef, 0x68, 0x64, 0x33, 0x1d, 0x82, 0x29, 0x99, 0x1a, 0x9e, 0x6b, 0xf8, 0x93, 0x60, 0x58, - 0x2a, 0x08, 0x1d, 0x2e, 0x3c, 0x72, 0x8f, 0x27, 0xc1, 0x10, 0x9d, 0xc0, 0x2d, 0xec, 0x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, 0xd4, 0x60, 0x74, 0xcb, - 0x39, 0xcb, 0x20, 0xd8, 0xb4, 0x59, 0x25, 0xad, 0xb1, 0x47, 0x3e, 0xb4, 0xd1, 0x98, 0x09, 0x6a, - 0x41, 0x31, 0xc2, 0xe0, 0x4c, 0xce, 0x6a, 0x64, 0x0d, 0x90, 0x68, 0x63, 0xde, 0xfd, 0x01, 0xfa, - 0x01, 0x94, 0x62, 0xd5, 0x1d, 0x01, 0x9e, 0x9b, 0x23, 0xc7, 0xe6, 0x95, 0x22, 0x6b, 0xb7, 0x97, - 0xeb, 0x9a, 0x58, 0x3e, 0x65, 0xab, 0xe8, 0x5b, 0xb0, 0x15, 0xa9, 0x3b, 0xae, 0x30, 0xc8, 0x70, - 0x83, 0xc8, 0x2d, 0x55, 0x48, 0xd1, 0x29, 0x20, 0x6f, 0x42, 0x03, 0x6a, 0xba, 0xb6, 0xe3, 0x0e, - 0x22, 0x67, 0xc5, 0x75, 0xf9, 0xfe, 0x2a, 0x67, 0x2f, 0x11, 0x54, 0xe8, 0xf6, 0x76, 0x0c, 0x42, - 0xb8, 0x7e, 0xff, 0x37, 0x12, 0x64, 0xf9, 0xb7, 0x3f, 0xff, 0x4a, 0xc9, 0x41, 0xe6, 0xa4, 0xfb, - 0xac, 0x7b, 0xf4, 0xbc, 0xab, 0x6c, 0xa0, 0x0c, 0x24, 0xd5, 0xae, 0xae, 0x48, 0x28, 0x0b, 0xe9, - 0x47, 0x87, 0x47, 0x75, 0x5d, 0x49, 0xb0, 0x61, 0xe3, 0x63, 0xbd, 0xdd, 0x53, 0x92, 0x68, 0x07, - 0xb6, 0x5a, 0xed, 0x43, 0xb5, 0xa3, 0xea, 0xed, 0x96, 0x21, 0x84, 0x32, 0x92, 0x21, 0xa5, 0xab, - 0x9d, 0xb6, 0x92, 0x62, 0x50, 0xad, 0x76, 0x53, 0xed, 0xd4, 0x0f, 0x95, 0x34, 0xda, 0x85, 0xed, - 0xa5, 0x6e, 0x24, 0xce, 0xa2, 0x3c, 0xc8, 0xad, 0x13, 0xad, 0xae, 0xab, 0x47, 0x5d, 0x65, 0x93, - 0x61, 0xeb, 0x27, 0xc7, 0x87, 0x6d, 0x05, 0xd8, 0x42, 0x43, 0xd5, 0xeb, 0x9a, 0x56, 0xff, 0x58, - 0xc9, 0xa1, 0x22, 0x00, 0x03, 0xed, 0xb5, 0x35, 0xb5, 0xdd, 0x53, 0xec, 0x6a, 0x4a, 0xce, 0x28, - 0x99, 0xfb, 0x3f, 0x81, 0xed, 0x2b, 0x9f, 0x5c, 0x68, 0x0b, 0x72, 0xf5, 0x56, 0xcb, 0xd0, 0xda, - 0xc7, 0x87, 0x6a, 0xb3, 0xae, 0x6c, 0x20, 0x04, 0x45, 0xad, 0xdd, 0x39, 0x3a, 0x6d, 0x2f, 0x64, - 0xd2, 0x5e, 0xea, 0xf3, 0x5f, 0x95, 0x37, 0xee, 0x37, 0x60, 0xfb, 0x0a, 0xd1, 0x33, 0xaf, 0x8f, - 0xdb, 0xdd, 0x96, 0xda, 0x7d, 0xac, 0x6c, 0xa0, 0x02, 0x64, 0x9b, 0x47, 0x9d, 0x8e, 0xaa, 0xeb, - 0xed, 0x96, 0x22, 0xb1, 0xb5, 0x7a, 0xe3, 0x48, 0x63, 0x93, 0x84, 0xc0, 0x68, 0xbc, 0xff, 0xe6, - 0x2f, 0xe5, 0x8d, 0x37, 0xf3, 0xb2, 0xf4, 0xe5, 0xbc, 0x2c, 0xfd, 0x71, 0x5e, 0x96, 0xfe, 0x3c, - 0x2f, 0x4b, 0x5f, 0xfc, 0xb5, 0xbc, 0xf1, 0x22, 0x13, 0x26, 0xa2, 0xbf, 0xc9, 0x7f, 0x77, 0x7a, - 0xf8, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6b, 0x8c, 0x12, 0x75, 0x31, 0x13, 0x00, 0x00, + // 1973 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcd, 0x6f, 0xdb, 0xc8, + 0x15, 0x37, 0xf5, 0x61, 0x49, 0x4f, 0x1f, 0xa6, 0x27, 0x71, 0xa2, 0xcd, 0xa2, 0x52, 0x56, 0x5b, + 0x74, 0x83, 0x60, 0x57, 0x46, 0x93, 0x7e, 0x06, 0x6d, 0x01, 0x7d, 0x25, 0x61, 0x62, 0xc9, 0x01, + 0x45, 0x3b, 0xd8, 0x2c, 0x16, 0x2c, 0x4d, 0x8e, 0x25, 0x22, 0x12, 0x87, 0xe5, 0x8c, 0x6c, 0x6b, + 0xff, 0x80, 0x62, 0x6f, 0xdd, 0x43, 0x0f, 0x3d, 0x06, 0xe8, 0xad, 0xff, 0x40, 0xfb, 0x07, 0xf4, + 0x10, 0xa0, 0x28, 0xb0, 0xb7, 0x16, 0x3d, 0x08, 0xad, 0x7a, 0x69, 0xd1, 0x5b, 0x8f, 0x01, 0x0a, + 0x14, 0x33, 0x43, 0x4a, 0x74, 0xad, 0x18, 0x72, 0xb7, 0x87, 0x5e, 0xec, 0x99, 0x37, 0xef, 0xfd, + 0xe6, 0xcd, 0xfb, 0xf8, 0xcd, 0x50, 0x80, 0x02, 0x62, 0xd9, 0x43, 0xff, 0x68, 0xd7, 0xb1, 0x98, + 0x55, 0xf7, 0x03, 0xc2, 0x08, 0xda, 0xb6, 0x89, 0xfd, 0x52, 0xc8, 0xeb, 0xe1, 0xea, 0xad, 0x1b, + 0x91, 0xda, 0x18, 0x33, 0x6b, 0xa9, 0x7a, 0xab, 0x46, 0x19, 0x09, 0xac, 0x01, 0xde, 0xc5, 0xde, + 0xc0, 0xf5, 0xa2, 0x7f, 0x5c, 0xef, 0xc4, 0xb6, 0x43, 0x9d, 0xf7, 0x2f, 0xd3, 0xb9, 0x1f, 0x2a, + 0x95, 0x27, 0xcc, 0x1d, 0xed, 0x0e, 0x47, 0xf6, 0x2e, 0x73, 0xc7, 0x98, 0x32, 0x6b, 0xec, 0x87, + 0x2b, 0xd7,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 0x7f, 0x2f, 0x66, 0x52, 0xbf, 0x36, + 0xbe, 0x28, 0x7c, 0x90, 0xfd, 0x3c, 0xbc, 0x14, 0x6b, 0x3f, 0x53, 0x60, 0x7b, 0xff, 0x88, 0xe2, + 0xe0, 0x04, 0x3b, 0x8b, 0x2e, 0x8c, 0x53, 0xbb, 0xb2, 0x06, 0xb5, 0xff, 0x0f, 0xee, 0xc9, 0x6c, + 0x74, 0x4d, 0xd7, 0x7e, 0x9b, 0x81, 0xbc, 0x11, 0x58, 0x1e, 0xb5, 0x6c, 0xe6, 0x12, 0x0f, 0x3d, + 0x86, 0x14, 0x7f, 0x94, 0x84, 0xc9, 0xbe, 0xbb, 0x06, 0x55, 0x19, 0x67, 0x5e, 0x17, 0x33, 0xab, + 0x99, 0xe5, 0x9b, 0x7c, 0x39, 0xab, 0x2a, 0xba, 0x40, 0x40, 0x08, 0x52, 0x9e, 0x35, 0x96, 0xb7, + 0x6b, 0x4e, 0x17, 0x63, 0xf4, 0x03, 0xd8, 0xe4, 0x4c, 0x38, 0x91, 0x54, 0xb8, 0x9a, 0x31, 0x62, + 0xde, 0xf4, 0x85, 0xae, 0x1e, 0xda, 0xa0, 0x27, 0x50, 0x1a, 0x59, 0x94, 0x99, 0x43, 0x6c, 0x05, + 0xec, 0x08, 0x5b, 0x57, 0x22, 0xb9, 0x22, 0x37, 0x7d, 0x1c, 0x59, 0x72, 0x2c, 0x12, 0xb8, 0x03, + 0x73, 0x19, 0xc9, 0xcd, 0x2b, 0x60, 0x71, 0xd3, 0x65, 0xfe, 0x1e, 0x43, 0x71, 0x6c, 0x9d, 0xc5, + 0xa0, 0x32, 0xeb, 0x43, 0x15, 0xc6, 0xd6, 0xd9, 0x12, 0xe9, 0x13, 0xb8, 0x46, 0xc2, 0xf2, 0x58, + 0xc2, 0xd1, 0x72, 0xf6, 0xad, 0x64, 0x76, 0xa1, 0x98, 0x42, 0x58, 0x44, 0xfe, 0x73, 0x81, 0xa2, + 0x32, 0x64, 0x4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 0x00, 0x38, 0x68, 0xbf, 0xa3, 0x6b, 0x9d, 0xbe, + 0xea, 0xd4, 0x52, 0xd9, 0x8c, 0x9a, 0xb9, 0xfb, 0x23, 0xd8, 0xbe, 0xf0, 0x19, 0x89, 0xb6, 0x20, + 0xdf, 0x68, 0xb7, 0x4d, 0xbd, 0xf3, 0x6c, 0x4f, 0x6b, 0x35, 0xd4, 0x0d, 0x84, 0xa0, 0xa4, 0x77, + 0xba, 0xfb, 0x87, 0x9d, 0x85, 0x4c, 0xb9, 0x95, 0xfa, 0xfc, 0x97, 0x95, 0x8d, 0xbb, 0x4d, 0xd8, + 0xbe, 0x40, 0xf6, 0xdc, 0xeb, 0x67, 0x9d, 0x5e, 0x5b, 0xeb, 0x3d, 0x52, 0x37, 0x50, 0x11, 0x72, + 0xad, 0xfd, 0x6e, 0x57, 0x33, 0x8c, 0x4e, 0x5b, 0x55, 0xf8, 0x5a, 0xa3, 0xb9, 0xaf, 0xf3, 0x49, + 0x42, 0x62, 0x34, 0xdf, 0x7b, 0xfd, 0x97, 0xca, 0xc6, 0xeb, 0x79, 0x45, 0xf9, 0x72, 0x5e, 0x51, + 0xfe, 0x38, 0xaf, 0x28, 0x7f, 0x9e, 0x57, 0x94, 0x2f, 0xfe, 0x5a, 0xd9, 0x78, 0x91, 0x09, 0x13, + 0x71, 0xb4, 0x29, 0x7e, 0x4b, 0xbb, 0xff, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6f, 0x7b, 0x01, + 0xc0, 0x05, 0x14, 0x00, 0x00, } diff --git a/pkg/roachpb/data.proto b/pkg/roachpb/data.proto index f75333b88337..962cf5778930 100644 --- a/pkg/roachpb/data.proto +++ b/pkg/roachpb/data.proto @@ -394,11 +394,31 @@ message Transaction { // which commit at a higher timestamp without resorting to a // client-side retry. bool orig_timestamp_was_observed = 16; + // Knowledge this transaction has about other transactions. + TransactionKnowledge knowledge = 17; +} + +message TransactionKnowledge { + option (gogoproto.equal) = true; + option (gogoproto.populate) = true; + + // // TODO: this contains two of the three fields in Intent. Do we use that here? + // message KnownDisposition { + // option (gogoproto.equal) = true; + // option (gogoproto.populate) = true; + + // storage.engine.enginepb.TxnMeta meta = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; + // TransactionStatus status = 2; + // } + + int32 epoch = 1; + repeated Intent known_dispositions = 2 [(gogoproto.nullable) = false]; } // A Intent is a Span together with a Transaction metadata and its status. message Intent { option (gogoproto.equal) = true; + option (gogoproto.populate) = true; Span span = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; storage.engine.enginepb.TxnMeta txn = 2 [(gogoproto.nullable) = false]; diff --git a/pkg/storage/engine/mvcc.go b/pkg/storage/engine/mvcc.go index bcc9759cf8b1..f49bf03ef8c0 100644 --- a/pkg/storage/engine/mvcc.go +++ b/pkg/storage/engine/mvcc.go @@ -1225,9 +1225,36 @@ func mvccPutInternal( if meta.Txn != nil { // There is an uncommitted write intent. if txn == nil || meta.Txn.ID != txn.ID { - // The current Put operation does not come from the same - // transaction. - return &roachpb.WriteIntentError{Intents: []roachpb.Intent{{Span: roachpb.Span{Key: key}, Status: roachpb.PENDING, Txn: *meta.Txn}}} + // The current intent does not come from the same transaction. + intent := roachpb.Intent{ + Span: roachpb.Span{Key: key}, + Status: roachpb.PENDING, + Txn: *meta.Txn, + } + + // Check if we know the status of this intent's transaction. If + // we do, we may be able to resolve the intent immediately + // without needing to go through the intent resolution process. + // If not, we return a WriteIntentError. + known := false + if txn != nil { + var knownTxn roachpb.Intent + if known, knownTxn = txn.Knowledge.KnownDisposition(intent.Txn.ID); known { + intent.Status = knownTxn.Status + intent.Txn = knownTxn.Txn + } + } + if !known { + return &roachpb.WriteIntentError{Intents: []roachpb.Intent{intent}} + } + + found, err := mvccResolveWriteIntent(ctx, engine, iter, ms, intent, buf, false /* forRange */) + if err != nil { + return errors.Wrapf(err, "resolving intent for known %v txn", intent.Status) + } + if !found { + log.Fatalf(ctx, "could not resolve intent that was previous present: %v", intent) + } } else if txn.Epoch < meta.Txn.Epoch { return errors.Errorf("put with epoch %d came after put with epoch %d in txn %s", txn.Epoch, meta.Txn.Epoch, txn.ID) @@ -1238,47 +1265,48 @@ func mvccPutInternal( // Replay error if we encounter an older sequence number or // the same (or earlier) batch index for the same sequence. return roachpb.NewTransactionRetryError(roachpb.RETRY_POSSIBLE_REPLAY) - } - // Make sure we process valueFn before clearing any earlier - // version. For example, a conditional put within same - // transaction should read previous write. - if value, err = maybeGetValue( - ctx, iter, metaKey, value, ok, timestamp, txn, buf, valueFn); err != nil { - return err - } - // We are replacing our own write intent. If we are writing at - // the same timestamp (see comments in else block) we can - // overwrite the existing intent; otherwise we must manually - // delete the old intent, taking care with MVCC stats. - logicalOp = MVCCUpdateIntentOpType - if metaTimestamp.Less(timestamp) { - { - // If the older write intent has a version underneath it, we need to - // read its size because its GCBytesAge contribution may change as we - // move the intent above it. A similar phenomenon occurs in - // MVCCResolveWriteIntent. - latestKey := MVCCKey{Key: key, Timestamp: metaTimestamp} - _, prevVal, haveNextVersion, err := unsafeNextVersion(iter, latestKey) - if err != nil { - return err - } - if haveNextVersion { - prevValSize = int64(len(prevVal)) - } + } else { + // Make sure we process valueFn before clearing any earlier + // version. For example, a conditional put within same + // transaction should read previous write. + if value, err = maybeGetValue( + ctx, iter, metaKey, value, ok, timestamp, txn, buf, valueFn); err != nil { + return err } + // We are replacing our own write intent. If we are writing at + // the same timestamp (see comments in else block) we can + // overwrite the existing intent; otherwise we must manually + // delete the old intent, taking care with MVCC stats. + logicalOp = MVCCUpdateIntentOpType + if metaTimestamp.Less(timestamp) { + { + // If the older write intent has a version underneath it, we need to + // read its size because its GCBytesAge contribution may change as we + // move the intent above it. A similar phenomenon occurs in + // MVCCResolveWriteIntent. + latestKey := MVCCKey{Key: key, Timestamp: metaTimestamp} + _, prevVal, haveNextVersion, err := unsafeNextVersion(iter, latestKey) + if err != nil { + return err + } + if haveNextVersion { + prevValSize = int64(len(prevVal)) + } + } - versionKey := metaKey - versionKey.Timestamp = metaTimestamp - if err := engine.Clear(versionKey); err != nil { - return err + versionKey := metaKey + versionKey.Timestamp = metaTimestamp + if err := engine.Clear(versionKey); err != nil { + return err + } + } else if timestamp.Less(metaTimestamp) { + // This case occurs when we're writing a key twice within a + // txn, and our timestamp has been pushed forward because of + // a write-too-old error on this key. For this case, we want + // to continue writing at the higher timestamp or else the + // MVCCMetadata could end up pointing *under* the newer write. + timestamp = metaTimestamp } - } else if timestamp.Less(metaTimestamp) { - // This case occurs when we're writing a key twice within a - // txn, and our timestamp has been pushed forward because of - // a write-too-old error on this key. For this case, we want - // to continue writing at the higher timestamp or else the - // MVCCMetadata could end up pointing *under* the newer write. - timestamp = metaTimestamp } } else if !metaTimestamp.Less(timestamp) { // This is the case where we're trying to write under a @@ -2127,7 +2155,7 @@ func MVCCResolveWriteIntent( // uses iterator and buffer passed as parameters (e.g. when used in a loop). func MVCCResolveWriteIntentUsingIter( ctx context.Context, - engine ReadWriter, + engine Writer, iterAndBuf IterAndBuf, ms *enginepb.MVCCStats, intent roachpb.Intent, @@ -2169,7 +2197,7 @@ func unsafeNextVersion(iter Iterator, latestKey MVCCKey) (MVCCKey, []byte, bool, // Returns whether an intent was found and resolved, false otherwise. func mvccResolveWriteIntent( ctx context.Context, - engine ReadWriter, + engine Writer, iter Iterator, ms *enginepb.MVCCStats, intent roachpb.Intent, @@ -2217,7 +2245,7 @@ func mvccResolveWriteIntent( v, _, _, err := mvccGetInternal(ctx, iter, metaKey, intent.Txn.Timestamp, false, unsafeValue, nil, gbuf) if err != nil { - log.Warningf(ctx, "unable to find value for %s @ %s: %v ", + log.Warningf(ctx, "unable to find value for %s @ %s: %v", intent.Key, intent.Txn.Timestamp, err) } else if v == nil { // This should never happen as ok is true above. @@ -2337,11 +2365,17 @@ func mvccResolveWriteIntent( if hlc.Timestamp(meta.Timestamp) != intent.Txn.Timestamp { origKey := MVCCKey{Key: intent.Key, Timestamp: hlc.Timestamp(meta.Timestamp)} newKey := MVCCKey{Key: intent.Key, Timestamp: intent.Txn.Timestamp} - valBytes, err := engine.Get(origKey) - if err != nil { - return false, err + + iter.Seek(origKey) + if ok, err := iter.Valid(); err != nil { + return false, errors.Errorf("unable to find value for %s @ %s to move to %s: %v", + intent.Key, meta.Timestamp, intent.Txn.Timestamp, err) + } else if !ok || !iter.UnsafeKey().Key.Equal(origKey.Key) { + return false, errors.Errorf("unable to find value for %s @ %s to move to %s", + intent.Key, meta.Timestamp, intent.Txn.Timestamp) } - if err = engine.Put(newKey, valBytes); err != nil { + + if err = engine.Put(newKey, iter.UnsafeValue()); err != nil { return false, err } if err = engine.Clear(origKey); err != nil { @@ -2483,7 +2517,7 @@ func MVCCResolveWriteIntentRange( // the max keys limit was exceeded. func MVCCResolveWriteIntentRangeUsingIter( ctx context.Context, - engine ReadWriter, + engine Writer, iterAndBuf IterAndBuf, ms *enginepb.MVCCStats, intent roachpb.Intent, diff --git a/pkg/storage/intent_resolver.go b/pkg/storage/intent_resolver.go index 1f16ef9bbaec..768a5faa7000 100644 --- a/pkg/storage/intent_resolver.go +++ b/pkg/storage/intent_resolver.go @@ -406,10 +406,14 @@ func (ir *intentResolver) processWriteIntentError( args roachpb.Request, h roachpb.Header, pushType roachpb.PushTxnType, -) (func(newWIErr *roachpb.WriteIntentError, newIntentTxn *enginepb.TxnMeta), *roachpb.Error) { +) ( + func(newWIErr *roachpb.WriteIntentError, newIntentTxn *enginepb.TxnMeta), + *roachpb.TransactionKnowledge, + *roachpb.Error, +) { wiErr, ok := wiPErr.GetDetail().(*roachpb.WriteIntentError) if !ok { - return nil, roachpb.NewErrorf("not a WriteIntentError: %v", wiPErr) + return nil, nil, roachpb.NewErrorf("not a WriteIntentError: %v", wiPErr) } if log.V(6) { @@ -425,15 +429,15 @@ func (ir *intentResolver) processWriteIntentError( // that this pusher is queued to wait for a different transaction // instead. if cleanup, wiErr, done = ir.contentionQ.add(ctx, wiErr, h); done { - return cleanup, nil + return cleanup, nil, nil } } - resolveIntents, pErr := ir.maybePushIntents( + resolveIntents, k, pErr := ir.maybePushIntents( ctx, wiErr.Intents, h, pushType, false, /* skipIfInFlight */ ) if pErr != nil { - return cleanup, pErr + return cleanup, nil, pErr } // We always poison due to limitations of the API: not poisoning equals @@ -448,10 +452,10 @@ func (ir *intentResolver) processWriteIntentError( // poison. if err := ir.resolveIntents(ctx, resolveIntents, ResolveOptions{Wait: false, Poison: true}); err != nil { - return cleanup, roachpb.NewError(err) + return cleanup, nil, roachpb.NewError(err) } - return cleanup, nil + return cleanup, k, nil } func getPusherTxn(h roachpb.Header) roachpb.Transaction { @@ -498,7 +502,12 @@ func (ir *intentResolver) maybePushIntents( h roachpb.Header, pushType roachpb.PushTxnType, skipIfInFlight bool, -) ([]roachpb.Intent, *roachpb.Error) { +) ([]roachpb.Intent, *roachpb.TransactionKnowledge, *roachpb.Error) { + var k *roachpb.TransactionKnowledge + if h.Txn != nil { + k = h.Txn.Knowledge + } + // Attempt to push the transaction(s) which created the conflicting intent(s). pushTxns := make(map[uuid.UUID]enginepb.TxnMeta) for _, intent := range intents { @@ -507,14 +516,21 @@ func (ir *intentResolver) maybePushIntents( // because the transaction is already finalized. // This shouldn't happen as all intents created are in // the PENDING status. - return nil, roachpb.NewErrorf("unexpected %s intent: %+v", intent.Status, intent) + return nil, nil, roachpb.NewErrorf("unexpected %s intent: %+v", intent.Status, intent) + } + if known, _ := k.KnownDisposition(intent.Txn.ID); known { + continue } pushTxns[intent.Txn.ID] = intent.Txn } - pushedTxns, pErr := ir.maybePushTransactions(ctx, pushTxns, h, pushType, skipIfInFlight) - if pErr != nil { - return nil, pErr + var pushedTxns map[uuid.UUID]roachpb.Transaction + if len(pushTxns) > 0 { + var pErr *roachpb.Error + pushedTxns, pErr = ir.maybePushTransactions(ctx, pushTxns, h, pushType, skipIfInFlight) + if pErr != nil { + return nil, nil, pErr + } } var resolveIntents []roachpb.Intent @@ -522,6 +538,12 @@ func (ir *intentResolver) maybePushIntents( pushee, ok := pushedTxns[intent.Txn.ID] if !ok { // The intent was not pushed. + if known, knownStatus := k.KnownDisposition(intent.Txn.ID); known { + // We already knew about it. + knownStatus.Span = intent.Span + resolveIntents = append(resolveIntents, knownStatus) + continue + } if !skipIfInFlight { log.Fatalf(ctx, "no PushTxn response for intent %+v", intent) } @@ -531,8 +553,9 @@ func (ir *intentResolver) maybePushIntents( intent.Txn = pushee.TxnMeta intent.Status = pushee.Status resolveIntents = append(resolveIntents, intent) + k = k.RememberDisposition(intent.Txn, intent.Status) } - return resolveIntents, nil + return resolveIntents, k, nil } // maybePushTransactions is like maybePushIntents except it takes a set of @@ -692,7 +715,7 @@ func (ir *intentResolver) cleanupIntents( ctx context.Context, intents []roachpb.Intent, now hlc.Timestamp, pushType roachpb.PushTxnType, ) (int, error) { h := roachpb.Header{Timestamp: now} - resolveIntents, pushErr := ir.maybePushIntents( + resolveIntents, _, pushErr := ir.maybePushIntents( ctx, intents, h, pushType, true, /* skipIfInFlight */ ) if pushErr != nil { diff --git a/pkg/storage/intent_resolver_test.go b/pkg/storage/intent_resolver_test.go index 248bcf0d3741..4c8d53be3a0c 100644 --- a/pkg/storage/intent_resolver_test.go +++ b/pkg/storage/intent_resolver_test.go @@ -47,7 +47,7 @@ func TestPushTransactionsWithNonPendingIntent(t *testing.T) { {Span: roachpb.Span{Key: roachpb.Key("b")}, Status: roachpb.COMMITTED}}, } for _, intents := range testCases { - if _, pErr := tc.store.intentResolver.maybePushIntents( + if _, _, pErr := tc.store.intentResolver.maybePushIntents( context.Background(), intents, roachpb.Header{}, roachpb.PUSH_TOUCH, true, ); !testutils.IsPError(pErr, "unexpected (ABORTED|COMMITTED) intent") { t.Errorf("expected error on aborted/resolved intent, but got %s", pErr) @@ -126,7 +126,7 @@ func TestContendedIntent(t *testing.T) { h := roachpb.Header{Txn: tc.pusher} wg.Add(1) go func() { - _, pErr := ir.processWriteIntentError(ctx, roachpb.NewError(wiErr), nil, h, roachpb.PUSH_ABORT) + _, _, pErr := ir.processWriteIntentError(ctx, roachpb.NewError(wiErr), nil, h, roachpb.PUSH_ABORT) if pErr != nil && !testutils.IsPError(pErr, "context canceled") { panic(pErr) } diff --git a/pkg/storage/store.go b/pkg/storage/store.go index 4b1618a5ed64..7b744383ce9c 100644 --- a/pkg/storage/store.go +++ b/pkg/storage/store.go @@ -3089,7 +3089,8 @@ func (s *Store) Send( if cleanupAfterWriteIntentError != nil { cleanupAfterWriteIntentError(t, nil) } - if cleanupAfterWriteIntentError, pErr = + var tk *roachpb.TransactionKnowledge + if cleanupAfterWriteIntentError, tk, pErr = s.intentResolver.processWriteIntentError(ctx, pErr, args, h, pushType); pErr != nil { // Do not propagate ambiguous results; assume success and retry original op. if _, ok := pErr.GetDetail().(*roachpb.AmbiguousResultError); !ok { @@ -3099,7 +3100,12 @@ func (s *Store) Send( } pErr = nil } - // We've resolved the write intent; retry command. + + if tk != nil { + shallowTxn := *ba.Txn + shallowTxn.Knowledge = shallowTxn.Knowledge.Update(tk) + ba.Txn = &shallowTxn + } } case *roachpb.MergeInProgressError: