diff --git a/Makefile b/Makefile index ce93c576adde..3476b5f5cf71 100644 --- a/Makefile +++ b/Makefile @@ -1202,7 +1202,7 @@ UI_JS_OSS := pkg/ui/src/js/protos.js UI_TS_OSS := pkg/ui/src/js/protos.d.ts UI_PROTOS_OSS := $(UI_JS_OSS) $(UI_TS_OSS) -CPP_PROTOS := $(filter %/roachpb/metadata.proto %/roachpb/data.proto %/roachpb/internal.proto %/roachpb/errors.proto %/roachpb/api.proto %util/tracing/recorded_span.proto %/engine/enginepb/mvcc.proto %/engine/enginepb/mvcc3.proto %/engine/enginepb/file_registry.proto %/engine/enginepb/rocksdb.proto %/hlc/legacy_timestamp.proto %/hlc/timestamp.proto %/log/log.proto %/unresolved_addr.proto,$(GO_PROTOS)) +CPP_PROTOS := $(filter %/roachpb/api.proto %/roachpb/metadata.proto %/roachpb/data.proto %/roachpb/internal.proto %/roachpb/errors.proto %util/tracing/recorded_span.proto %/concurrency/lock/locking.proto %/engine/enginepb/mvcc.proto %/engine/enginepb/mvcc3.proto %/engine/enginepb/file_registry.proto %/engine/enginepb/rocksdb.proto %/hlc/legacy_timestamp.proto %/hlc/timestamp.proto %/log/log.proto %/unresolved_addr.proto,$(GO_PROTOS)) CPP_HEADERS := $(subst ./pkg,$(CPP_PROTO_ROOT),$(CPP_PROTOS:%.proto=%.pb.h)) CPP_SOURCES := $(subst ./pkg,$(CPP_PROTO_ROOT),$(CPP_PROTOS:%.proto=%.pb.cc)) diff --git a/c-deps/libroach/CMakeLists.txt b/c-deps/libroach/CMakeLists.txt index 818ffd36f961..cdb23b9abded 100644 --- a/c-deps/libroach/CMakeLists.txt +++ b/c-deps/libroach/CMakeLists.txt @@ -44,10 +44,12 @@ add_library(roach sst_dump.cc table_props.cc utils.cc + protos/roachpb/api.pb.cc protos/roachpb/data.pb.cc protos/roachpb/errors.pb.cc protos/roachpb/internal.pb.cc protos/roachpb/metadata.pb.cc + protos/storage/concurrency/lock/locking.pb.cc protos/storage/engine/enginepb/mvcc.pb.cc protos/storage/engine/enginepb/mvcc3.pb.cc protos/storage/engine/enginepb/file_registry.pb.cc @@ -55,9 +57,8 @@ add_library(roach protos/util/hlc/legacy_timestamp.pb.cc protos/util/hlc/timestamp.pb.cc protos/util/log/log.pb.cc - protos/util/unresolved_addr.pb.cc - protos/roachpb/api.pb.cc protos/util/tracing/recorded_span.pb.cc + protos/util/unresolved_addr.pb.cc rocksdbutils/env_encryption.cc ) target_include_directories(roach diff --git a/c-deps/libroach/db.cc b/c-deps/libroach/db.cc index cc81aca93899..e9ca26be71e8 100644 --- a/c-deps/libroach/db.cc +++ b/c-deps/libroach/db.cc @@ -573,8 +573,8 @@ DBIterState DBCheckForKeyCollisions(DBIterator* existingIter, DBIterator* sstIte // target key space, which will require appropriate resolution logic. cockroach::roachpb::WriteIntentError err; cockroach::roachpb::Intent* intent = err.add_intents(); - intent->mutable_span()->set_key(existingIter->rep->key().data(), - existingIter->rep->key().size()); + intent->mutable_single_key_span()->set_key(existingIter->rep->key().data(), + existingIter->rep->key().size()); intent->mutable_txn()->CopyFrom(meta.txn()); *write_intent = ToDBString(err.SerializeAsString()); diff --git a/c-deps/libroach/incremental_iterator.cc b/c-deps/libroach/incremental_iterator.cc index e165a4f0bddc..b9cf05e6920c 100644 --- a/c-deps/libroach/incremental_iterator.cc +++ b/c-deps/libroach/incremental_iterator.cc @@ -161,7 +161,7 @@ void DBIncrementalIterator::advanceKey() { !legacyTimestampIsLess(end_time, meta.timestamp())) { cockroach::roachpb::WriteIntentError err; cockroach::roachpb::Intent* intent = err.add_intents(); - intent->mutable_span()->set_key(key.data(), key.size()); + intent->mutable_single_key_span()->set_key(key.data(), key.size()); intent->mutable_txn()->CopyFrom(meta.txn()); status = ToDBString("WriteIntentError"); diff --git a/c-deps/libroach/protos/roachpb/data.pb.cc b/c-deps/libroach/protos/roachpb/data.pb.cc index a7508c937e39..6d19bf1470ec 100644 --- a/c-deps/libroach/protos/roachpb/data.pb.cc +++ b/c-deps/libroach/protos/roachpb/data.pb.cc @@ -17,6 +17,7 @@ // @@protoc_insertion_point(includes) namespace protobuf_roachpb_2fdata_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Intent_SingleKeySpan; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_SequencedWrite; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Span; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_ModifiedSpanTrigger; @@ -109,11 +110,21 @@ class TransactionRecordDefaultTypeInternal { ::google::protobuf::internal::ExplicitlyConstructed _instance; } _TransactionRecord_default_instance_; +class Intent_SingleKeySpanDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Intent_SingleKeySpan_default_instance_; class IntentDefaultTypeInternal { public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _Intent_default_instance_; +class LockUpdateDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _LockUpdate_default_instance_; class SequencedWriteDefaultTypeInternal { public: ::google::protobuf::internal::ExplicitlyConstructed @@ -351,6 +362,20 @@ ::google::protobuf::internal::SCCInfo<5> scc_info_TransactionRecord = &protobuf_roachpb_2fdata_2eproto::scc_info_SequencedWrite.base, &protobuf_storage_2fengine_2fenginepb_2fmvcc3_2eproto::scc_info_IgnoredSeqNumRange.base,}}; +static void InitDefaultsIntent_SingleKeySpan() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::cockroach::roachpb::_Intent_SingleKeySpan_default_instance_; + new (ptr) ::cockroach::roachpb::Intent_SingleKeySpan(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::cockroach::roachpb::Intent_SingleKeySpan::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Intent_SingleKeySpan = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsIntent_SingleKeySpan}, {}}; + static void InitDefaultsIntent() { GOOGLE_PROTOBUF_VERIFY_VERSION; @@ -362,8 +387,24 @@ static void InitDefaultsIntent() { ::cockroach::roachpb::Intent::InitAsDefaultInstance(); } -::google::protobuf::internal::SCCInfo<3> scc_info_Intent = - {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsIntent}, { +::google::protobuf::internal::SCCInfo<2> scc_info_Intent = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsIntent}, { + &protobuf_roachpb_2fdata_2eproto::scc_info_Intent_SingleKeySpan.base, + &protobuf_storage_2fengine_2fenginepb_2fmvcc3_2eproto::scc_info_TxnMeta.base,}}; + +static void InitDefaultsLockUpdate() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::cockroach::roachpb::_LockUpdate_default_instance_; + new (ptr) ::cockroach::roachpb::LockUpdate(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::cockroach::roachpb::LockUpdate::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_LockUpdate = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsLockUpdate}, { &protobuf_roachpb_2fdata_2eproto::scc_info_Span.base, &protobuf_storage_2fengine_2fenginepb_2fmvcc3_2eproto::scc_info_TxnMeta.base, &protobuf_storage_2fengine_2fenginepb_2fmvcc3_2eproto::scc_info_IgnoredSeqNumRange.base,}}; @@ -459,7 +500,9 @@ void InitDefaults() { ::google::protobuf::internal::InitSCC(&scc_info_ObservedTimestamp.base); ::google::protobuf::internal::InitSCC(&scc_info_Transaction.base); ::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_LockUpdate.base); ::google::protobuf::internal::InitSCC(&scc_info_SequencedWrite.base); ::google::protobuf::internal::InitSCC(&scc_info_Lease.base); ::google::protobuf::internal::InitSCC(&scc_info_AbortSpanEntry.base); @@ -4463,11 +4506,194 @@ ::std::string TransactionRecord::GetTypeName() const { } +// =================================================================== + +void Intent_SingleKeySpan::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Intent_SingleKeySpan::kKeyFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Intent_SingleKeySpan::Intent_SingleKeySpan() + : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_roachpb_2fdata_2eproto::scc_info_Intent_SingleKeySpan.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:cockroach.roachpb.Intent.SingleKeySpan) +} +Intent_SingleKeySpan::Intent_SingleKeySpan(const Intent_SingleKeySpan& from) + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.key().size() > 0) { + key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.key_); + } + // @@protoc_insertion_point(copy_constructor:cockroach.roachpb.Intent.SingleKeySpan) +} + +void Intent_SingleKeySpan::SharedCtor() { + key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +Intent_SingleKeySpan::~Intent_SingleKeySpan() { + // @@protoc_insertion_point(destructor:cockroach.roachpb.Intent.SingleKeySpan) + SharedDtor(); +} + +void Intent_SingleKeySpan::SharedDtor() { + key_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void Intent_SingleKeySpan::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const Intent_SingleKeySpan& Intent_SingleKeySpan::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_roachpb_2fdata_2eproto::scc_info_Intent_SingleKeySpan.base); + return *internal_default_instance(); +} + + +void Intent_SingleKeySpan::Clear() { +// @@protoc_insertion_point(message_clear_start:cockroach.roachpb.Intent.SingleKeySpan) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + key_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +bool Intent_SingleKeySpan::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.Intent.SingleKeySpan) + 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 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_key())); + } 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.Intent.SingleKeySpan) + return true; +failure: + // @@protoc_insertion_point(parse_failure:cockroach.roachpb.Intent.SingleKeySpan) + return false; +#undef DO_ +} + +void Intent_SingleKeySpan::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:cockroach.roachpb.Intent.SingleKeySpan) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (this->key().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->key(), 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.Intent.SingleKeySpan) +} + +size_t Intent_SingleKeySpan::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:cockroach.roachpb.Intent.SingleKeySpan) + size_t total_size = 0; + + total_size += (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()).size(); + + if (this->key().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->key()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Intent_SingleKeySpan::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void Intent_SingleKeySpan::MergeFrom(const Intent_SingleKeySpan& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:cockroach.roachpb.Intent.SingleKeySpan) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.key().size() > 0) { + + key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.key_); + } +} + +void Intent_SingleKeySpan::CopyFrom(const Intent_SingleKeySpan& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:cockroach.roachpb.Intent.SingleKeySpan) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Intent_SingleKeySpan::IsInitialized() const { + return true; +} + +void Intent_SingleKeySpan::Swap(Intent_SingleKeySpan* other) { + if (other == this) return; + InternalSwap(other); +} +void Intent_SingleKeySpan::InternalSwap(Intent_SingleKeySpan* other) { + using std::swap; + key_.Swap(&other->key_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::std::string Intent_SingleKeySpan::GetTypeName() const { + return "cockroach.roachpb.Intent.SingleKeySpan"; +} + + // =================================================================== void Intent::InitAsDefaultInstance() { - ::cockroach::roachpb::_Intent_default_instance_._instance.get_mutable()->span_ = const_cast< ::cockroach::roachpb::Span*>( - ::cockroach::roachpb::Span::internal_default_instance()); + ::cockroach::roachpb::_Intent_default_instance_._instance.get_mutable()->single_key_span_ = const_cast< ::cockroach::roachpb::Intent_SingleKeySpan*>( + ::cockroach::roachpb::Intent_SingleKeySpan::internal_default_instance()); ::cockroach::roachpb::_Intent_default_instance_._instance.get_mutable()->txn_ = const_cast< ::cockroach::storage::engine::enginepb::TxnMeta*>( ::cockroach::storage::engine::enginepb::TxnMeta::internal_default_instance()); } @@ -4477,14 +4703,9 @@ void Intent::clear_txn() { } txn_ = NULL; } -void Intent::clear_ignored_seqnums() { - ignored_seqnums_.Clear(); -} #if !defined(_MSC_VER) || _MSC_VER >= 1900 -const int Intent::kSpanFieldNumber; +const int Intent::kSingleKeySpanFieldNumber; const int Intent::kTxnFieldNumber; -const int Intent::kStatusFieldNumber; -const int Intent::kIgnoredSeqnumsFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Intent::Intent() @@ -4496,27 +4717,25 @@ Intent::Intent() } Intent::Intent(const Intent& from) : ::google::protobuf::MessageLite(), - _internal_metadata_(NULL), - ignored_seqnums_(from.ignored_seqnums_) { + _internal_metadata_(NULL) { _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from.has_span()) { - span_ = new ::cockroach::roachpb::Span(*from.span_); + if (from.has_single_key_span()) { + single_key_span_ = new ::cockroach::roachpb::Intent_SingleKeySpan(*from.single_key_span_); } else { - span_ = NULL; + single_key_span_ = NULL; } if (from.has_txn()) { txn_ = new ::cockroach::storage::engine::enginepb::TxnMeta(*from.txn_); } else { txn_ = NULL; } - status_ = from.status_; // @@protoc_insertion_point(copy_constructor:cockroach.roachpb.Intent) } void Intent::SharedCtor() { - ::memset(&span_, 0, static_cast( - reinterpret_cast(&status_) - - reinterpret_cast(&span_)) + sizeof(status_)); + ::memset(&single_key_span_, 0, static_cast( + reinterpret_cast(&txn_) - + reinterpret_cast(&single_key_span_)) + sizeof(txn_)); } Intent::~Intent() { @@ -4525,7 +4744,7 @@ Intent::~Intent() { } void Intent::SharedDtor() { - if (this != internal_default_instance()) delete span_; + if (this != internal_default_instance()) delete single_key_span_; if (this != internal_default_instance()) delete txn_; } @@ -4544,6 +4763,250 @@ void Intent::Clear() { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + if (GetArenaNoVirtual() == NULL && single_key_span_ != NULL) { + delete single_key_span_; + } + single_key_span_ = NULL; + if (GetArenaNoVirtual() == NULL && txn_ != NULL) { + delete txn_; + } + txn_ = NULL; + _internal_metadata_.Clear(); +} + +bool Intent::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.Intent) + 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_single_key_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; + } + + 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.Intent) + return true; +failure: + // @@protoc_insertion_point(parse_failure:cockroach.roachpb.Intent) + return false; +#undef DO_ +} + +void Intent::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:cockroach.roachpb.Intent) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (this->has_single_key_span()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->_internal_single_key_span(), output); + } + + if (this->has_txn()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->_internal_txn(), 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.Intent) +} + +size_t Intent::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:cockroach.roachpb.Intent) + size_t total_size = 0; + + total_size += (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()).size(); + + if (this->has_single_key_span()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *single_key_span_); + } + + if (this->has_txn()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *txn_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Intent::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void Intent::MergeFrom(const Intent& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:cockroach.roachpb.Intent) + 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_single_key_span()) { + mutable_single_key_span()->::cockroach::roachpb::Intent_SingleKeySpan::MergeFrom(from.single_key_span()); + } + if (from.has_txn()) { + mutable_txn()->::cockroach::storage::engine::enginepb::TxnMeta::MergeFrom(from.txn()); + } +} + +void Intent::CopyFrom(const Intent& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:cockroach.roachpb.Intent) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Intent::IsInitialized() const { + return true; +} + +void Intent::Swap(Intent* other) { + if (other == this) return; + InternalSwap(other); +} +void Intent::InternalSwap(Intent* other) { + using std::swap; + swap(single_key_span_, other->single_key_span_); + swap(txn_, other->txn_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::std::string Intent::GetTypeName() const { + return "cockroach.roachpb.Intent"; +} + + +// =================================================================== + +void LockUpdate::InitAsDefaultInstance() { + ::cockroach::roachpb::_LockUpdate_default_instance_._instance.get_mutable()->span_ = const_cast< ::cockroach::roachpb::Span*>( + ::cockroach::roachpb::Span::internal_default_instance()); + ::cockroach::roachpb::_LockUpdate_default_instance_._instance.get_mutable()->txn_ = const_cast< ::cockroach::storage::engine::enginepb::TxnMeta*>( + ::cockroach::storage::engine::enginepb::TxnMeta::internal_default_instance()); +} +void LockUpdate::clear_txn() { + if (GetArenaNoVirtual() == NULL && txn_ != NULL) { + delete txn_; + } + txn_ = NULL; +} +void LockUpdate::clear_ignored_seqnums() { + ignored_seqnums_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +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() + : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_roachpb_2fdata_2eproto::scc_info_LockUpdate.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:cockroach.roachpb.LockUpdate) +} +LockUpdate::LockUpdate(const LockUpdate& from) + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + ignored_seqnums_(from.ignored_seqnums_) { + _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::engine::enginepb::TxnMeta(*from.txn_); + } else { + txn_ = NULL; + } + ::memcpy(&status_, &from.status_, + static_cast(reinterpret_cast(&durability_) - + reinterpret_cast(&status_)) + sizeof(durability_)); + // @@protoc_insertion_point(copy_constructor:cockroach.roachpb.LockUpdate) +} + +void LockUpdate::SharedCtor() { + ::memset(&span_, 0, static_cast( + reinterpret_cast(&durability_) - + reinterpret_cast(&span_)) + sizeof(durability_)); +} + +LockUpdate::~LockUpdate() { + // @@protoc_insertion_point(destructor:cockroach.roachpb.LockUpdate) + SharedDtor(); +} + +void LockUpdate::SharedDtor() { + if (this != internal_default_instance()) delete span_; + if (this != internal_default_instance()) delete txn_; +} + +void LockUpdate::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const LockUpdate& LockUpdate::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_roachpb_2fdata_2eproto::scc_info_LockUpdate.base); + return *internal_default_instance(); +} + + +void LockUpdate::Clear() { +// @@protoc_insertion_point(message_clear_start:cockroach.roachpb.LockUpdate) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + ignored_seqnums_.Clear(); if (GetArenaNoVirtual() == NULL && span_ != NULL) { delete span_; @@ -4553,11 +5016,13 @@ void Intent::Clear() { delete txn_; } txn_ = NULL; - status_ = 0; + ::memset(&status_, 0, static_cast( + reinterpret_cast(&durability_) - + reinterpret_cast(&status_)) + sizeof(durability_)); _internal_metadata_.Clear(); } -bool Intent::MergePartialFromCodedStream( +bool LockUpdate::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; @@ -4567,7 +5032,7 @@ bool Intent::MergePartialFromCodedStream( unknown_fields_setter.buffer()); ::google::protobuf::io::CodedOutputStream unknown_fields_stream( &unknown_fields_output, false); - // @@protoc_insertion_point(parse_start:cockroach.roachpb.Intent) + // @@protoc_insertion_point(parse_start:cockroach.roachpb.LockUpdate) for (;;) { ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; @@ -4621,6 +5086,21 @@ bool Intent::MergePartialFromCodedStream( break; } + // .cockroach.storage.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::storage::concurrency::lock::Durability >(value)); + } else { + goto handle_unusual; + } + break; + } + default: { handle_unusual: if (tag == 0) { @@ -4633,17 +5113,17 @@ bool Intent::MergePartialFromCodedStream( } } success: - // @@protoc_insertion_point(parse_success:cockroach.roachpb.Intent) + // @@protoc_insertion_point(parse_success:cockroach.roachpb.LockUpdate) return true; failure: - // @@protoc_insertion_point(parse_failure:cockroach.roachpb.Intent) + // @@protoc_insertion_point(parse_failure:cockroach.roachpb.LockUpdate) return false; #undef DO_ } -void Intent::SerializeWithCachedSizes( +void LockUpdate::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:cockroach.roachpb.Intent) + // @@protoc_insertion_point(serialize_start:cockroach.roachpb.LockUpdate) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -4671,13 +5151,19 @@ void Intent::SerializeWithCachedSizes( output); } + // .cockroach.storage.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.Intent) + // @@protoc_insertion_point(serialize_end:cockroach.roachpb.LockUpdate) } -size_t Intent::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:cockroach.roachpb.Intent) +size_t LockUpdate::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:cockroach.roachpb.LockUpdate) size_t total_size = 0; total_size += (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()).size(); @@ -4710,18 +5196,24 @@ size_t Intent::ByteSizeLong() const { ::google::protobuf::internal::WireFormatLite::EnumSize(this->status()); } + // .cockroach.storage.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; } -void Intent::CheckTypeAndMergeFrom( +void LockUpdate::CheckTypeAndMergeFrom( const ::google::protobuf::MessageLite& from) { - MergeFrom(*::google::protobuf::down_cast(&from)); + MergeFrom(*::google::protobuf::down_cast(&from)); } -void Intent::MergeFrom(const Intent& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:cockroach.roachpb.Intent) +void LockUpdate::MergeFrom(const LockUpdate& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:cockroach.roachpb.LockUpdate) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; @@ -4737,34 +5229,38 @@ void Intent::MergeFrom(const Intent& from) { if (from.status() != 0) { set_status(from.status()); } + if (from.durability() != 0) { + set_durability(from.durability()); + } } -void Intent::CopyFrom(const Intent& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:cockroach.roachpb.Intent) +void LockUpdate::CopyFrom(const LockUpdate& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:cockroach.roachpb.LockUpdate) if (&from == this) return; Clear(); MergeFrom(from); } -bool Intent::IsInitialized() const { +bool LockUpdate::IsInitialized() const { return true; } -void Intent::Swap(Intent* other) { +void LockUpdate::Swap(LockUpdate* other) { if (other == this) return; InternalSwap(other); } -void Intent::InternalSwap(Intent* other) { +void LockUpdate::InternalSwap(LockUpdate* other) { using std::swap; CastToBase(&ignored_seqnums_)->InternalSwap(CastToBase(&other->ignored_seqnums_)); swap(span_, other->span_); swap(txn_, other->txn_); swap(status_, other->status_); + swap(durability_, other->durability_); _internal_metadata_.Swap(&other->_internal_metadata_); } -::std::string Intent::GetTypeName() const { - return "cockroach.roachpb.Intent"; +::std::string LockUpdate::GetTypeName() const { + return "cockroach.roachpb.LockUpdate"; } @@ -6331,9 +6827,15 @@ template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::cockroach::roachpb::Transaction* template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::cockroach::roachpb::TransactionRecord* Arena::CreateMaybeMessage< ::cockroach::roachpb::TransactionRecord >(Arena* arena) { return Arena::CreateInternal< ::cockroach::roachpb::TransactionRecord >(arena); } +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::cockroach::roachpb::Intent_SingleKeySpan* Arena::CreateMaybeMessage< ::cockroach::roachpb::Intent_SingleKeySpan >(Arena* arena) { + return Arena::CreateInternal< ::cockroach::roachpb::Intent_SingleKeySpan >(arena); +} 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::LockUpdate* Arena::CreateMaybeMessage< ::cockroach::roachpb::LockUpdate >(Arena* arena) { + return Arena::CreateInternal< ::cockroach::roachpb::LockUpdate >(arena); +} template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::cockroach::roachpb::SequencedWrite* Arena::CreateMaybeMessage< ::cockroach::roachpb::SequencedWrite >(Arena* arena) { return Arena::CreateInternal< ::cockroach::roachpb::SequencedWrite >(arena); } diff --git a/c-deps/libroach/protos/roachpb/data.pb.h b/c-deps/libroach/protos/roachpb/data.pb.h index 020e625ce091..84aefc3ac4e2 100644 --- a/c-deps/libroach/protos/roachpb/data.pb.h +++ b/c-deps/libroach/protos/roachpb/data.pb.h @@ -31,6 +31,7 @@ #include // IWYU pragma: export #include #include "roachpb/metadata.pb.h" +#include "storage/concurrency/lock/locking.pb.h" #include "storage/engine/enginepb/mvcc.pb.h" #include "storage/engine/enginepb/mvcc3.pb.h" #include "util/hlc/timestamp.pb.h" @@ -42,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[19]; + static const ::google::protobuf::internal::ParseTable schema[21]; static const ::google::protobuf::internal::FieldMetadata field_metadata[]; static const ::google::protobuf::internal::SerializationTable serialization_table[]; static const ::google::protobuf::uint32 offsets[]; @@ -59,6 +60,9 @@ extern ChangeReplicasTriggerDefaultTypeInternal _ChangeReplicasTrigger_default_i class Intent; class IntentDefaultTypeInternal; extern IntentDefaultTypeInternal _Intent_default_instance_; +class Intent_SingleKeySpan; +class Intent_SingleKeySpanDefaultTypeInternal; +extern Intent_SingleKeySpanDefaultTypeInternal _Intent_SingleKeySpan_default_instance_; class InternalCommitTrigger; class InternalCommitTriggerDefaultTypeInternal; extern InternalCommitTriggerDefaultTypeInternal _InternalCommitTrigger_default_instance_; @@ -74,6 +78,9 @@ extern LeafTxnInputStateDefaultTypeInternal _LeafTxnInputState_default_instance_ class Lease; class LeaseDefaultTypeInternal; extern LeaseDefaultTypeInternal _Lease_default_instance_; +class LockUpdate; +class LockUpdateDefaultTypeInternal; +extern LockUpdateDefaultTypeInternal _LockUpdate_default_instance_; class MergeTrigger; class MergeTriggerDefaultTypeInternal; extern MergeTriggerDefaultTypeInternal _MergeTrigger_default_instance_; @@ -114,11 +121,13 @@ namespace protobuf { template<> ::cockroach::roachpb::AbortSpanEntry* Arena::CreateMaybeMessage<::cockroach::roachpb::AbortSpanEntry>(Arena*); template<> ::cockroach::roachpb::ChangeReplicasTrigger* Arena::CreateMaybeMessage<::cockroach::roachpb::ChangeReplicasTrigger>(Arena*); template<> ::cockroach::roachpb::Intent* Arena::CreateMaybeMessage<::cockroach::roachpb::Intent>(Arena*); +template<> ::cockroach::roachpb::Intent_SingleKeySpan* Arena::CreateMaybeMessage<::cockroach::roachpb::Intent_SingleKeySpan>(Arena*); template<> ::cockroach::roachpb::InternalCommitTrigger* Arena::CreateMaybeMessage<::cockroach::roachpb::InternalCommitTrigger>(Arena*); template<> ::cockroach::roachpb::KeyValue* Arena::CreateMaybeMessage<::cockroach::roachpb::KeyValue>(Arena*); 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::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*); template<> ::cockroach::roachpb::ObservedTimestamp* Arena::CreateMaybeMessage<::cockroach::roachpb::ObservedTimestamp>(Arena*); @@ -1984,6 +1993,114 @@ class TransactionRecord : public ::google::protobuf::MessageLite /* @@protoc_ins }; // ------------------------------------------------------------------- +class Intent_SingleKeySpan : public ::google::protobuf::MessageLite /* @@protoc_insertion_point(class_definition:cockroach.roachpb.Intent.SingleKeySpan) */ { + public: + Intent_SingleKeySpan(); + virtual ~Intent_SingleKeySpan(); + + Intent_SingleKeySpan(const Intent_SingleKeySpan& from); + + inline Intent_SingleKeySpan& operator=(const Intent_SingleKeySpan& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Intent_SingleKeySpan(Intent_SingleKeySpan&& from) noexcept + : Intent_SingleKeySpan() { + *this = ::std::move(from); + } + + inline Intent_SingleKeySpan& operator=(Intent_SingleKeySpan&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const Intent_SingleKeySpan& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Intent_SingleKeySpan* internal_default_instance() { + return reinterpret_cast( + &_Intent_SingleKeySpan_default_instance_); + } + static constexpr int kIndexInFileMessages = + 13; + + void Swap(Intent_SingleKeySpan* other); + friend void swap(Intent_SingleKeySpan& a, Intent_SingleKeySpan& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Intent_SingleKeySpan* New() const final { + return CreateMaybeMessage(NULL); + } + + Intent_SingleKeySpan* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from) + final; + void CopyFrom(const Intent_SingleKeySpan& from); + void MergeFrom(const Intent_SingleKeySpan& 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(Intent_SingleKeySpan* 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 ------------------------------------------------------- + + void clear_key(); + static const int kKeyFieldNumber = 3; + const ::std::string& key() const; + void set_key(const ::std::string& value); + #if LANG_CXX11 + void set_key(::std::string&& value); + #endif + void set_key(const char* value); + void set_key(const void* value, size_t size); + ::std::string* mutable_key(); + ::std::string* release_key(); + void set_allocated_key(::std::string* key); + + // @@protoc_insertion_point(class_scope:cockroach.roachpb.Intent.SingleKeySpan) + private: + + ::google::protobuf::internal::InternalMetadataWithArenaLite _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr key_; + 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(); @@ -2018,7 +2135,7 @@ class Intent : public ::google::protobuf::MessageLite /* @@protoc_insertion_poin &_Intent_default_instance_); } static constexpr int kIndexInFileMessages = - 13; + 14; void Swap(Intent* other); friend void swap(Intent& a, Intent& b) { @@ -2067,6 +2184,126 @@ class Intent : public ::google::protobuf::MessageLite /* @@protoc_insertion_poin // nested types ---------------------------------------------------- + typedef Intent_SingleKeySpan SingleKeySpan; + + // accessors ------------------------------------------------------- + + bool has_single_key_span() const; + void clear_single_key_span(); + static const int kSingleKeySpanFieldNumber = 1; + private: + const ::cockroach::roachpb::Intent_SingleKeySpan& _internal_single_key_span() const; + public: + const ::cockroach::roachpb::Intent_SingleKeySpan& single_key_span() const; + ::cockroach::roachpb::Intent_SingleKeySpan* release_single_key_span(); + ::cockroach::roachpb::Intent_SingleKeySpan* mutable_single_key_span(); + void set_allocated_single_key_span(::cockroach::roachpb::Intent_SingleKeySpan* single_key_span); + + bool has_txn() const; + void clear_txn(); + static const int kTxnFieldNumber = 2; + private: + const ::cockroach::storage::engine::enginepb::TxnMeta& _internal_txn() const; + public: + const ::cockroach::storage::engine::enginepb::TxnMeta& txn() const; + ::cockroach::storage::engine::enginepb::TxnMeta* release_txn(); + ::cockroach::storage::engine::enginepb::TxnMeta* mutable_txn(); + void set_allocated_txn(::cockroach::storage::engine::enginepb::TxnMeta* txn); + + // @@protoc_insertion_point(class_scope:cockroach.roachpb.Intent) + private: + + ::google::protobuf::internal::InternalMetadataWithArenaLite _internal_metadata_; + ::cockroach::roachpb::Intent_SingleKeySpan* single_key_span_; + ::cockroach::storage::engine::enginepb::TxnMeta* txn_; + 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(); + virtual ~LockUpdate(); + + LockUpdate(const LockUpdate& from); + + inline LockUpdate& operator=(const LockUpdate& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LockUpdate(LockUpdate&& from) noexcept + : LockUpdate() { + *this = ::std::move(from); + } + + inline LockUpdate& operator=(LockUpdate&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const LockUpdate& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LockUpdate* internal_default_instance() { + return reinterpret_cast( + &_LockUpdate_default_instance_); + } + static constexpr int kIndexInFileMessages = + 15; + + void Swap(LockUpdate* other); + friend void swap(LockUpdate& a, LockUpdate& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LockUpdate* New() const final { + return CreateMaybeMessage(NULL); + } + + LockUpdate* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from) + final; + void CopyFrom(const LockUpdate& from); + void MergeFrom(const LockUpdate& 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(LockUpdate* 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 ignored_seqnums_size() const; @@ -2108,7 +2345,13 @@ class Intent : public ::google::protobuf::MessageLite /* @@protoc_insertion_poin ::cockroach::roachpb::TransactionStatus status() const; void set_status(::cockroach::roachpb::TransactionStatus value); - // @@protoc_insertion_point(class_scope:cockroach.roachpb.Intent) + // .cockroach.storage.concurrency.lock.Durability durability = 5; + void clear_durability(); + static const int kDurabilityFieldNumber = 5; + ::cockroach::storage::concurrency::lock::Durability durability() const; + void set_durability(::cockroach::storage::concurrency::lock::Durability value); + + // @@protoc_insertion_point(class_scope:cockroach.roachpb.LockUpdate) private: ::google::protobuf::internal::InternalMetadataWithArenaLite _internal_metadata_; @@ -2116,6 +2359,7 @@ class Intent : public ::google::protobuf::MessageLite /* @@protoc_insertion_poin ::cockroach::roachpb::Span* span_; ::cockroach::storage::engine::enginepb::TxnMeta* txn_; int status_; + int durability_; mutable ::google::protobuf::internal::CachedSize _cached_size_; friend struct ::protobuf_roachpb_2fdata_2eproto::TableStruct; }; @@ -2155,7 +2399,7 @@ class SequencedWrite : public ::google::protobuf::MessageLite /* @@protoc_insert &_SequencedWrite_default_instance_); } static constexpr int kIndexInFileMessages = - 14; + 16; void Swap(SequencedWrite* other); friend void swap(SequencedWrite& a, SequencedWrite& b) { @@ -2269,7 +2513,7 @@ class Lease : public ::google::protobuf::MessageLite /* @@protoc_insertion_point &_Lease_default_instance_); } static constexpr int kIndexInFileMessages = - 15; + 17; void Swap(Lease* other); friend void swap(Lease& a, Lease& b) { @@ -2436,7 +2680,7 @@ class AbortSpanEntry : public ::google::protobuf::MessageLite /* @@protoc_insert &_AbortSpanEntry_default_instance_); } static constexpr int kIndexInFileMessages = - 16; + 18; void Swap(AbortSpanEntry* other); friend void swap(AbortSpanEntry& a, AbortSpanEntry& b) { @@ -2562,7 +2806,7 @@ class LeafTxnInputState : public ::google::protobuf::MessageLite /* @@protoc_ins &_LeafTxnInputState_default_instance_); } static constexpr int kIndexInFileMessages = - 17; + 19; void Swap(LeafTxnInputState* other); friend void swap(LeafTxnInputState& a, LeafTxnInputState& b) { @@ -2700,7 +2944,7 @@ class LeafTxnFinalState : public ::google::protobuf::MessageLite /* @@protoc_ins &_LeafTxnFinalState_default_instance_); } static constexpr int kIndexInFileMessages = - 18; + 20; void Swap(LeafTxnFinalState* other); friend void swap(LeafTxnFinalState& a, LeafTxnFinalState& b) { @@ -4806,43 +5050,203 @@ TransactionRecord::ignored_seqnums() const { // ------------------------------------------------------------------- +// Intent_SingleKeySpan + +inline void Intent_SingleKeySpan::clear_key() { + key_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& Intent_SingleKeySpan::key() const { + // @@protoc_insertion_point(field_get:cockroach.roachpb.Intent.SingleKeySpan.key) + return key_.GetNoArena(); +} +inline void Intent_SingleKeySpan::set_key(const ::std::string& value) { + + key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:cockroach.roachpb.Intent.SingleKeySpan.key) +} +#if LANG_CXX11 +inline void Intent_SingleKeySpan::set_key(::std::string&& value) { + + key_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:cockroach.roachpb.Intent.SingleKeySpan.key) +} +#endif +inline void Intent_SingleKeySpan::set_key(const char* value) { + GOOGLE_DCHECK(value != NULL); + + key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:cockroach.roachpb.Intent.SingleKeySpan.key) +} +inline void Intent_SingleKeySpan::set_key(const void* value, size_t size) { + + key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:cockroach.roachpb.Intent.SingleKeySpan.key) +} +inline ::std::string* Intent_SingleKeySpan::mutable_key() { + + // @@protoc_insertion_point(field_mutable:cockroach.roachpb.Intent.SingleKeySpan.key) + return key_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Intent_SingleKeySpan::release_key() { + // @@protoc_insertion_point(field_release:cockroach.roachpb.Intent.SingleKeySpan.key) + + return key_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Intent_SingleKeySpan::set_allocated_key(::std::string* key) { + if (key != NULL) { + + } else { + + } + key_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), key); + // @@protoc_insertion_point(field_set_allocated:cockroach.roachpb.Intent.SingleKeySpan.key) +} + +// ------------------------------------------------------------------- + // Intent -inline bool Intent::has_span() const { +inline bool Intent::has_single_key_span() const { + return this != internal_default_instance() && single_key_span_ != NULL; +} +inline void Intent::clear_single_key_span() { + if (GetArenaNoVirtual() == NULL && single_key_span_ != NULL) { + delete single_key_span_; + } + single_key_span_ = NULL; +} +inline const ::cockroach::roachpb::Intent_SingleKeySpan& Intent::_internal_single_key_span() const { + return *single_key_span_; +} +inline const ::cockroach::roachpb::Intent_SingleKeySpan& Intent::single_key_span() const { + const ::cockroach::roachpb::Intent_SingleKeySpan* p = single_key_span_; + // @@protoc_insertion_point(field_get:cockroach.roachpb.Intent.single_key_span) + return p != NULL ? *p : *reinterpret_cast( + &::cockroach::roachpb::_Intent_SingleKeySpan_default_instance_); +} +inline ::cockroach::roachpb::Intent_SingleKeySpan* Intent::release_single_key_span() { + // @@protoc_insertion_point(field_release:cockroach.roachpb.Intent.single_key_span) + + ::cockroach::roachpb::Intent_SingleKeySpan* temp = single_key_span_; + single_key_span_ = NULL; + return temp; +} +inline ::cockroach::roachpb::Intent_SingleKeySpan* Intent::mutable_single_key_span() { + + if (single_key_span_ == NULL) { + auto* p = CreateMaybeMessage<::cockroach::roachpb::Intent_SingleKeySpan>(GetArenaNoVirtual()); + single_key_span_ = p; + } + // @@protoc_insertion_point(field_mutable:cockroach.roachpb.Intent.single_key_span) + return single_key_span_; +} +inline void Intent::set_allocated_single_key_span(::cockroach::roachpb::Intent_SingleKeySpan* single_key_span) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete single_key_span_; + } + if (single_key_span) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + single_key_span = ::google::protobuf::internal::GetOwnedMessage( + message_arena, single_key_span, submessage_arena); + } + + } else { + + } + single_key_span_ = single_key_span; + // @@protoc_insertion_point(field_set_allocated:cockroach.roachpb.Intent.single_key_span) +} + +inline bool Intent::has_txn() const { + return this != internal_default_instance() && txn_ != NULL; +} +inline const ::cockroach::storage::engine::enginepb::TxnMeta& Intent::_internal_txn() const { + return *txn_; +} +inline const ::cockroach::storage::engine::enginepb::TxnMeta& Intent::txn() const { + const ::cockroach::storage::engine::enginepb::TxnMeta* p = txn_; + // @@protoc_insertion_point(field_get:cockroach.roachpb.Intent.txn) + return p != NULL ? *p : *reinterpret_cast( + &::cockroach::storage::engine::enginepb::_TxnMeta_default_instance_); +} +inline ::cockroach::storage::engine::enginepb::TxnMeta* Intent::release_txn() { + // @@protoc_insertion_point(field_release:cockroach.roachpb.Intent.txn) + + ::cockroach::storage::engine::enginepb::TxnMeta* temp = txn_; + txn_ = NULL; + return temp; +} +inline ::cockroach::storage::engine::enginepb::TxnMeta* Intent::mutable_txn() { + + if (txn_ == NULL) { + auto* p = CreateMaybeMessage<::cockroach::storage::engine::enginepb::TxnMeta>(GetArenaNoVirtual()); + txn_ = p; + } + // @@protoc_insertion_point(field_mutable:cockroach.roachpb.Intent.txn) + return txn_; +} +inline void Intent::set_allocated_txn(::cockroach::storage::engine::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.Intent.txn) +} + +// ------------------------------------------------------------------- + +// LockUpdate + +inline bool LockUpdate::has_span() const { return this != internal_default_instance() && span_ != NULL; } -inline void Intent::clear_span() { +inline void LockUpdate::clear_span() { if (GetArenaNoVirtual() == NULL && span_ != NULL) { delete span_; } span_ = NULL; } -inline const ::cockroach::roachpb::Span& Intent::_internal_span() const { +inline const ::cockroach::roachpb::Span& LockUpdate::_internal_span() const { return *span_; } -inline const ::cockroach::roachpb::Span& Intent::span() const { +inline const ::cockroach::roachpb::Span& LockUpdate::span() const { const ::cockroach::roachpb::Span* p = span_; - // @@protoc_insertion_point(field_get:cockroach.roachpb.Intent.span) + // @@protoc_insertion_point(field_get:cockroach.roachpb.LockUpdate.span) return p != NULL ? *p : *reinterpret_cast( &::cockroach::roachpb::_Span_default_instance_); } -inline ::cockroach::roachpb::Span* Intent::release_span() { - // @@protoc_insertion_point(field_release:cockroach.roachpb.Intent.span) +inline ::cockroach::roachpb::Span* LockUpdate::release_span() { + // @@protoc_insertion_point(field_release:cockroach.roachpb.LockUpdate.span) ::cockroach::roachpb::Span* temp = span_; span_ = NULL; return temp; } -inline ::cockroach::roachpb::Span* Intent::mutable_span() { +inline ::cockroach::roachpb::Span* LockUpdate::mutable_span() { if (span_ == NULL) { auto* p = CreateMaybeMessage<::cockroach::roachpb::Span>(GetArenaNoVirtual()); span_ = p; } - // @@protoc_insertion_point(field_mutable:cockroach.roachpb.Intent.span) + // @@protoc_insertion_point(field_mutable:cockroach.roachpb.LockUpdate.span) return span_; } -inline void Intent::set_allocated_span(::cockroach::roachpb::Span* span) { +inline void LockUpdate::set_allocated_span(::cockroach::roachpb::Span* span) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); if (message_arena == NULL) { delete span_; @@ -4858,38 +5262,38 @@ inline void Intent::set_allocated_span(::cockroach::roachpb::Span* span) { } span_ = span; - // @@protoc_insertion_point(field_set_allocated:cockroach.roachpb.Intent.span) + // @@protoc_insertion_point(field_set_allocated:cockroach.roachpb.LockUpdate.span) } -inline bool Intent::has_txn() const { +inline bool LockUpdate::has_txn() const { return this != internal_default_instance() && txn_ != NULL; } -inline const ::cockroach::storage::engine::enginepb::TxnMeta& Intent::_internal_txn() const { +inline const ::cockroach::storage::engine::enginepb::TxnMeta& LockUpdate::_internal_txn() const { return *txn_; } -inline const ::cockroach::storage::engine::enginepb::TxnMeta& Intent::txn() const { +inline const ::cockroach::storage::engine::enginepb::TxnMeta& LockUpdate::txn() const { const ::cockroach::storage::engine::enginepb::TxnMeta* p = txn_; - // @@protoc_insertion_point(field_get:cockroach.roachpb.Intent.txn) + // @@protoc_insertion_point(field_get:cockroach.roachpb.LockUpdate.txn) return p != NULL ? *p : *reinterpret_cast( &::cockroach::storage::engine::enginepb::_TxnMeta_default_instance_); } -inline ::cockroach::storage::engine::enginepb::TxnMeta* Intent::release_txn() { - // @@protoc_insertion_point(field_release:cockroach.roachpb.Intent.txn) +inline ::cockroach::storage::engine::enginepb::TxnMeta* LockUpdate::release_txn() { + // @@protoc_insertion_point(field_release:cockroach.roachpb.LockUpdate.txn) ::cockroach::storage::engine::enginepb::TxnMeta* temp = txn_; txn_ = NULL; return temp; } -inline ::cockroach::storage::engine::enginepb::TxnMeta* Intent::mutable_txn() { +inline ::cockroach::storage::engine::enginepb::TxnMeta* LockUpdate::mutable_txn() { if (txn_ == NULL) { auto* p = CreateMaybeMessage<::cockroach::storage::engine::enginepb::TxnMeta>(GetArenaNoVirtual()); txn_ = p; } - // @@protoc_insertion_point(field_mutable:cockroach.roachpb.Intent.txn) + // @@protoc_insertion_point(field_mutable:cockroach.roachpb.LockUpdate.txn) return txn_; } -inline void Intent::set_allocated_txn(::cockroach::storage::engine::enginepb::TxnMeta* txn) { +inline void LockUpdate::set_allocated_txn(::cockroach::storage::engine::enginepb::TxnMeta* txn) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); if (message_arena == NULL) { delete reinterpret_cast< ::google::protobuf::MessageLite*>(txn_); @@ -4905,49 +5309,63 @@ inline void Intent::set_allocated_txn(::cockroach::storage::engine::enginepb::Tx } txn_ = txn; - // @@protoc_insertion_point(field_set_allocated:cockroach.roachpb.Intent.txn) + // @@protoc_insertion_point(field_set_allocated:cockroach.roachpb.LockUpdate.txn) } // .cockroach.roachpb.TransactionStatus status = 3; -inline void Intent::clear_status() { +inline void LockUpdate::clear_status() { status_ = 0; } -inline ::cockroach::roachpb::TransactionStatus Intent::status() const { - // @@protoc_insertion_point(field_get:cockroach.roachpb.Intent.status) +inline ::cockroach::roachpb::TransactionStatus LockUpdate::status() const { + // @@protoc_insertion_point(field_get:cockroach.roachpb.LockUpdate.status) return static_cast< ::cockroach::roachpb::TransactionStatus >(status_); } -inline void Intent::set_status(::cockroach::roachpb::TransactionStatus value) { +inline void LockUpdate::set_status(::cockroach::roachpb::TransactionStatus value) { status_ = value; - // @@protoc_insertion_point(field_set:cockroach.roachpb.Intent.status) + // @@protoc_insertion_point(field_set:cockroach.roachpb.LockUpdate.status) } -inline int Intent::ignored_seqnums_size() const { +inline int LockUpdate::ignored_seqnums_size() const { return ignored_seqnums_.size(); } -inline ::cockroach::storage::engine::enginepb::IgnoredSeqNumRange* Intent::mutable_ignored_seqnums(int index) { - // @@protoc_insertion_point(field_mutable:cockroach.roachpb.Intent.ignored_seqnums) +inline ::cockroach::storage::engine::enginepb::IgnoredSeqNumRange* LockUpdate::mutable_ignored_seqnums(int index) { + // @@protoc_insertion_point(field_mutable:cockroach.roachpb.LockUpdate.ignored_seqnums) return ignored_seqnums_.Mutable(index); } inline ::google::protobuf::RepeatedPtrField< ::cockroach::storage::engine::enginepb::IgnoredSeqNumRange >* -Intent::mutable_ignored_seqnums() { - // @@protoc_insertion_point(field_mutable_list:cockroach.roachpb.Intent.ignored_seqnums) +LockUpdate::mutable_ignored_seqnums() { + // @@protoc_insertion_point(field_mutable_list:cockroach.roachpb.LockUpdate.ignored_seqnums) return &ignored_seqnums_; } -inline const ::cockroach::storage::engine::enginepb::IgnoredSeqNumRange& Intent::ignored_seqnums(int index) const { - // @@protoc_insertion_point(field_get:cockroach.roachpb.Intent.ignored_seqnums) +inline const ::cockroach::storage::engine::enginepb::IgnoredSeqNumRange& LockUpdate::ignored_seqnums(int index) const { + // @@protoc_insertion_point(field_get:cockroach.roachpb.LockUpdate.ignored_seqnums) return ignored_seqnums_.Get(index); } -inline ::cockroach::storage::engine::enginepb::IgnoredSeqNumRange* Intent::add_ignored_seqnums() { - // @@protoc_insertion_point(field_add:cockroach.roachpb.Intent.ignored_seqnums) +inline ::cockroach::storage::engine::enginepb::IgnoredSeqNumRange* LockUpdate::add_ignored_seqnums() { + // @@protoc_insertion_point(field_add:cockroach.roachpb.LockUpdate.ignored_seqnums) return ignored_seqnums_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::cockroach::storage::engine::enginepb::IgnoredSeqNumRange >& -Intent::ignored_seqnums() const { - // @@protoc_insertion_point(field_list:cockroach.roachpb.Intent.ignored_seqnums) +LockUpdate::ignored_seqnums() const { + // @@protoc_insertion_point(field_list:cockroach.roachpb.LockUpdate.ignored_seqnums) return ignored_seqnums_; } +// .cockroach.storage.concurrency.lock.Durability durability = 5; +inline void LockUpdate::clear_durability() { + durability_ = 0; +} +inline ::cockroach::storage::concurrency::lock::Durability LockUpdate::durability() const { + // @@protoc_insertion_point(field_get:cockroach.roachpb.LockUpdate.durability) + return static_cast< ::cockroach::storage::concurrency::lock::Durability >(durability_); +} +inline void LockUpdate::set_durability(::cockroach::storage::concurrency::lock::Durability value) { + + durability_ = value; + // @@protoc_insertion_point(field_set:cockroach.roachpb.LockUpdate.durability) +} + // ------------------------------------------------------------------- // SequencedWrite @@ -5679,6 +6097,10 @@ inline void LeafTxnFinalState::set_refresh_invalid(bool value) { // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/c-deps/libroach/protos/roachpb/errors.pb.cc b/c-deps/libroach/protos/roachpb/errors.pb.cc index 27668fb8333f..1580b7bfc59c 100644 --- a/c-deps/libroach/protos/roachpb/errors.pb.cc +++ b/c-deps/libroach/protos/roachpb/errors.pb.cc @@ -19,8 +19,8 @@ namespace protobuf_roachpb_2fdata_2eproto { 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_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<2> scc_info_Lease; -extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fdata_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_Intent; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fdata_2eproto ::google::protobuf::internal::SCCInfo<6> scc_info_Transaction; } // namespace protobuf_roachpb_2fdata_2eproto namespace protobuf_roachpb_2ferrors_2eproto { diff --git a/c-deps/libroach/protos/storage/concurrency/lock/locking.pb.cc b/c-deps/libroach/protos/storage/concurrency/lock/locking.pb.cc new file mode 100644 index 000000000000..133f5c29278b --- /dev/null +++ b/c-deps/libroach/protos/storage/concurrency/lock/locking.pb.cc @@ -0,0 +1,68 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: storage/concurrency/lock/locking.proto + +#include "storage/concurrency/lock/locking.pb.h" + +#include + +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace cockroach { +namespace storage { +namespace concurrency { +namespace lock { +} // namespace lock +} // namespace concurrency +} // namespace storage +} // namespace cockroach +namespace protobuf_storage_2fconcurrency_2flock_2flocking_2eproto { +void InitDefaults() { +} + +} // namespace protobuf_storage_2fconcurrency_2flock_2flocking_2eproto +namespace cockroach { +namespace storage { +namespace concurrency { +namespace lock { +bool Strength_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +bool Durability_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace lock +} // namespace concurrency +} // namespace storage +} // namespace cockroach +namespace google { +namespace protobuf { +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/c-deps/libroach/protos/storage/concurrency/lock/locking.pb.h b/c-deps/libroach/protos/storage/concurrency/lock/locking.pb.h new file mode 100644 index 000000000000..a6ac1de96799 --- /dev/null +++ b/c-deps/libroach/protos/storage/concurrency/lock/locking.pb.h @@ -0,0 +1,117 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: storage/concurrency/lock/locking.proto + +#ifndef PROTOBUF_INCLUDED_storage_2fconcurrency_2flock_2flocking_2eproto +#define PROTOBUF_INCLUDED_storage_2fconcurrency_2flock_2flocking_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_storage_2fconcurrency_2flock_2flocking_2eproto + +namespace protobuf_storage_2fconcurrency_2flock_2flocking_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +} // namespace protobuf_storage_2fconcurrency_2flock_2flocking_2eproto +namespace cockroach { +namespace storage { +namespace concurrency { +namespace lock { +} // namespace lock +} // namespace concurrency +} // namespace storage +} // namespace cockroach +namespace cockroach { +namespace storage { +namespace concurrency { +namespace lock { + +enum Strength { + None = 0, + Shared = 1, + Upgrade = 2, + Exclusive = 3, + Strength_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + Strength_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool Strength_IsValid(int value); +const Strength Strength_MIN = None; +const Strength Strength_MAX = Exclusive; +const int Strength_ARRAYSIZE = Strength_MAX + 1; + +enum Durability { + Replicated = 0, + Unreplicated = 1, + Durability_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + Durability_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool Durability_IsValid(int value); +const Durability Durability_MIN = Replicated; +const Durability Durability_MAX = Unreplicated; +const int Durability_ARRAYSIZE = Durability_MAX + 1; + +// =================================================================== + + +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace lock +} // namespace concurrency +} // namespace storage +} // namespace cockroach + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::cockroach::storage::concurrency::lock::Strength> : ::std::true_type {}; +template <> struct is_proto_enum< ::cockroach::storage::concurrency::lock::Durability> : ::std::true_type {}; + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_storage_2fconcurrency_2flock_2flocking_2eproto diff --git a/pkg/cli/debug.go b/pkg/cli/debug.go index 32d3e59cfb6e..df8221e3d5d1 100644 --- a/pkg/cli/debug.go +++ b/pkg/cli/debug.go @@ -38,6 +38,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/server/status/statuspb" "github.com/cockroachdb/cockroach/pkg/sql/execinfrapb" "github.com/cockroachdb/cockroach/pkg/storage" + "github.com/cockroachdb/cockroach/pkg/storage/concurrency/lock" "github.com/cockroachdb/cockroach/pkg/storage/engine" "github.com/cockroachdb/cockroach/pkg/storage/engine/enginepb" "github.com/cockroachdb/cockroach/pkg/storage/gc" @@ -567,7 +568,7 @@ func runDebugGCCmd(cmd *cobra.Command, args []string) error { now, thresh, policy, gc.NoopGCer{}, func(_ context.Context, _ []roachpb.Intent) error { return nil }, - func(_ context.Context, _ *roachpb.Transaction, _ []roachpb.Intent) error { return nil }, + func(_ context.Context, _ *roachpb.Transaction, _ []roachpb.LockUpdate) error { return nil }, ) if err != nil { return err @@ -1131,8 +1132,13 @@ func removeDeadReplicas( if err := engine.MVCCDelete(ctx, batch, &ms, txnKey, hlc.Timestamp{}, nil); err != nil { return nil, err } - intent.Status = roachpb.ABORTED - if _, err := engine.MVCCResolveWriteIntent(ctx, batch, &ms, intent); err != nil { + update := roachpb.LockUpdate{ + Span: roachpb.Span{Key: intent.Key}, + Txn: intent.Txn, + Status: roachpb.ABORTED, + Durability: lock.Replicated, + } + if _, err := engine.MVCCResolveWriteIntent(ctx, batch, &ms, update); err != nil { return nil, err } // With the intent resolved, we can try again. diff --git a/pkg/roachpb/api.go b/pkg/roachpb/api.go index 71a5d5f61f35..4103e6e5dae4 100644 --- a/pkg/roachpb/api.go +++ b/pkg/roachpb/api.go @@ -15,6 +15,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/cockroachdb/cockroach/pkg/storage/concurrency/lock" "github.com/cockroachdb/cockroach/pkg/util/protoutil" "github.com/pkg/errors" ) @@ -1272,23 +1273,26 @@ func (acrr *AdminChangeReplicasRequest) Changes() []ReplicationChange { return sl } -// AsIntent creates an intent corresponding to the given resolve intent request. -func (rir *ResolveIntentRequest) AsIntent() Intent { - return Intent{ +// AsLockUpdate creates a lock update message corresponding to the given resolve +// intent request. +func (rir *ResolveIntentRequest) AsLockUpdate() LockUpdate { + return LockUpdate{ Span: rir.Span(), Txn: rir.IntentTxn, Status: rir.Status, IgnoredSeqNums: rir.IgnoredSeqNums, + Durability: lock.Replicated, } } -// AsIntent creates an intent corresponding to the given resolve +// AsLockUpdate creates a lock update message corresponding to the given resolve // intent range request. -func (rirr *ResolveIntentRangeRequest) AsIntent() Intent { - return Intent{ +func (rirr *ResolveIntentRangeRequest) AsLockUpdate() LockUpdate { + return LockUpdate{ Span: rirr.Span(), Txn: rirr.IntentTxn, Status: rirr.Status, IgnoredSeqNums: rirr.IgnoredSeqNums, + Durability: lock.Replicated, } } diff --git a/pkg/roachpb/data.go b/pkg/roachpb/data.go index e2badfd1f05c..bd04a0fc14c8 100644 --- a/pkg/roachpb/data.go +++ b/pkg/roachpb/data.go @@ -27,6 +27,7 @@ import ( "time" "github.com/cockroachdb/apd" + "github.com/cockroachdb/cockroach/pkg/storage/concurrency/lock" "github.com/cockroachdb/cockroach/pkg/storage/engine/enginepb" "github.com/cockroachdb/cockroach/pkg/util" "github.com/cockroachdb/cockroach/pkg/util/bitarray" @@ -1782,17 +1783,57 @@ func (l *Lease) Equal(that interface{}) bool { return true } -// AsIntents takes a slice of spans and returns it as a slice of intents for -// the given transaction. -func AsIntents(spans []Span, txn *Transaction) []Intent { - ret := make([]Intent, len(spans)) +// MakeIntent makes an intent with the given txn and key. +// This is suitable for use when constructing WriteIntentError. +func MakeIntent(txn *enginepb.TxnMeta, key Key) Intent { + var i Intent + i.Key = key + i.Txn = *txn + return i +} + +// AsIntents takes a transaction and a slice of keys and +// returns it as a slice of intents. +func AsIntents(txn *enginepb.TxnMeta, keys []Key) []Intent { + ret := make([]Intent, len(keys)) + for i := range keys { + ret[i] = MakeIntent(txn, keys[i]) + } + 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) +} + +// 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 +} + +// 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 { + ret := make([]LockUpdate, len(spans)) for i := range spans { - ret[i] = Intent{Span: spans[i]} - ret[i].SetTxn(txn) + ret[i] = MakeLockUpdateWithDur(txn, spans[i], dur) } return ret } +// SetTxn updates the transaction details in the lock update. +func (u *LockUpdate) SetTxn(txn *Transaction) { + u.Txn = txn.TxnMeta + u.Status = txn.Status + u.IgnoredSeqNums = txn.IgnoredSeqNums +} + // EqualValue compares for equality. func (s Span) EqualValue(o Span) bool { return s.Key.Equal(o.Key) && s.EndKey.Equal(o.EndKey) @@ -2129,28 +2170,3 @@ func init() { enginepb.FormatBytesAsKey = func(k []byte) string { return Key(k).String() } enginepb.FormatBytesAsValue = func(v []byte) string { return Value{RawBytes: v}.PrettyPrint() } } - -// MakeIntent makes an intent from the given span and txn. -func MakeIntent(txn *Transaction, span Span) Intent { - intent := Intent{Span: span} - intent.SetTxn(txn) - return intent -} - -// MakePendingIntent makes an intent in the pending state with the -// given span and txn. This is suitable for use when constructing -// WriteIntentError. -func MakePendingIntent(txn *enginepb.TxnMeta, span Span) Intent { - return Intent{ - Span: span, - Txn: *txn, - Status: PENDING, - } -} - -// SetTxn updates the transaction details in the intent. -func (i *Intent) SetTxn(txn *Transaction) { - i.Txn = txn.TxnMeta - i.Status = txn.Status - i.IgnoredSeqNums = txn.IgnoredSeqNums -} diff --git a/pkg/roachpb/data.pb.go b/pkg/roachpb/data.pb.go index 18d4b5515f0d..24369b31bdc4 100644 --- a/pkg/roachpb/data.pb.go +++ b/pkg/roachpb/data.pb.go @@ -6,6 +6,7 @@ package roachpb import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" +import lock "github.com/cockroachdb/cockroach/pkg/storage/concurrency/lock" import enginepb "github.com/cockroachdb/cockroach/pkg/storage/engine/enginepb" import hlc "github.com/cockroachdb/cockroach/pkg/util/hlc" @@ -90,7 +91,7 @@ func (x ValueType) String() string { return proto.EnumName(ValueType_name, int32(x)) } func (ValueType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_data_1a440e049c0365d8, []int{0} + return fileDescriptor_data_21a9cff2ad2577a7, []int{0} } // ReplicaChangeType is a parameter of ChangeReplicasTrigger. @@ -114,7 +115,7 @@ func (x ReplicaChangeType) String() string { return proto.EnumName(ReplicaChangeType_name, int32(x)) } func (ReplicaChangeType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_data_1a440e049c0365d8, []int{1} + return fileDescriptor_data_21a9cff2ad2577a7, []int{1} } // TransactionStatus specifies possible states for a transaction. @@ -166,7 +167,7 @@ func (x TransactionStatus) String() string { return proto.EnumName(TransactionStatus_name, int32(x)) } func (TransactionStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_data_1a440e049c0365d8, []int{2} + return fileDescriptor_data_21a9cff2ad2577a7, []int{2} } // Span is a key range with an inclusive start Key and an exclusive end Key. @@ -183,7 +184,7 @@ type Span struct { func (m *Span) Reset() { *m = Span{} } func (*Span) ProtoMessage() {} func (*Span) Descriptor() ([]byte, []int) { - return fileDescriptor_data_1a440e049c0365d8, []int{0} + return fileDescriptor_data_21a9cff2ad2577a7, []int{0} } func (m *Span) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -235,7 +236,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_1a440e049c0365d8, []int{1} + return fileDescriptor_data_21a9cff2ad2577a7, []int{1} } func (m *Value) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -271,7 +272,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_1a440e049c0365d8, []int{2} + return fileDescriptor_data_21a9cff2ad2577a7, []int{2} } func (m *KeyValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -309,7 +310,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_1a440e049c0365d8, []int{3} + return fileDescriptor_data_21a9cff2ad2577a7, []int{3} } func (m *StoreIdent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -349,7 +350,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_1a440e049c0365d8, []int{4} + return fileDescriptor_data_21a9cff2ad2577a7, []int{4} } func (m *SplitTrigger) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -397,7 +398,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_1a440e049c0365d8, []int{5} + return fileDescriptor_data_21a9cff2ad2577a7, []int{5} } func (m *MergeTrigger) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -467,7 +468,7 @@ type ChangeReplicasTrigger struct { func (m *ChangeReplicasTrigger) Reset() { *m = ChangeReplicasTrigger{} } func (*ChangeReplicasTrigger) ProtoMessage() {} func (*ChangeReplicasTrigger) Descriptor() ([]byte, []int) { - return fileDescriptor_data_1a440e049c0365d8, []int{6} + return fileDescriptor_data_21a9cff2ad2577a7, []int{6} } func (m *ChangeReplicasTrigger) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -509,7 +510,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_1a440e049c0365d8, []int{7} + return fileDescriptor_data_21a9cff2ad2577a7, []int{7} } func (m *ModifiedSpanTrigger) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -555,7 +556,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_1a440e049c0365d8, []int{8} + return fileDescriptor_data_21a9cff2ad2577a7, []int{8} } func (m *StickyBitTrigger) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -594,7 +595,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_1a440e049c0365d8, []int{9} + return fileDescriptor_data_21a9cff2ad2577a7, []int{9} } func (m *InternalCommitTrigger) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -663,7 +664,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_1a440e049c0365d8, []int{10} + return fileDescriptor_data_21a9cff2ad2577a7, []int{10} } func (m *ObservedTimestamp) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -898,7 +899,7 @@ type Transaction struct { func (m *Transaction) Reset() { *m = Transaction{} } func (*Transaction) ProtoMessage() {} func (*Transaction) Descriptor() ([]byte, []int) { - return fileDescriptor_data_1a440e049c0365d8, []int{11} + return fileDescriptor_data_21a9cff2ad2577a7, []int{11} } func (m *Transaction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -949,7 +950,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_1a440e049c0365d8, []int{12} + return fileDescriptor_data_21a9cff2ad2577a7, []int{12} } func (m *TransactionRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -974,30 +975,22 @@ func (m *TransactionRecord) XXX_DiscardUnknown() { var xxx_messageInfo_TransactionRecord proto.InternalMessageInfo -// A Intent is a Span together with a Transaction metadata and its status. +// A Intent is a Span together with a Transaction metadata. Intents messages +// are used to reference persistent on-disk write intents. They are used on +// the return path of e.g. scans, to report the existence of a write intent +// on a key. // -// Intents are used for two separate purposes: -// - on the return path of e.g. scans, to report the existence of a -// write intent on a key; -// - as input argument to intent resolution, to pass the current txn status, -// timestamps and ignored seqnum ranges to the resolution algorithm. -// Only in the latter case are the TxnMeta, status and ignored seqnum -// ranges guaranteed to be consistent with the latest txn's state. -// -// Note: avoid constructing Intent directly; consider using -// MakeIntent() or MakeErrorIntent() instead. +// Note: avoid constructing Intent directly; consider using MakeIntent() instead. type Intent 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"` - 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"` + Intent_SingleKeySpan `protobuf:"bytes,1,opt,name=single_key_span,json=singleKeySpan,proto3,embedded=single_key_span" json:"single_key_span"` + Txn enginepb.TxnMeta `protobuf:"bytes,2,opt,name=txn,proto3" json:"txn"` } 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_1a440e049c0365d8, []int{13} + return fileDescriptor_data_21a9cff2ad2577a7, []int{13} } func (m *Intent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1022,6 +1015,85 @@ func (m *Intent) XXX_DiscardUnknown() { var xxx_messageInfo_Intent proto.InternalMessageInfo +// SingleKeySpan preseves wire compatibility with an earlier version of this +// proto which used a Span. An Intent never spans keys, so there was no need +// for this to contain an EndKey. +type Intent_SingleKeySpan struct { + // The start key of the key range. + Key Key `protobuf:"bytes,3,opt,name=key,proto3,casttype=Key" json:"key,omitempty"` +} + +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_21a9cff2ad2577a7, []int{13, 0} +} +func (m *Intent_SingleKeySpan) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Intent_SingleKeySpan) 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 *Intent_SingleKeySpan) XXX_Merge(src proto.Message) { + xxx_messageInfo_Intent_SingleKeySpan.Merge(dst, src) +} +func (m *Intent_SingleKeySpan) XXX_Size() int { + return m.Size() +} +func (m *Intent_SingleKeySpan) XXX_DiscardUnknown() { + xxx_messageInfo_Intent_SingleKeySpan.DiscardUnknown(m) +} + +var xxx_messageInfo_Intent_SingleKeySpan 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 +// argument to intent resolution, to pass the current txn status, timestamps and +// ignored seqnum ranges to the resolution algorithm. +type LockUpdate 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"` + 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.storage.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_21a9cff2ad2577a7, []int{14} +} +func (m *LockUpdate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LockUpdate) 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 *LockUpdate) XXX_Merge(src proto.Message) { + xxx_messageInfo_LockUpdate.Merge(dst, src) +} +func (m *LockUpdate) XXX_Size() int { + return m.Size() +} +func (m *LockUpdate) XXX_DiscardUnknown() { + xxx_messageInfo_LockUpdate.DiscardUnknown(m) +} + +var xxx_messageInfo_LockUpdate proto.InternalMessageInfo + // A SequencedWrite is a point write to a key with a certain sequence number. type SequencedWrite struct { // The key that the write was made at. @@ -1034,7 +1106,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_1a440e049c0365d8, []int{14} + return fileDescriptor_data_21a9cff2ad2577a7, []int{15} } func (m *SequencedWrite) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1098,7 +1170,7 @@ type Lease struct { func (m *Lease) Reset() { *m = Lease{} } func (*Lease) ProtoMessage() {} func (*Lease) Descriptor() ([]byte, []int) { - return fileDescriptor_data_1a440e049c0365d8, []int{15} + return fileDescriptor_data_21a9cff2ad2577a7, []int{16} } func (m *Lease) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1143,7 +1215,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_1a440e049c0365d8, []int{16} + return fileDescriptor_data_21a9cff2ad2577a7, []int{17} } func (m *AbortSpanEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1200,7 +1272,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_1a440e049c0365d8, []int{17} + return fileDescriptor_data_21a9cff2ad2577a7, []int{18} } func (m *LeafTxnInputState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1253,7 +1325,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_1a440e049c0365d8, []int{18} + return fileDescriptor_data_21a9cff2ad2577a7, []int{19} } func (m *LeafTxnFinalState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1293,6 +1365,8 @@ func init() { proto.RegisterType((*Transaction)(nil), "cockroach.roachpb.Transaction") 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((*LockUpdate)(nil), "cockroach.roachpb.LockUpdate") proto.RegisterType((*SequencedWrite)(nil), "cockroach.roachpb.SequencedWrite") proto.RegisterType((*Lease)(nil), "cockroach.roachpb.Lease") proto.RegisterType((*AbortSpanEntry)(nil), "cockroach.roachpb.AbortSpanEntry") @@ -1740,6 +1814,57 @@ func (this *Intent) Equal(that interface{}) bool { } else if this == nil { return false } + if !this.Intent_SingleKeySpan.Equal(&that1.Intent_SingleKeySpan) { + return false + } + if !this.Txn.Equal(&that1.Txn) { + return false + } + return true +} +func (this *Intent_SingleKeySpan) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Intent_SingleKeySpan) + if !ok { + that2, ok := that.(Intent_SingleKeySpan) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.Key, that1.Key) { + return false + } + return true +} +func (this *LockUpdate) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*LockUpdate) + if !ok { + that2, ok := that.(LockUpdate) + 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 } @@ -1757,6 +1882,9 @@ func (this *Intent) Equal(that interface{}) bool { return false } } + if this.Durability != that1.Durability { + return false + } return true } func (this *SequencedWrite) Equal(that interface{}) bool { @@ -2514,8 +2642,8 @@ func (m *Intent) MarshalTo(dAtA []byte) (int, error) { _ = l dAtA[i] = 0xa i++ - i = encodeVarintData(dAtA, i, uint64(m.Span.Size())) - n27, err := m.Span.MarshalTo(dAtA[i:]) + i = encodeVarintData(dAtA, i, uint64(m.Intent_SingleKeySpan.Size())) + n27, err := m.Intent_SingleKeySpan.MarshalTo(dAtA[i:]) if err != nil { return 0, err } @@ -2528,6 +2656,64 @@ func (m *Intent) MarshalTo(dAtA []byte) (int, error) { return 0, err } i += n28 + return i, nil +} + +func (m *Intent_SingleKeySpan) 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 *Intent_SingleKeySpan) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Key) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintData(dAtA, i, uint64(len(m.Key))) + i += copy(dAtA[i:], m.Key) + } + 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())) + n29, err := m.Span.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n29 + dAtA[i] = 0x12 + i++ + i = encodeVarintData(dAtA, i, uint64(m.Txn.Size())) + n30, err := m.Txn.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n30 if m.Status != 0 { dAtA[i] = 0x18 i++ @@ -2545,6 +2731,11 @@ func (m *Intent) 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 } @@ -2595,48 +2786,48 @@ func (m *Lease) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintData(dAtA, i, uint64(m.Start.Size())) - n29, err := m.Start.MarshalTo(dAtA[i:]) + n31, err := m.Start.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n29 + i += n31 if m.Expiration != nil { dAtA[i] = 0x12 i++ i = encodeVarintData(dAtA, i, uint64(m.Expiration.Size())) - n30, err := m.Expiration.MarshalTo(dAtA[i:]) + n32, err := m.Expiration.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n30 + i += n32 } dAtA[i] = 0x1a i++ i = encodeVarintData(dAtA, i, uint64(m.Replica.Size())) - n31, err := m.Replica.MarshalTo(dAtA[i:]) + n33, err := m.Replica.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n31 + i += n33 if m.DeprecatedStartStasis != nil { dAtA[i] = 0x22 i++ i = encodeVarintData(dAtA, i, uint64(m.DeprecatedStartStasis.Size())) - n32, err := m.DeprecatedStartStasis.MarshalTo(dAtA[i:]) + n34, err := m.DeprecatedStartStasis.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n32 + i += n34 } if m.ProposedTS != nil { dAtA[i] = 0x2a i++ i = encodeVarintData(dAtA, i, uint64(m.ProposedTS.Size())) - n33, err := m.ProposedTS.MarshalTo(dAtA[i:]) + n35, err := m.ProposedTS.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n33 + i += n35 } if m.Epoch != 0 { dAtA[i] = 0x30 @@ -2675,11 +2866,11 @@ func (m *AbortSpanEntry) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintData(dAtA, i, uint64(m.Timestamp.Size())) - n34, err := m.Timestamp.MarshalTo(dAtA[i:]) + n36, err := m.Timestamp.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n34 + i += n36 if m.Priority != 0 { dAtA[i] = 0x18 i++ @@ -2706,11 +2897,11 @@ func (m *LeafTxnInputState) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintData(dAtA, i, uint64(m.Txn.Size())) - n35, err := m.Txn.MarshalTo(dAtA[i:]) + n37, err := m.Txn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n35 + i += n37 if m.RefreshInvalid { dAtA[i] = 0x38 i++ @@ -2769,11 +2960,11 @@ func (m *LeafTxnFinalState) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintData(dAtA, i, uint64(m.Txn.Size())) - n36, err := m.Txn.MarshalTo(dAtA[i:]) + n38, err := m.Txn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n36 + i += n38 if m.DeprecatedCommandCount != 0 { dAtA[i] = 0x18 i++ @@ -3360,6 +3551,32 @@ func (m *TransactionRecord) Size() (n int) { } func (m *Intent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Intent_SingleKeySpan.Size() + n += 1 + l + sovData(uint64(l)) + l = m.Txn.Size() + n += 1 + l + sovData(uint64(l)) + return n +} + +func (m *Intent_SingleKeySpan) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovData(uint64(l)) + } + return n +} + +func (m *LockUpdate) Size() (n int) { if m == nil { return 0 } @@ -3378,6 +3595,9 @@ func (m *Intent) Size() (n int) { n += 1 + l + sovData(uint64(l)) } } + if m.Durability != 0 { + n += 1 + sovData(uint64(m.Durability)) + } return n } @@ -5644,6 +5864,197 @@ func (m *Intent) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: Intent: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Intent_SingleKeySpan", 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.Intent_SingleKeySpan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + 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 + 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 *Intent_SingleKeySpan) 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: SingleKeySpan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SingleKeySpan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowData + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthData + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + 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 *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 Span", wireType) @@ -5754,6 +6165,25 @@ func (m *Intent) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Durability", wireType) + } + m.Durability = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowData + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Durability |= (lock.Durability(b) & 0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipData(dAtA[iNdEx:]) @@ -6677,148 +7107,156 @@ var ( ErrIntOverflowData = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("roachpb/data.proto", fileDescriptor_data_1a440e049c0365d8) } - -var fileDescriptor_data_1a440e049c0365d8 = []byte{ - // 2234 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0x4d, 0x8c, 0x1b, 0x49, - 0x15, 0x9e, 0x76, 0xb7, 0xed, 0xf6, 0xb3, 0xc7, 0xd3, 0x53, 0xc9, 0x24, 0x4e, 0x56, 0xd8, 0xc1, - 0x8b, 0x20, 0x44, 0xbb, 0x1e, 0x91, 0xec, 0xae, 0x20, 0x42, 0x08, 0xff, 0x25, 0x69, 0x67, 0xec, - 0xc9, 0xb6, 0x3d, 0x59, 0x25, 0xcb, 0xaa, 0x69, 0x77, 0xd7, 0x78, 0x9a, 0xb8, 0xbb, 0x9d, 0xee, - 0xf6, 0x64, 0xcc, 0x99, 0xc3, 0x8a, 0x0b, 0x7b, 0x44, 0x9c, 0x22, 0x71, 0xe3, 0xc2, 0x95, 0x13, - 0x1c, 0x90,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, 0x55, 0xdd, 0x5b, 0x27, 0xa2, 0x77, 0x42, 0x49, 0xa4, 0x42, - 0x22, 0x9b, 0xab, 0x8e, 0x6b, 0x8e, 0xd4, 0xd8, 0xa8, 0x99, 0xd5, 0x61, 0x13, 0xa9, 0x7a, 0xd7, - 0x35, 0x47, 0xb1, 0x53, 0xef, 0xc0, 0xba, 0xa5, 0x1d, 0x25, 0x40, 0xb3, 0xab, 0x83, 0x16, 0x2c, - 0xed, 0x28, 0x46, 0xfa, 0x14, 0xce, 0x39, 0x41, 0xcc, 0xc4, 0x70, 0x5e, 0x49, 0x7c, 0x63, 0x4a, - 0x3d, 0x16, 0x61, 0x01, 0x2c, 0x72, 0x5e, 0x9f, 0xf0, 0xd0, 0x8f, 0xa1, 0x40, 0x12, 0xad, 0xed, - 0xd3, 0x83, 0xe4, 0x95, 0xf2, 0x14, 0xf5, 0x4d, 0x79, 0x2f, 0xec, 0x21, 0x98, 0x08, 0xa1, 0x78, - 0xa8, 0x0a, 0xeb, 0x4f, 0x5c, 0xd3, 0xc7, 0xaa, 0xef, 0x38, 0xaa, 0x33, 0x36, 0x4a, 0x05, 0x9a, - 0x68, 0xf3, 0x94, 0x38, 0x70, 0x9c, 0xdd, 0xb1, 0x41, 0x3c, 0xe7, 0x62, 0x2d, 0xb1, 0xfc, 0xd2, - 0xc6, 0x29, 0x3c, 0x47, 0x44, 0x63, 0x73, 0x7c, 0x00, 0x17, 0x74, 0x9a, 0xfb, 0x62, 0x34, 0x75, - 0xdf, 0x3c, 0xc2, 0x46, 0x49, 0xa2, 0x8a, 0xcf, 0xb3, 0xd9, 0x48, 0xe0, 0x16, 0x99, 0x43, 0x1f, - 0x83, 0x64, 0xda, 0xea, 0xfe, 0x98, 0x76, 0x69, 0x74, 0x69, 0x5e, 0x69, 0x93, 0xee, 0xf5, 0x9b, - 0xcb, 0xf6, 0x8a, 0x1f, 0x4f, 0xb1, 0xad, 0x63, 0xe3, 0x13, 0xc2, 0x19, 0xac, 0xa3, 0x68, 0xda, - 0xb7, 0xa8, 0x3c, 0x25, 0x7a, 0xe8, 0x10, 0x36, 0xcc, 0x91, 0xed, 0xb8, 0x24, 0x09, 0xe1, 0xc7, - 0xf6, 0xd4, 0xf2, 0x4a, 0x88, 0x22, 0x7e, 0xb8, 0xc2, 0xa9, 0x91, 0x99, 0x64, 0x1f, 0x3f, 0xee, - 0x4d, 0x2d, 0x5a, 0xb4, 0xe3, 0xe6, 0xef, 0x95, 0x39, 0x4f, 0x29, 0x9a, 0xd1, 0x98, 0x28, 0x39, - 0x76, 0xf5, 0xe2, 0x25, 0xa1, 0x23, 0x88, 0x39, 0x09, 0x3a, 0x82, 0xb8, 0x2e, 0x15, 0x3b, 0x82, - 0x58, 0x94, 0x36, 0xaa, 0x7f, 0x11, 0x60, 0x33, 0x71, 0x94, 0x14, 0xac, 0x3b, 0xae, 0xf1, 0x16, - 0x8f, 0xf7, 0x57, 0xe7, 0x28, 0x9f, 0x3d, 0x84, 0xbf, 0x46, 0xc1, 0x21, 0x26, 0x02, 0x23, 0x25, - 0xf1, 0x51, 0x78, 0x64, 0xa4, 0x6c, 0x47, 0x10, 0xb3, 0x92, 0xd8, 0x11, 0x44, 0x51, 0xca, 0x45, - 0x01, 0x03, 0x52, 0xbe, 0x23, 0x88, 0x05, 0x69, 0x3d, 0x19, 0x3c, 0x1d, 0x41, 0xdc, 0x90, 0xa4, - 0x8e, 0x20, 0x4a, 0xd2, 0x66, 0xf5, 0x4f, 0x29, 0xc8, 0xc8, 0xd4, 0x58, 0xe8, 0x43, 0x10, 0xa2, - 0x56, 0xea, 0x04, 0x0b, 0x27, 0x42, 0x85, 0xb0, 0xa3, 0x06, 0xf0, 0xfe, 0x51, 0xd8, 0x52, 0x9d, - 0x26, 0xe6, 0x98, 0x69, 0x89, 0x70, 0x22, 0xdc, 0xf8, 0xff, 0x21, 0xdc, 0x96, 0x78, 0x43, 0xf8, - 0x7f, 0x78, 0x83, 0xb5, 0x6d, 0xbf, 0xe1, 0xa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xec, 0xb5, 0x1f, 0xc1, 0xe6, 0xb1, - 0xa7, 0x3e, 0xb4, 0x01, 0xf9, 0x7a, 0xab, 0xa5, 0x2a, 0xed, 0x7b, 0x3b, 0x72, 0xb3, 0x2e, 0xad, - 0x21, 0x04, 0x45, 0xa5, 0xdd, 0xdd, 0xbd, 0xdf, 0x8e, 0x68, 0xdc, 0x65, 0xe1, 0xf3, 0xdf, 0x96, - 0xd7, 0xae, 0xed, 0xbe, 0xd2, 0xa5, 0xb2, 0xb2, 0x4d, 0x76, 0x70, 0xaf, 0xdd, 0x6b, 0xc9, 0xbd, - 0xdb, 0xd2, 0x1a, 0x19, 0xf4, 0x07, 0xf5, 0xdb, 0x64, 0xc0, 0xa3, 0x75, 0xc8, 0x35, 0x77, 0xbb, - 0x5d, 0x79, 0x30, 0x68, 0xb7, 0x24, 0x8e, 0xcc, 0xd5, 0x1b, 0xbb, 0x0a, 0x19, 0xa4, 0x18, 0x60, - 0xe3, 0xbb, 0xcf, 0xfe, 0x59, 0x5e, 0x7b, 0xb6, 0x28, 0x73, 0xcf, 0x17, 0x65, 0xee, 0xcb, 0x45, - 0x99, 0xfb, 0xc7, 0xa2, 0xcc, 0x7d, 0xf1, 0xa2, 0xbc, 0xf6, 0xfc, 0x45, 0x79, 0xed, 0xcb, 0x17, - 0xe5, 0xb5, 0x87, 0xd9, 0xc0, 0xb7, 0xc3, 0x0c, 0xfd, 0x7f, 0xc8, 0x8d, 0xff, 0x06, 0x00, 0x00, - 0xff, 0xff, 0x7a, 0x18, 0xe7, 0x5a, 0xc9, 0x19, 0x00, 0x00, +func init() { proto.RegisterFile("roachpb/data.proto", fileDescriptor_data_21a9cff2ad2577a7) } + +var fileDescriptor_data_21a9cff2ad2577a7 = []byte{ + // 2353 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0x4d, 0x6c, 0xdb, 0xc8, + 0x15, 0x36, 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+ 0x60, 0xac, 0x4a, 0x7c, 0x18, 0x1e, 0x49, 0x29, 0xd5, 0x16, 0xc4, 0x94, 0x24, 0xb6, 0x05, 0x51, + 0x94, 0xd2, 0x61, 0xc0, 0x80, 0x94, 0x69, 0x0b, 0x62, 0x56, 0xca, 0xc5, 0x83, 0xa7, 0x2d, 0x88, + 0x6b, 0x92, 0xd4, 0x16, 0x44, 0x49, 0x5a, 0x2f, 0xff, 0x93, 0x83, 0x64, 0x8b, 0x1a, 0x0b, 0x3d, + 0x84, 0x35, 0xd7, 0xb0, 0x86, 0x26, 0x56, 0x0e, 0xf1, 0x34, 0x9a, 0xaa, 0x32, 0xdb, 0xef, 0x2c, + 0x30, 0x13, 0x93, 0xa9, 0xf4, 0xa8, 0xc0, 0x7d, 0x3c, 0xa5, 0xc6, 0x8f, 0xa2, 0x28, 0xe7, 0xc6, + 0x17, 0x50, 0x0d, 0x78, 0xef, 0x38, 0x18, 0xbb, 0x2e, 0x12, 0x97, 0xcc, 0xfc, 0x44, 0x78, 0xb3, + 0x06, 0xb9, 0x13, 0xda, 0xce, 0xb9, 0xe1, 0x08, 0xbf, 0x7c, 0xc2, 0x7b, 0x8b, 0xb6, 0x20, 0x0a, + 0x52, 0xc2, 0x1f, 0xb4, 0x7e, 0xc9, 0x03, 0xec, 0xd8, 0xda, 0x21, 0x1b, 0xf3, 0xd1, 0x87, 0x20, + 0xc4, 0x0e, 0x7b, 0x66, 0x64, 0xc5, 0x52, 0xc4, 0x7d, 0x4d, 0x67, 0x8a, 0xa5, 0x19, 0xff, 0x5f, + 0xa4, 0xd9, 0x82, 0x28, 0x14, 0xfe, 0x07, 0x51, 0x88, 0xba, 0x00, 0xfa, 0xc4, 0x51, 0x07, 0x86, + 0x69, 0x78, 0x53, 0x9a, 0xda, 0xf9, 0xed, 0xca, 0x02, 0x95, 0xb1, 0x2b, 0xb2, 0x8a, 0x69, 0x6b, + 0x87, 0x95, 0x46, 0x28, 0x25, 0xc7, 0x10, 0x7c, 0x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 0x97, 0x73, 0xc3, 0x77, 0xa1, 0x10, 0xbf, 0xde, 0xb3, 0x47, 0x23, 0xd5, + 0x22, 0xbf, 0x13, 0xcb, 0x63, 0x81, 0x25, 0xc7, 0xae, 0xff, 0xea, 0x6c, 0xb9, 0x4e, 0x56, 0x51, + 0x0d, 0x72, 0x81, 0x03, 0xd9, 0xe8, 0x25, 0x2c, 0x33, 0x7a, 0x65, 0x7d, 0x19, 0x36, 0x7b, 0x2d, + 0x1b, 0x04, 0xa1, 0x49, 0x42, 0x33, 0xb0, 0x49, 0xe6, 0xd6, 0x1f, 0x39, 0x48, 0xd3, 0xab, 0x7b, + 0x7a, 0x9f, 0x98, 0x81, 0xd4, 0x5e, 0xf7, 0x7e, 0x77, 0xf7, 0xd3, 0xae, 0xb4, 0x82, 0x52, 0xc0, + 0xb7, 0xba, 0x7d, 0x89, 0x43, 0x69, 0x48, 0xdc, 0xd9, 0xd9, 0xad, 0xf6, 0xa5, 0x55, 0xf2, 0x58, + 0x7b, 0xd8, 0x6f, 0xf6, 0x24, 0x1e, 0x5d, 0x81, 0xb5, 0x46, 0x73, 0xa7, 0xd5, 0x69, 0xf5, 0x9b, + 0x0d, 0x85, 0x11, 0x45, 0x24, 0x82, 0xd0, 0x6f, 0x75, 0x9a, 0x92, 0x40, 0xa0, 0x1a, 0xcd, 0x7a, + 0xab, 0x53, 0xdd, 0x91, 0x12, 0x68, 0x03, 0xd6, 0x23, 0xde, 0x80, 0x9c, 0x46, 0x59, 0x10, 0x1b, + 0x7b, 0x72, 0xb5, 0xdf, 0xda, 0xed, 0x4a, 0x49, 0x04, 0x90, 0x24, 0xb2, 0xfd, 0x47, 0x52, 0x96, + 0xe8, 0xe9, 0xef, 0x3d, 0xd8, 0x69, 0x4a, 0x40, 0x98, 0x6a, 0xad, 0x7e, 0x55, 0x96, 0xab, 0x0f, + 0xa5, 0x0c, 0xca, 0x03, 0x10, 0xa6, 0x5e, 0x53, 0x6e, 0x35, 0x7b, 0x92, 0x5e, 0x26, 0x53, 0x59, + 0xea, 0xd6, 0x0f, 0x60, 0xfd, 0xd4, 0x95, 0x29, 0x5a, 0x83, 0x4c, 0xb5, 0xd1, 0x50, 0xe4, 0xe6, + 0x83, 0x9d, 0x56, 0xbd, 0x2a, 0xad, 0x20, 0x04, 0x79, 0xb9, 0xd9, 0xd9, 0xfd, 0xa4, 0x19, 0xd2, + 0xb8, 0x4d, 0xe1, 0x8b, 0xdf, 0x14, 0x57, 0x6e, 0xed, 0x9e, 0x98, 0xf6, 0xd9, 0x18, 0x40, 0x4e, + 0xf0, 0xa0, 0xd9, 0x6d, 0xb4, 0xba, 0x77, 0xa5, 0x15, 0xf2, 0xd2, 0xeb, 0x57, 0xef, 0x92, 0x17, + 0x1e, 0xe5, 0x20, 0x5d, 0xdf, 0xed, 0x74, 0x5a, 0xfd, 0x7e, 0xb3, 0x21, 0x71, 0x64, 0xad, 0x5a, + 0xdb, 0x95, 0xc9, 0xcb, 0x2a, 0x03, 0xac, 0x7d, 0xfb, 0xd9, 0xdf, 0x8b, 0x2b, 0xcf, 0xe6, 0x45, + 0xee, 0xf9, 0xbc, 0xc8, 0x7d, 0x35, 0x2f, 0x72, 0x7f, 0x9b, 0x17, 0xb9, 0x2f, 0x5f, 0x14, 0x57, + 0x9e, 0xbf, 0x28, 0xae, 0x7c, 0xf5, 0xa2, 0xb8, 0xf2, 0x28, 0xe5, 0xfb, 0x76, 0x90, 0xa4, 0xff, + 0x57, 0x7a, 0xff, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xbf, 0x9a, 0xb5, 0x42, 0x39, 0x1b, 0x00, + 0x00, } diff --git a/pkg/roachpb/data.proto b/pkg/roachpb/data.proto index 40a3d39e18e2..9f44d6f88cff 100644 --- a/pkg/roachpb/data.proto +++ b/pkg/roachpb/data.proto @@ -13,6 +13,7 @@ package cockroach.roachpb; option go_package = "roachpb"; import "roachpb/metadata.proto"; +import "storage/concurrency/lock/locking.proto"; import "storage/engine/enginepb/mvcc.proto"; import "storage/engine/enginepb/mvcc3.proto"; import "util/hlc/timestamp.proto"; @@ -539,25 +540,42 @@ message TransactionRecord { reserved 2, 3, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16; } -// A Intent is a Span together with a Transaction metadata and its status. +// A Intent is a Span together with a Transaction metadata. Intents messages +// are used to reference persistent on-disk write intents. They are used on +// the return path of e.g. scans, to report the existence of a write intent +// on a key. // -// Intents are used for two separate purposes: -// - on the return path of e.g. scans, to report the existence of a -// write intent on a key; -// - as input argument to intent resolution, to pass the current txn status, -// timestamps and ignored seqnum ranges to the resolution algorithm. -// Only in the latter case are the TxnMeta, status and ignored seqnum -// ranges guaranteed to be consistent with the latest txn's state. -// -// Note: avoid constructing Intent directly; consider using -// MakeIntent() or MakeErrorIntent() instead. +// Note: avoid constructing Intent directly; consider using MakeIntent() instead. message Intent { option (gogoproto.equal) = true; + // SingleKeySpan preseves wire compatibility with an earlier version of this + // proto which used a Span. An Intent never spans keys, so there was no need + // for this to contain an EndKey. + message SingleKeySpan { + option (gogoproto.equal) = true; + + reserved 1, 2, 4; + // The start key of the key range. + bytes key = 3 [(gogoproto.casttype) = "Key"]; + } + SingleKeySpan single_key_span = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; + storage.engine.enginepb.TxnMeta txn = 2 [(gogoproto.nullable) = false]; +} + +// 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 +// argument to intent resolution, to pass the current txn status, timestamps and +// ignored seqnum ranges to the resolution algorithm. +message LockUpdate { + option (gogoproto.equal) = true; + Span span = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; storage.engine.enginepb.TxnMeta txn = 2 [(gogoproto.nullable) = false]; TransactionStatus status = 3; repeated storage.engine.enginepb.IgnoredSeqNumRange ignored_seqnums = 4 [(gogoproto.nullable) = false, (gogoproto.customname) = "IgnoredSeqNums"]; + storage.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 5351e822d280..895de3ceca6e 100644 --- a/pkg/roachpb/data_test.go +++ b/pkg/roachpb/data_test.go @@ -21,6 +21,7 @@ import ( "time" "github.com/cockroachdb/apd" + "github.com/cockroachdb/cockroach/pkg/storage/concurrency/lock" "github.com/cockroachdb/cockroach/pkg/storage/engine/enginepb" "github.com/cockroachdb/cockroach/pkg/testutils/zerofields" "github.com/cockroachdb/cockroach/pkg/util" @@ -1895,9 +1896,9 @@ func TestChangeReplicasTrigger_ConfChange(t *testing.T) { } } -// TestAsIntents verifies that AsIntents propagates all the important +// TestAsLockUpdates verifies that AsLockUpdates propagates all the important // fields from a txn to each intent. -func TestAsIntents(t *testing.T) { +func TestAsLockUpdates(t *testing.T) { defer leaktest.AfterTest(t)() ts := hlc.Timestamp{WallTime: 1} @@ -1906,10 +1907,12 @@ func TestAsIntents(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 AsIntents(spans, &txn) { - require.Equal(t, intent.Status, txn.Status) - require.Equal(t, intent.IgnoredSeqNums, txn.IgnoredSeqNums) - require.Equal(t, intent.Txn, txn.TxnMeta) + for _, intent := range AsLockUpdates(&txn, spans, dur) { + 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/storage/batch_spanset_test.go b/pkg/storage/batch_spanset_test.go index 0d6d4c25f500..8974bdaa21d2 100644 --- a/pkg/storage/batch_spanset_test.go +++ b/pkg/storage/batch_spanset_test.go @@ -18,6 +18,7 @@ import ( "testing" "github.com/cockroachdb/cockroach/pkg/roachpb" + "github.com/cockroachdb/cockroach/pkg/storage/concurrency/lock" "github.com/cockroachdb/cockroach/pkg/storage/engine" "github.com/cockroachdb/cockroach/pkg/storage/engine/enginepb" "github.com/cockroachdb/cockroach/pkg/storage/spanset" @@ -544,10 +545,11 @@ func TestSpanSetMVCCResolveWriteIntentRangeUsingIter(t *testing.T) { batch := spanset.NewBatch(eng.NewBatch(), &ss) defer batch.Close() - intent := roachpb.Intent{ - Span: roachpb.Span{Key: roachpb.Key("a"), EndKey: roachpb.Key("b\x00")}, - Txn: enginepb.TxnMeta{}, // unused - Status: roachpb.PENDING, + intent := roachpb.LockUpdate{ + Span: roachpb.Span{Key: roachpb.Key("a"), EndKey: roachpb.Key("b\x00")}, + Txn: enginepb.TxnMeta{}, // unused + Status: roachpb.PENDING, + Durability: lock.Replicated, } iterAndBuf := engine.GetIterAndBuf(batch, engine.IterOptions{UpperBound: intent.Span.EndKey}) diff --git a/pkg/storage/batcheval/cmd_end_transaction.go b/pkg/storage/batcheval/cmd_end_transaction.go index 78d84358d845..dc8082a0f4b2 100644 --- a/pkg/storage/batcheval/cmd_end_transaction.go +++ b/pkg/storage/batcheval/cmd_end_transaction.go @@ -22,6 +22,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/settings/cluster" "github.com/cockroachdb/cockroach/pkg/storage/abortspan" "github.com/cockroachdb/cockroach/pkg/storage/batcheval/result" + "github.com/cockroachdb/cockroach/pkg/storage/concurrency/lock" "github.com/cockroachdb/cockroach/pkg/storage/engine" "github.com/cockroachdb/cockroach/pkg/storage/engine/enginepb" "github.com/cockroachdb/cockroach/pkg/storage/rditer" @@ -481,7 +482,7 @@ func resolveLocalIntents( externalIntents = append(externalIntents, span) return nil } - intent := roachpb.MakeIntent(txn, span) + intent := roachpb.MakeLockUpdateWithDur(txn, span, lock.Replicated) if len(span.EndKey) == 0 { // For single-key intents, do a KeyAddress-aware check of // whether it's contained in our Range. diff --git a/pkg/storage/batcheval/cmd_refresh.go b/pkg/storage/batcheval/cmd_refresh.go index 81e220952ada..c866597893e9 100644 --- a/pkg/storage/batcheval/cmd_refresh.go +++ b/pkg/storage/batcheval/cmd_refresh.go @@ -72,7 +72,7 @@ func Refresh( // at or beneath the refresh timestamp. if intent != nil && intent.Txn.ID != h.Txn.ID { return result.Result{}, errors.Errorf("encountered recently written intent %s @%s", - intent.Span.Key, intent.Txn.WriteTimestamp) + intent.Key, intent.Txn.WriteTimestamp) } return result.Result{}, nil diff --git a/pkg/storage/batcheval/cmd_refresh_range.go b/pkg/storage/batcheval/cmd_refresh_range.go index 38cd63b1cf2a..316a76536e65 100644 --- a/pkg/storage/batcheval/cmd_refresh_range.go +++ b/pkg/storage/batcheval/cmd_refresh_range.go @@ -83,7 +83,7 @@ func RefreshRange( } // Return an error if an intent was written to the span. return result.Result{}, errors.Errorf("encountered recently written intent %s @%s", - i.Span.Key, i.Txn.WriteTimestamp) + i.Key, i.Txn.WriteTimestamp) } return result.Result{}, nil diff --git a/pkg/storage/batcheval/cmd_refresh_range_test.go b/pkg/storage/batcheval/cmd_refresh_range_test.go index f1957275264e..b375974a8427 100644 --- a/pkg/storage/batcheval/cmd_refresh_range_test.go +++ b/pkg/storage/batcheval/cmd_refresh_range_test.go @@ -83,7 +83,7 @@ func TestRefreshRangeTimeBoundIterator(t *testing.T) { // (committed). The sstable also has a second write at a different (older) // timestamp, because if it were empty other than the deletion tombstone, it // would not have any timestamp bounds and would be selected for every read. - intent := roachpb.MakeIntent(txn, roachpb.Span{Key: k}) + intent := roachpb.MakeLockUpdate(txn, roachpb.Span{Key: k}) intent.Status = roachpb.COMMITTED if _, err := engine.MVCCResolveWriteIntent(ctx, db, nil, intent); err != nil { t.Fatal(err) diff --git a/pkg/storage/batcheval/cmd_resolve_intent.go b/pkg/storage/batcheval/cmd_resolve_intent.go index 184b7604147b..bf8160cc7e1c 100644 --- a/pkg/storage/batcheval/cmd_resolve_intent.go +++ b/pkg/storage/batcheval/cmd_resolve_intent.go @@ -81,8 +81,8 @@ func ResolveIntent( return result.Result{}, ErrTransactionUnsupported } - intent := args.AsIntent() - ok, err := engine.MVCCResolveWriteIntent(ctx, readWriter, ms, intent) + update := args.AsLockUpdate() + ok, err := engine.MVCCResolveWriteIntent(ctx, readWriter, ms, update) if err != nil { return result.Result{}, err } diff --git a/pkg/storage/batcheval/cmd_resolve_intent_range.go b/pkg/storage/batcheval/cmd_resolve_intent_range.go index e4175053c7aa..fa69674907fa 100644 --- a/pkg/storage/batcheval/cmd_resolve_intent_range.go +++ b/pkg/storage/batcheval/cmd_resolve_intent_range.go @@ -42,13 +42,13 @@ func ResolveIntentRange( return result.Result{}, ErrTransactionUnsupported } - intent := args.AsIntent() + update := args.AsLockUpdate() iterAndBuf := engine.GetIterAndBuf(readWriter, engine.IterOptions{UpperBound: args.EndKey}) defer iterAndBuf.Cleanup() numKeys, resumeSpan, err := engine.MVCCResolveWriteIntentRangeUsingIter( - ctx, readWriter, iterAndBuf, ms, intent, cArgs.MaxKeys, + ctx, readWriter, iterAndBuf, ms, update, cArgs.MaxKeys, ) if err != nil { return result.Result{}, err diff --git a/pkg/storage/concurrency/concurrency_control.go b/pkg/storage/concurrency/concurrency_control.go index 1374bddfec05..0918d271c203 100644 --- a/pkg/storage/concurrency/concurrency_control.go +++ b/pkg/storage/concurrency/concurrency_control.go @@ -229,11 +229,11 @@ 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.Intent) + OnLockAcquired(context.Context, *roachpb.LockUpdate) // OnLockUpdated informs the concurrency manager that a transaction has // updated or released a lock or range of locks that it previously held. - OnLockUpdated(context.Context, *roachpb.Intent) + OnLockUpdated(context.Context, *roachpb.LockUpdate) } // TransactionManager is concerned with tracking transactions that have their @@ -512,7 +512,7 @@ type lockTable interface { // contained in IgnoredSeqNums are dropped. // - the remaining locks are changed to timestamp equal to // txn.WriteTimestamp. - UpdateLocks(*roachpb.Intent) error + UpdateLocks(*roachpb.LockUpdate) error // Clear removes all locks and lock wait-queues from the lockTable. Clear() diff --git a/pkg/storage/concurrency/concurrency_manager.go b/pkg/storage/concurrency/concurrency_manager.go index 1968c6b7a59c..0d206d6938d0 100644 --- a/pkg/storage/concurrency/concurrency_manager.go +++ b/pkg/storage/concurrency/concurrency_manager.go @@ -285,17 +285,15 @@ func (m *managerImpl) HandleTransactionPushError( } // OnLockAcquired implements the LockManager interface. -func (m *managerImpl) OnLockAcquired(ctx context.Context, in *roachpb.Intent) { - // TODO(nvanbenschoten): rename roachpb.Intent and add a lock.Durability - // field to it. - if err := m.lt.AcquireLock(&in.Txn, in.Key, lock.Exclusive, lock.Unreplicated); err != nil { +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 { log.Fatal(ctx, errors.HandleAsAssertionFailure(err)) } } // OnLockUpdated implements the LockManager interface. -func (m *managerImpl) OnLockUpdated(ctx context.Context, in *roachpb.Intent) { - if err := m.lt.UpdateLocks(in); err != nil { +func (m *managerImpl) OnLockUpdated(ctx context.Context, up *roachpb.LockUpdate) { + if err := m.lt.UpdateLocks(up); err != nil { log.Fatal(ctx, errors.HandleAsAssertionFailure(err)) } } diff --git a/pkg/storage/concurrency/concurrency_manager_test.go b/pkg/storage/concurrency/concurrency_manager_test.go index 8412737717a1..643bb01503b9 100644 --- a/pkg/storage/concurrency/concurrency_manager_test.go +++ b/pkg/storage/concurrency/concurrency_manager_test.go @@ -29,6 +29,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/cockroach/pkg/storage/batcheval" "github.com/cockroachdb/cockroach/pkg/storage/concurrency" + "github.com/cockroachdb/cockroach/pkg/storage/concurrency/lock" "github.com/cockroachdb/cockroach/pkg/storage/engine/enginepb" "github.com/cockroachdb/cockroach/pkg/storage/intentresolver" "github.com/cockroachdb/cockroach/pkg/storage/spanset" @@ -229,10 +230,9 @@ func TestConcurrencyManagerBasic(t *testing.T) { opName := fmt.Sprintf("handle write intent error %s", reqName) mon.runSync(opName, func(ctx context.Context) { - err := &roachpb.WriteIntentError{Intents: []roachpb.Intent{{ - Span: roachpb.Span{Key: roachpb.Key(key)}, - Txn: txn.TxnMeta, - }}} + err := &roachpb.WriteIntentError{Intents: []roachpb.Intent{ + roachpb.MakeIntent(&txn.TxnMeta, roachpb.Key(key)), + }} log.Eventf(ctx, "handling %v", err) guard = m.HandleWriterIntentError(ctx, guard, err) }) @@ -251,10 +251,9 @@ func TestConcurrencyManagerBasic(t *testing.T) { mon.runSync("acquire lock", func(ctx context.Context) { log.Eventf(ctx, "%s @ %s", txnName, key) - m.OnLockAcquired(ctx, &roachpb.Intent{ - Span: roachpb.Span{Key: roachpb.Key(key)}, - Txn: txn.TxnMeta, - }) + span := roachpb.Span{Key: roachpb.Key(key)} + up := roachpb.MakeLockUpdateWithDur(txn, span, lock.Unreplicated) + m.OnLockAcquired(ctx, &up) }) return mon.waitAndCollect(t) @@ -409,7 +408,7 @@ func (c *cluster) PushTransaction( // ResolveIntent implements the concurrency.IntentResolver interface. func (c *cluster) ResolveIntent( - ctx context.Context, intent roachpb.Intent, _ intentresolver.ResolveOptions, + ctx context.Context, intent roachpb.LockUpdate, _ intentresolver.ResolveOptions, ) *roachpb.Error { log.Eventf(ctx, "resolving intent %s for txn %s with %s status", intent.Key, intent.Txn.ID, intent.Status) c.m.OnLockUpdated(ctx, &intent) diff --git a/pkg/storage/concurrency/lock_table.go b/pkg/storage/concurrency/lock_table.go index c70fc476de96..826580802624 100644 --- a/pkg/storage/concurrency/lock_table.go +++ b/pkg/storage/concurrency/lock_table.go @@ -49,6 +49,7 @@ type waitingState struct { // 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 @@ -577,7 +578,7 @@ func (l *lockState) tryBreakReservation(seqNum uint64) bool { // waitForDistinguished states. // REQUIRES: l.mu is locked. func (l *lockState) informActiveWaiters() { - waitForTxn, waitForTs := l.getLockerInfo() + waitForTxn, waitForTs, waitForDur := l.getLockerInfo() var checkForWaitSelf bool findDistinguished := l.distinguishedWaiter == nil if waitForTxn == nil { @@ -593,6 +594,7 @@ func (l *lockState) informActiveWaiters() { stateKind: waitFor, txn: waitForTxn, ts: waitForTs, + dur: waitForDur, key: l.key, held: l.holder.locked, access: spanset.SpanReadWrite, @@ -691,9 +693,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) { +func (l *lockState) getLockerInfo() (*enginepb.TxnMeta, hlc.Timestamp, lock.Durability) { if !l.holder.locked { - return nil, hlc.Timestamp{} + return nil, hlc.Timestamp{}, 0 } // If the lock is held as both replicated and unreplicated we want to @@ -710,7 +712,7 @@ func (l *lockState) getLockerInfo() (*enginepb.TxnMeta, hlc.Timestamp) { 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 + return l.holder.holder[index].txn, l.holder.holder[index].ts, index } // Decides whether the request g with access sa should actively wait at this @@ -732,7 +734,7 @@ func (l *lockState) tryActiveWait(g *lockTableGuardImpl, sa spanset.SpanAccess, } // Lock is not empty. - waitForTxn, waitForTs := l.getLockerInfo() + waitForTxn, waitForTs, waitForDur := l.getLockerInfo() if waitForTxn != nil && g.isTxn(waitForTxn) { // Already locked by this txn. return false @@ -865,6 +867,7 @@ func (l *lockState) tryActiveWait(g *lockTableGuardImpl, sa spanset.SpanAccess, stateKind: stateType, txn: waitForTxn, ts: waitForTs, + dur: waitForDur, key: l.key, held: l.holder.locked, access: spanset.SpanReadWrite, @@ -888,7 +891,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") } @@ -913,7 +916,7 @@ func (l *lockState) acquireLock( } l.holder.holder[durability].txn = txn l.holder.holder[durability].ts = ts - _, afterTs := l.getLockerInfo() + _, afterTs, _ := l.getLockerInfo() if afterTs.Less(beforeTs) { return errors.Errorf("caller violated contract") } else if beforeTs.Less(afterTs) { @@ -1089,13 +1092,14 @@ func (l *lockState) tryClearLock(force bool) bool { l.holder.holder[lock.Unreplicated] = lockHolderInfo{} var waitState waitingState if replicatedHeld && !force { - holderTxn, holderTs := l.getLockerInfo() + holderTxn, holderTs, holderDur := l.getLockerInfo() // Note that none of the current waiters can be requests // from holderTxn. waitState = waitingState{ stateKind: waitElsewhere, txn: holderTxn, ts: holderTs, + dur: holderDur, key: l.key, held: true, access: spanset.SpanReadWrite, @@ -1182,13 +1186,13 @@ func removeIgnored( // transaction, else the lock is updated. Returns whether the lockState can be // garbage collected. // Acquires l.mu. -func (l *lockState) tryUpdateLock(intent *roachpb.Intent) (gc bool, err error) { +func (l *lockState) tryUpdateLock(up *roachpb.LockUpdate) (gc bool, err error) { l.mu.Lock() defer l.mu.Unlock() - if !l.isLockedBy(intent.Txn.ID) { + if !l.isLockedBy(up.Txn.ID) { return false, nil } - if intent.Status.IsFinalized() { + if up.Status.IsFinalized() { l.holder.locked = false for i := range l.holder.holder { l.holder.holder[i] = lockHolderInfo{} @@ -1197,9 +1201,9 @@ func (l *lockState) tryUpdateLock(intent *roachpb.Intent) (gc bool, err error) { return gc, nil } - ts := intent.Txn.WriteTimestamp - txn := &intent.Txn - _, beforeTs := l.getLockerInfo() + ts := up.Txn.WriteTimestamp + txn := &up.Txn + _, beforeTs, _ := l.getLockerInfo() isLocked := false for i := range l.holder.holder { holderTxn := l.holder.holder[i].txn @@ -1212,7 +1216,7 @@ func (l *lockState) tryUpdateLock(intent *roachpb.Intent) (gc bool, err error) { continue } // Held in same epoch. - l.holder.holder[i].seqs = removeIgnored(l.holder.holder[i].seqs, intent.IgnoredSeqNums) + l.holder.holder[i].seqs = removeIgnored(l.holder.holder[i].seqs, up.IgnoredSeqNums) if len(l.holder.holder[i].seqs) == 0 { l.holder.holder[i].txn = nil continue @@ -1597,8 +1601,8 @@ func (t *lockTableImpl) tryGCLocks(tree *treeMu, locks []*lockState) { } // UpdateLocks implements the lockTable interface. -func (t *lockTableImpl) UpdateLocks(intent *roachpb.Intent) error { - span := intent.Span +func (t *lockTableImpl) UpdateLocks(up *roachpb.LockUpdate) error { + span := up.Span ss := spanset.SpanGlobal if keys.IsLocal(span.Key) { ss = spanset.SpanLocal @@ -1608,7 +1612,7 @@ func (t *lockTableImpl) UpdateLocks(intent *roachpb.Intent) error { var locksToGC []*lockState changeFunc := func(i btree.Item) bool { l := i.(*lockState) - gc, err2 := l.tryUpdateLock(intent) + gc, err2 := l.tryUpdateLock(up) if err2 != nil { err = err2 return false @@ -1747,7 +1751,7 @@ func (t *lockTableImpl) String() string { fmt.Fprintln(&buf, "empty") return } - txn, ts := l.getLockerInfo() + txn, ts, _ := l.getLockerInfo() if txn == nil { fmt.Fprintf(&buf, " res: req: %d, %s\n", l.reservation.seqNum, waitingOnStr(l.reservation.txn, l.reservation.ts)) diff --git a/pkg/storage/concurrency/lock_table_test.go b/pkg/storage/concurrency/lock_table_test.go index 4e60e7ce5d6b..67586190cb49 100644 --- a/pkg/storage/concurrency/lock_table_test.go +++ b/pkg/storage/concurrency/lock_table_test.go @@ -239,7 +239,7 @@ func TestLockTableBasic(t *testing.T) { d.ScanArgs(t, "span", &s) span := getSpan(t, d, s) // TODO(sbhola): also test ABORTED. - intent := &roachpb.Intent{Span: span, Txn: *txnMeta, Status: roachpb.COMMITTED} + intent := &roachpb.LockUpdate{Span: span, Txn: *txnMeta, Status: roachpb.COMMITTED} if err := lt.UpdateLocks(intent); err != nil { return err.Error() } @@ -263,7 +263,7 @@ func TestLockTableBasic(t *testing.T) { d.ScanArgs(t, "span", &s) span := getSpan(t, d, s) // TODO(sbhola): also test STAGING. - intent := &roachpb.Intent{Span: span, Txn: *txnMeta, Status: roachpb.PENDING} + intent := &roachpb.LockUpdate{Span: span, Txn: *txnMeta, Status: roachpb.PENDING} if err := lt.UpdateLocks(intent); err != nil { return err.Error() } @@ -284,9 +284,8 @@ func TestLockTableBasic(t *testing.T) { if !ok { d.Fatalf(t, "unknown txn %s", txnName) } - span := roachpb.Span{Key: roachpb.Key(key)} - intent := &roachpb.Intent{Span: span, Txn: *txnMeta, Status: roachpb.PENDING} - if err := lt.AddDiscoveredLock(intent, g); err != nil { + intent := roachpb.MakeIntent(txnMeta, roachpb.Key(key)) + if err := lt.AddDiscoveredLock(&intent, g); err != nil { return err.Error() } return lt.(*lockTableImpl).String() @@ -446,7 +445,7 @@ type workItem struct { locksToAcquire []roachpb.Key // Update locks. - intents []roachpb.Intent + intents []roachpb.LockUpdate } func (w *workItem) getRequestTxnID() uuid.UUID { @@ -573,7 +572,7 @@ type transactionState struct { func makeWorkItemFinishTxn(tstate *transactionState) workItem { wItem := workItem{} for i := range tstate.acquiredLocks { - wItem.intents = append(wItem.intents, roachpb.Intent{ + wItem.intents = append(wItem.intents, roachpb.LockUpdate{ Span: roachpb.Span{Key: tstate.acquiredLocks[i]}, Txn: *tstate.txn, Status: roachpb.COMMITTED, @@ -1041,7 +1040,7 @@ func doBenchWork(item *benchWorkItem, env benchEnv, doneCh chan<- error) { return } for _, k := range item.locksToAcquire { - intent := roachpb.Intent{ + intent := roachpb.LockUpdate{ Span: roachpb.Span{Key: k}, Txn: item.Request.Txn.TxnMeta, Status: roachpb.COMMITTED, diff --git a/pkg/storage/concurrency/lock_table_waiter.go b/pkg/storage/concurrency/lock_table_waiter.go index b0dc92eba291..31e2f7efb740 100644 --- a/pkg/storage/concurrency/lock_table_waiter.go +++ b/pkg/storage/concurrency/lock_table_waiter.go @@ -54,7 +54,7 @@ type IntentResolver interface { ) (roachpb.Transaction, *Error) // ResolveIntent resolves the provided intent according to the options. - ResolveIntent(context.Context, roachpb.Intent, intentresolver.ResolveOptions) *Error + ResolveIntent(context.Context, roachpb.LockUpdate, intentresolver.ResolveOptions) *Error } // WaitOn implements the lockTableWaiter interface. @@ -227,10 +227,9 @@ func (w *lockTableWaiterImpl) pushTxn(ctx context.Context, req Request, ws waiti // // To do better here, we need per-intent information on whether we need to // poison. - resolveIntent := roachpb.Intent{Span: roachpb.Span{Key: ws.key}} - resolveIntent.SetTxn(&pusheeTxn) + resolve := roachpb.MakeLockUpdateWithDur(&pusheeTxn, roachpb.Span{Key: ws.key}, ws.dur) opts := intentresolver.ResolveOptions{Wait: false, Poison: true} - return w.ir.ResolveIntent(ctx, resolveIntent, opts) + return w.ir.ResolveIntent(ctx, resolve, opts) } func hasMinPriority(txn *enginepb.TxnMeta) bool { diff --git a/pkg/storage/concurrency/lock_table_waiter_test.go b/pkg/storage/concurrency/lock_table_waiter_test.go index cc1724cea292..18110c701be5 100644 --- a/pkg/storage/concurrency/lock_table_waiter_test.go +++ b/pkg/storage/concurrency/lock_table_waiter_test.go @@ -28,7 +28,7 @@ import ( type mockIntentResolver struct { pushTxn func(context.Context, *enginepb.TxnMeta, roachpb.Header, roachpb.PushTxnType) (roachpb.Transaction, *Error) - resolveIntent func(context.Context, roachpb.Intent) *Error + resolveIntent func(context.Context, roachpb.LockUpdate) *Error } func (m *mockIntentResolver) PushTransaction( @@ -38,7 +38,7 @@ func (m *mockIntentResolver) PushTransaction( } func (m *mockIntentResolver) ResolveIntent( - ctx context.Context, intent roachpb.Intent, _ intentresolver.ResolveOptions, + ctx context.Context, intent roachpb.LockUpdate, _ intentresolver.ResolveOptions, ) *Error { return m.resolveIntent(ctx, intent) } @@ -304,7 +304,7 @@ func testWaitPush(t *testing.T, k stateKind, makeReq func() Request, expPushTS h // we know the holder is ABORTED. Otherwide, immediately // tell the request to stop waiting. if lockHeld { - ir.resolveIntent = func(_ context.Context, intent roachpb.Intent) *Error { + ir.resolveIntent = func(_ context.Context, intent roachpb.LockUpdate) *Error { require.Equal(t, keyA, intent.Key) require.Equal(t, pusheeTxn.ID, intent.Txn.ID) require.Equal(t, roachpb.ABORTED, intent.Status) @@ -371,7 +371,7 @@ func TestLockTableWaiterIntentResolverError(t *testing.T) { ) (roachpb.Transaction, *Error) { return roachpb.Transaction{}, nil } - ir.resolveIntent = func(_ context.Context, intent roachpb.Intent) *Error { + ir.resolveIntent = func(_ context.Context, intent roachpb.LockUpdate) *Error { return err2 } err = w.WaitOn(ctx, req, g) diff --git a/pkg/storage/engine/bench_test.go b/pkg/storage/engine/bench_test.go index 1527fe3ac25f..db7b754757ae 100644 --- a/pkg/storage/engine/bench_test.go +++ b/pkg/storage/engine/bench_test.go @@ -21,6 +21,7 @@ import ( "time" "github.com/cockroachdb/cockroach/pkg/roachpb" + "github.com/cockroachdb/cockroach/pkg/storage/concurrency/lock" "github.com/cockroachdb/cockroach/pkg/storage/engine/enginepb" "github.com/cockroachdb/cockroach/pkg/testutils" "github.com/cockroachdb/cockroach/pkg/util/encoding" @@ -137,10 +138,11 @@ func setupMVCCData( key := keys[idx] txnMeta := txn.TxnMeta txnMeta.WriteTimestamp = hlc.Timestamp{WallTime: int64(counts[idx]) * 5} - if _, err := MVCCResolveWriteIntent(ctx, batch, nil /* ms */, roachpb.Intent{ - Span: roachpb.Span{Key: key}, - Status: roachpb.COMMITTED, - Txn: txnMeta, + if _, err := MVCCResolveWriteIntent(ctx, batch, nil /* ms */, roachpb.LockUpdate{ + Span: roachpb.Span{Key: key}, + Status: roachpb.COMMITTED, + Txn: txnMeta, + Durability: lock.Replicated, }); err != nil { b.Fatal(err) } diff --git a/pkg/storage/engine/metamorphic/operands.go b/pkg/storage/engine/metamorphic/operands.go index 6746efdcb2e7..101b2719ed99 100644 --- a/pkg/storage/engine/metamorphic/operands.go +++ b/pkg/storage/engine/metamorphic/operands.go @@ -232,7 +232,7 @@ func (t *txnManager) open() *roachpb.Transaction { func (t *txnManager) close(op operand) { txn := op.(*roachpb.Transaction) for _, span := range txn.IntentSpans { - intent := roachpb.MakeIntent(txn, span) + intent := roachpb.MakeLockUpdate(txn, span) intent.Status = roachpb.COMMITTED _, err := engine.MVCCResolveWriteIntent(context.TODO(), t.testRunner.engine, nil, intent) if err != nil { diff --git a/pkg/storage/engine/mvcc.go b/pkg/storage/engine/mvcc.go index 94e952d4cd99..40e025d939ce 100644 --- a/pkg/storage/engine/mvcc.go +++ b/pkg/storage/engine/mvcc.go @@ -953,7 +953,7 @@ func mvccGetInternal( // ignore the intent by insisting that the timestamp we're reading // at is a historical timestamp < the intent timestamp. However, we // return the intent separately; the caller may want to resolve it. - intent := roachpb.MakePendingIntent(meta.Txn, roachpb.Span{Key: metaKey.Key}) + intent := roachpb.MakeIntent(meta.Txn, metaKey.Key) ignoredIntent = &intent timestamp = metaTimestamp.Prev() } @@ -973,7 +973,7 @@ func mvccGetInternal( if metaTimestamp.LessEq(maxVisibleTimestamp) { return nil, nil, safeValue, &roachpb.WriteIntentError{ Intents: []roachpb.Intent{ - roachpb.MakePendingIntent(meta.Txn, roachpb.Span{Key: metaKey.Key}), + roachpb.MakeIntent(meta.Txn, metaKey.Key), }, } } @@ -1512,7 +1512,7 @@ func mvccPutInternal( // The current Put operation does not come from the same // transaction. return &roachpb.WriteIntentError{Intents: []roachpb.Intent{ - roachpb.MakePendingIntent(meta.Txn, roachpb.Span{Key: key}), + roachpb.MakeIntent(meta.Txn, key), }} } else if txn.Epoch < meta.Txn.Epoch { return errors.Errorf("put with epoch %d came after put with epoch %d in txn %s", @@ -2208,7 +2208,7 @@ func MVCCClearTimeRange( if meta.Txn != nil && startTime.Less(ts) && ts.LessEq(endTime) { err := &roachpb.WriteIntentError{ Intents: []roachpb.Intent{ - roachpb.MakePendingIntent(meta.Txn, roachpb.Span{Key: append([]byte{}, k.Key...)}), + roachpb.MakeIntent(meta.Txn, append([]byte{}, k.Key...)), }} return nil, err } @@ -2424,7 +2424,7 @@ func buildScanIntents(data []byte) ([]roachpb.Intent, error) { if err := protoutil.Unmarshal(reader.Value(), &meta); err != nil { return nil, err } - intents = append(intents, roachpb.MakePendingIntent(meta.Txn, roachpb.Span{Key: key.Key})) + intents = append(intents, roachpb.MakeIntent(meta.Txn, key.Key)) } if err := reader.Error(); err != nil { @@ -2631,7 +2631,7 @@ func MVCCIterate( // Doesn't look like this code here caught that. Shouldn't resolve intents // when they're not at the timestamp the Txn mandates them to be. func MVCCResolveWriteIntent( - ctx context.Context, rw ReadWriter, ms *enginepb.MVCCStats, intent roachpb.Intent, + ctx context.Context, rw ReadWriter, ms *enginepb.MVCCStats, intent roachpb.LockUpdate, ) (bool, error) { iterAndBuf := GetBufUsingIter(rw.NewIterator(IterOptions{Prefix: true})) ok, err := MVCCResolveWriteIntentUsingIter(ctx, rw, iterAndBuf, ms, intent) @@ -2647,7 +2647,7 @@ func MVCCResolveWriteIntentUsingIter( rw ReadWriter, iterAndBuf IterAndBuf, ms *enginepb.MVCCStats, - intent roachpb.Intent, + intent roachpb.LockUpdate, ) (bool, error) { if len(intent.Key) == 0 { return false, emptyKeyError() @@ -2688,7 +2688,7 @@ func mvccResolveWriteIntent( rw ReadWriter, iter Iterator, ms *enginepb.MVCCStats, - intent roachpb.Intent, + intent roachpb.LockUpdate, buf *putBuffer, forRange bool, ) (bool, error) { @@ -3083,9 +3083,9 @@ func (b IterAndBuf) Cleanup() { // txns. Returns the number of intents resolved and a resume span if // the max keys limit was exceeded. func MVCCResolveWriteIntentRange( - ctx context.Context, rw ReadWriter, ms *enginepb.MVCCStats, intent roachpb.Intent, max int64, + ctx context.Context, rw ReadWriter, ms *enginepb.MVCCStats, intent roachpb.LockUpdate, max int64, ) (int64, *roachpb.Span, error) { - iterAndBuf := GetIterAndBuf(rw, IterOptions{UpperBound: intent.Span.EndKey}) + iterAndBuf := GetIterAndBuf(rw, IterOptions{UpperBound: intent.EndKey}) defer iterAndBuf.Cleanup() return MVCCResolveWriteIntentRangeUsingIter(ctx, rw, iterAndBuf, ms, intent, max) } @@ -3100,7 +3100,7 @@ func MVCCResolveWriteIntentRangeUsingIter( rw ReadWriter, iterAndBuf IterAndBuf, ms *enginepb.MVCCStats, - intent roachpb.Intent, + intent roachpb.LockUpdate, max int64, ) (int64, *roachpb.Span, error) { encKey := MakeMVCCMetadataKey(intent.Key) @@ -3708,7 +3708,7 @@ func checkForKeyCollisionsGo( // target key space, which will require appropriate resolution logic. writeIntentErr := roachpb.WriteIntentError{ Intents: []roachpb.Intent{ - roachpb.MakePendingIntent(mvccMeta.Txn, roachpb.Span{Key: existingIter.Key().Key}), + roachpb.MakeIntent(mvccMeta.Txn, existingIter.Key().Key), }, } diff --git a/pkg/storage/engine/mvcc_history_test.go b/pkg/storage/engine/mvcc_history_test.go index 7e771cd9340a..031ae4a65971 100644 --- a/pkg/storage/engine/mvcc_history_test.go +++ b/pkg/storage/engine/mvcc_history_test.go @@ -503,7 +503,7 @@ func cmdResolveIntent(e *evalCtx) error { func (e *evalCtx) resolveIntent( rw ReadWriter, key roachpb.Key, txn *roachpb.Transaction, resolveStatus roachpb.TransactionStatus, ) error { - intent := roachpb.MakeIntent(txn, roachpb.Span{Key: key}) + intent := roachpb.MakeLockUpdate(txn, roachpb.Span{Key: key}) intent.Status = resolveStatus _, err := MVCCResolveWriteIntent(e.ctx, rw, nil, intent) return err @@ -606,7 +606,7 @@ func cmdGet(e *evalCtx) error { // ascertain no result is populated in the intent when an error // occurs. if intent != nil { - fmt.Fprintf(e.results.buf, "get: %v -> intent {%s} %s\n", key, intent.Txn, intent.Status) + fmt.Fprintf(e.results.buf, "get: %v -> intent {%s}\n", key, intent.Txn) } if val != nil { fmt.Fprintf(e.results.buf, "get: %v -> %v @%v\n", key, val.PrettyPrint(), val.Timestamp) @@ -713,7 +713,7 @@ func cmdScan(e *evalCtx) error { // ascertain no result is populated in the intents when an error // occurs. for _, intent := range res.Intents { - fmt.Fprintf(e.results.buf, "scan: %v -> intent {%s} %s\n", key, intent.Txn, intent.Status) + fmt.Fprintf(e.results.buf, "scan: %v -> intent {%s}\n", key, intent.Txn) } for _, val := range res.KVs { fmt.Fprintf(e.results.buf, "scan: %v -> %v @%v\n", val.Key, val.Value.PrettyPrint(), val.Value.Timestamp) diff --git a/pkg/storage/engine/mvcc_incremental_iterator.go b/pkg/storage/engine/mvcc_incremental_iterator.go index 5502840e7a1b..22d1d802f8a6 100644 --- a/pkg/storage/engine/mvcc_incremental_iterator.go +++ b/pkg/storage/engine/mvcc_incremental_iterator.go @@ -193,7 +193,7 @@ func (i *MVCCIncrementalIterator) advance() { if i.startTime.Less(metaTimestamp) && metaTimestamp.LessEq(i.endTime) { i.err = &roachpb.WriteIntentError{ Intents: []roachpb.Intent{ - roachpb.MakePendingIntent(i.meta.Txn, roachpb.Span{Key: i.iter.Key().Key}), + roachpb.MakeIntent(i.meta.Txn, i.iter.Key().Key), }, } i.valid = false diff --git a/pkg/storage/engine/mvcc_incremental_iterator_test.go b/pkg/storage/engine/mvcc_incremental_iterator_test.go index 1d049fcf5cba..bc984f201e7f 100644 --- a/pkg/storage/engine/mvcc_incremental_iterator_test.go +++ b/pkg/storage/engine/mvcc_incremental_iterator_test.go @@ -206,12 +206,12 @@ func TestMVCCIncrementalIterator(t *testing.T) { t.Run("intents", assertEqualKVs(e, fn, keyMin, keyMax, ts4, tsMax, kvs())) t.Run("intents", assertEqualKVs(e, fn, keyMin, keyMax, ts4.Next(), tsMax, kvs())) - intent1 := roachpb.MakeIntent(&txn1, roachpb.Span{Key: testKey1}) + intent1 := roachpb.MakeLockUpdate(&txn1, roachpb.Span{Key: testKey1}) intent1.Status = roachpb.COMMITTED if _, err := MVCCResolveWriteIntent(ctx, e, nil, intent1); err != nil { t.Fatal(err) } - intent2 := roachpb.MakeIntent(&txn2, roachpb.Span{Key: testKey2}) + intent2 := roachpb.MakeLockUpdate(&txn2, roachpb.Span{Key: testKey2}) intent2.Status = roachpb.ABORTED if _, err := MVCCResolveWriteIntent(ctx, e, nil, intent2); err != nil { t.Fatal(err) @@ -296,12 +296,12 @@ func TestMVCCIncrementalIterator(t *testing.T) { t.Run("intents", assertEqualKVs(e, fn, keyMin, keyMax, ts4, tsMax, kvs())) t.Run("intents", assertEqualKVs(e, fn, keyMin, keyMax, ts4.Next(), tsMax, kvs())) - intent1 := roachpb.MakeIntent(&txn1, roachpb.Span{Key: testKey1}) + intent1 := roachpb.MakeLockUpdate(&txn1, roachpb.Span{Key: testKey1}) intent1.Status = roachpb.COMMITTED if _, err := MVCCResolveWriteIntent(ctx, e, nil, intent1); err != nil { t.Fatal(err) } - intent2 := roachpb.MakeIntent(&txn2, roachpb.Span{Key: testKey2}) + intent2 := roachpb.MakeLockUpdate(&txn2, roachpb.Span{Key: testKey2}) intent2.Status = roachpb.ABORTED if _, err := MVCCResolveWriteIntent(ctx, e, nil, intent2); err != nil { t.Fatal(err) diff --git a/pkg/storage/engine/mvcc_logical_ops_test.go b/pkg/storage/engine/mvcc_logical_ops_test.go index 21a27bfb4dfb..82de60c5e6cd 100644 --- a/pkg/storage/engine/mvcc_logical_ops_test.go +++ b/pkg/storage/engine/mvcc_logical_ops_test.go @@ -76,14 +76,14 @@ func TestMVCCOpLogWriter(t *testing.T) { txn1CommitTS := *txn1Commit txn1CommitTS.WriteTimestamp = hlc.Timestamp{Logical: 4} if _, _, err := MVCCResolveWriteIntentRange(ctx, ol, nil, - roachpb.MakeIntent( + roachpb.MakeLockUpdate( &txn1CommitTS, roachpb.Span{Key: testKey1, EndKey: testKey2.Next()}), math.MaxInt64); err != nil { t.Fatal(err) } if _, _, err := MVCCResolveWriteIntentRange(ctx, ol, nil, - roachpb.MakeIntent( + roachpb.MakeLockUpdate( &txn1CommitTS, roachpb.Span{Key: localKey, EndKey: localKey.Next()}), math.MaxInt64); err != nil { @@ -98,14 +98,14 @@ func TestMVCCOpLogWriter(t *testing.T) { txn2Pushed := *txn2 txn2Pushed.WriteTimestamp = hlc.Timestamp{Logical: 6} if _, err := MVCCResolveWriteIntent(ctx, ol, nil, - roachpb.MakeIntent(&txn2Pushed, roachpb.Span{Key: testKey3}), + roachpb.MakeLockUpdate(&txn2Pushed, roachpb.Span{Key: testKey3}), ); err != nil { t.Fatal(err) } txn2Abort := txn2Pushed txn2Abort.Status = roachpb.ABORTED if _, err := MVCCResolveWriteIntent(ctx, ol, nil, - roachpb.MakeIntent(&txn2Abort, roachpb.Span{Key: testKey3}), + roachpb.MakeLockUpdate(&txn2Abort, roachpb.Span{Key: testKey3}), ); err != nil { t.Fatal(err) } diff --git a/pkg/storage/engine/mvcc_stats_test.go b/pkg/storage/engine/mvcc_stats_test.go index d045fcddb448..28f3e82ca319 100644 --- a/pkg/storage/engine/mvcc_stats_test.go +++ b/pkg/storage/engine/mvcc_stats_test.go @@ -113,7 +113,7 @@ func TestMVCCStatsDeleteCommitMovesTimestamp(t *testing.T) { txn.Status = roachpb.COMMITTED txn.WriteTimestamp.Forward(ts4) if _, err := MVCCResolveWriteIntent(ctx, engine, aggMS, - roachpb.MakeIntent(txn, roachpb.Span{Key: key}), + roachpb.MakeLockUpdate(txn, roachpb.Span{Key: key}), ); err != nil { t.Fatal(err) } @@ -193,7 +193,7 @@ func TestMVCCStatsPutCommitMovesTimestamp(t *testing.T) { txn.Status = roachpb.COMMITTED txn.WriteTimestamp.Forward(ts4) if _, err := MVCCResolveWriteIntent(ctx, engine, aggMS, - roachpb.MakeIntent(txn, roachpb.Span{Key: key}), + roachpb.MakeLockUpdate(txn, roachpb.Span{Key: key}), ); err != nil { t.Fatal(err) } @@ -271,7 +271,7 @@ func TestMVCCStatsPutPushMovesTimestamp(t *testing.T) { ts4 := hlc.Timestamp{WallTime: 4 * 1e9} txn.WriteTimestamp.Forward(ts4) if _, err := MVCCResolveWriteIntent(ctx, engine, aggMS, - roachpb.MakeIntent(txn, roachpb.Span{Key: key}), + roachpb.MakeLockUpdate(txn, roachpb.Span{Key: key}), ); err != nil { t.Fatal(err) } @@ -606,7 +606,7 @@ func TestMVCCStatsDelDelCommitMovesTimestamp(t *testing.T) { txnCommit.Status = roachpb.COMMITTED txnCommit.WriteTimestamp.Forward(ts3) if _, err := MVCCResolveWriteIntent(ctx, engine, &aggMS, - roachpb.MakeIntent(txnCommit, roachpb.Span{Key: key}), + roachpb.MakeLockUpdate(txnCommit, roachpb.Span{Key: key}), ); err != nil { t.Fatal(err) } @@ -635,7 +635,7 @@ func TestMVCCStatsDelDelCommitMovesTimestamp(t *testing.T) { txnAbort.Status = roachpb.ABORTED txnAbort.WriteTimestamp.Forward(ts3) if _, err := MVCCResolveWriteIntent(ctx, engine, &aggMS, - roachpb.MakeIntent(txnAbort, roachpb.Span{Key: key}), + roachpb.MakeLockUpdate(txnAbort, roachpb.Span{Key: key}), ); err != nil { t.Fatal(err) } @@ -765,7 +765,7 @@ func TestMVCCStatsPutDelPutMovesTimestamp(t *testing.T) { txnAbort := txn.Clone() txnAbort.Status = roachpb.ABORTED // doesn't change m2ValSize, fortunately if _, err := MVCCResolveWriteIntent(ctx, engine, &aggMS, - roachpb.MakeIntent(txnAbort, roachpb.Span{Key: key}), + roachpb.MakeLockUpdate(txnAbort, roachpb.Span{Key: key}), ); err != nil { t.Fatal(err) } @@ -1236,7 +1236,7 @@ func TestMVCCStatsTxnSysPutAbort(t *testing.T) { // Now abort the intent. txn.Status = roachpb.ABORTED if _, err := MVCCResolveWriteIntent(ctx, engine, aggMS, - roachpb.MakeIntent(txn, roachpb.Span{Key: key}), + roachpb.MakeLockUpdate(txn, roachpb.Span{Key: key}), ); err != nil { t.Fatal(err) } @@ -1339,14 +1339,14 @@ type state struct { key roachpb.Key } -func (s *state) intent(status roachpb.TransactionStatus) roachpb.Intent { - intent := roachpb.MakeIntent(s.Txn, roachpb.Span{Key: s.key}) +func (s *state) intent(status roachpb.TransactionStatus) roachpb.LockUpdate { + intent := roachpb.MakeLockUpdate(s.Txn, roachpb.Span{Key: s.key}) intent.Status = status return intent } -func (s *state) intentRange(status roachpb.TransactionStatus) roachpb.Intent { - intent := roachpb.MakeIntent(s.Txn, roachpb.Span{Key: roachpb.KeyMin, EndKey: roachpb.KeyMax}) +func (s *state) intentRange(status roachpb.TransactionStatus) roachpb.LockUpdate { + intent := roachpb.MakeLockUpdate(s.Txn, roachpb.Span{Key: roachpb.KeyMin, EndKey: roachpb.KeyMax}) intent.Status = status return intent } diff --git a/pkg/storage/engine/mvcc_test.go b/pkg/storage/engine/mvcc_test.go index 5bad412e7c54..b22c3735803b 100644 --- a/pkg/storage/engine/mvcc_test.go +++ b/pkg/storage/engine/mvcc_test.go @@ -1020,8 +1020,8 @@ func TestMVCCScanWriteIntentError(t *testing.T) { consistent: true, txn: nil, expIntents: []roachpb.Intent{ - {Span: roachpb.Span{Key: testKey1}, Txn: txn1ts.TxnMeta}, - {Span: roachpb.Span{Key: testKey4}, Txn: txn2ts.TxnMeta}, + roachpb.MakeIntent(&txn1ts.TxnMeta, testKey1), + roachpb.MakeIntent(&txn2ts.TxnMeta, testKey4), }, // would be []roachpb.KeyValue{fixtureKVs[3], fixtureKVs[4]} without WriteIntentError expValues: nil, @@ -1030,7 +1030,7 @@ func TestMVCCScanWriteIntentError(t *testing.T) { consistent: true, txn: txn1ts, expIntents: []roachpb.Intent{ - {Span: roachpb.Span{Key: testKey4}, Txn: txn2ts.TxnMeta}, + roachpb.MakeIntent(&txn2ts.TxnMeta, testKey4), }, expValues: nil, // []roachpb.KeyValue{fixtureKVs[2], fixtureKVs[3], fixtureKVs[4]}, }, @@ -1038,7 +1038,7 @@ func TestMVCCScanWriteIntentError(t *testing.T) { consistent: true, txn: txn2ts, expIntents: []roachpb.Intent{ - {Span: roachpb.Span{Key: testKey1}, Txn: txn1ts.TxnMeta}, + roachpb.MakeIntent(&txn1ts.TxnMeta, testKey1), }, expValues: nil, // []roachpb.KeyValue{fixtureKVs[3], fixtureKVs[4], fixtureKVs[5]}, }, @@ -1046,8 +1046,8 @@ func TestMVCCScanWriteIntentError(t *testing.T) { consistent: false, txn: nil, expIntents: []roachpb.Intent{ - {Span: roachpb.Span{Key: testKey1}, Txn: txn1ts.TxnMeta}, - {Span: roachpb.Span{Key: testKey4}, Txn: txn2ts.TxnMeta}, + roachpb.MakeIntent(&txn1ts.TxnMeta, testKey1), + roachpb.MakeIntent(&txn2ts.TxnMeta, testKey4), }, expValues: []roachpb.KeyValue{fixtureKVs[0], fixtureKVs[3], fixtureKVs[4], fixtureKVs[1]}, }, @@ -1741,8 +1741,8 @@ func TestMVCCScanInconsistent(t *testing.T) { } expIntents := []roachpb.Intent{ - {Span: roachpb.Span{Key: testKey1}, Txn: txn1ts2.TxnMeta}, - {Span: roachpb.Span{Key: testKey3}, Txn: txn2ts5.TxnMeta}, + roachpb.MakeIntent(&txn1ts2.TxnMeta, testKey1), + roachpb.MakeIntent(&txn2ts5.TxnMeta, testKey3), } res, err := MVCCScan( ctx, engine, testKey1, testKey4.Next(), math.MaxInt64, hlc.Timestamp{WallTime: 7}, @@ -2800,7 +2800,7 @@ func TestMVCCInitPutWithTxn(t *testing.T) { txnCommit.Status = roachpb.COMMITTED txnCommit.WriteTimestamp = clock.Now().Add(1, 0) if _, err := MVCCResolveWriteIntent(ctx, engine, nil, - roachpb.MakeIntent(&txnCommit, roachpb.Span{Key: testKey1})); err != nil { + roachpb.MakeLockUpdate(&txnCommit, roachpb.Span{Key: testKey1})); err != nil { t.Fatal(err) } @@ -3115,7 +3115,7 @@ func TestMVCCResolveTxn(t *testing.T) { // Resolve will write with txn1's timestamp which is 0,1. if _, err := MVCCResolveWriteIntent(ctx, engine, nil, - roachpb.MakeIntent(txn1Commit, roachpb.Span{Key: testKey1})); err != nil { + roachpb.MakeLockUpdate(txn1Commit, roachpb.Span{Key: testKey1})); err != nil { t.Fatal(err) } @@ -3157,7 +3157,7 @@ func TestMVCCResolveNewerIntent(t *testing.T) { // Resolve will succeed but should remove the intent. if _, err := MVCCResolveWriteIntent(ctx, engine, nil, - roachpb.MakeIntent(txn1Commit, roachpb.Span{Key: testKey1})); err != nil { + roachpb.MakeLockUpdate(txn1Commit, roachpb.Span{Key: testKey1})); err != nil { t.Fatal(err) } @@ -3194,7 +3194,7 @@ func TestMVCCResolveIntentTxnTimestampMismatch(t *testing.T) { // the intent sits at tsEarly. The bug was looking at the former // instead of the latter (and so we could also tickle it with // smaller timestamps in Txn). - intent := roachpb.MakeIntent(txn, roachpb.Span{Key: testKey1}) + intent := roachpb.MakeLockUpdate(txn, roachpb.Span{Key: testKey1}) intent.Status = roachpb.PENDING // A bug (see #7654) caused intents to just stay where they were instead @@ -3417,7 +3417,7 @@ func TestMVCCAbortTxn(t *testing.T) { txn1AbortWithTS.WriteTimestamp = hlc.Timestamp{Logical: 1} if _, err := MVCCResolveWriteIntent(ctx, engine, nil, - roachpb.MakeIntent(txn1AbortWithTS, roachpb.Span{Key: testKey1}), + roachpb.MakeLockUpdate(txn1AbortWithTS, roachpb.Span{Key: testKey1}), ); err != nil { t.Fatal(err) } @@ -3462,7 +3462,7 @@ func TestMVCCAbortTxnWithPreviousVersion(t *testing.T) { txn1AbortWithTS.WriteTimestamp = hlc.Timestamp{WallTime: 2} if _, err := MVCCResolveWriteIntent(ctx, engine, nil, - roachpb.MakeIntent(txn1AbortWithTS, roachpb.Span{Key: testKey1}), + roachpb.MakeLockUpdate(txn1AbortWithTS, roachpb.Span{Key: testKey1}), ); err != nil { t.Fatal(err) } @@ -3530,7 +3530,7 @@ func TestMVCCWriteWithDiffTimestampsAndEpochs(t *testing.T) { txne2Commit.Status = roachpb.COMMITTED txne2Commit.WriteTimestamp = hlc.Timestamp{WallTime: 1} if _, err := MVCCResolveWriteIntent(ctx, engine, nil, - roachpb.MakeIntent(&txne2Commit, roachpb.Span{Key: testKey1})); err != nil { + roachpb.MakeLockUpdate(&txne2Commit, roachpb.Span{Key: testKey1})); err != nil { t.Fatal(err) } @@ -3860,7 +3860,7 @@ func TestMVCCGetWithPushedTimestamp(t *testing.T) { // Resolve the intent, pushing its timestamp forward. txn := makeTxn(*txn1, hlc.Timestamp{WallTime: 1}) if _, err := MVCCResolveWriteIntent(ctx, engine, nil, - roachpb.MakeIntent(txn, roachpb.Span{Key: testKey1})); err != nil { + roachpb.MakeLockUpdate(txn, roachpb.Span{Key: testKey1})); err != nil { t.Fatal(err) } // Attempt to read using naive txn's previous timestamp. @@ -3892,7 +3892,7 @@ func TestMVCCResolveWithDiffEpochs(t *testing.T) { t.Fatal(err) } num, _, err := MVCCResolveWriteIntentRange(ctx, engine, nil, - roachpb.MakeIntent(txn1e2Commit, roachpb.Span{Key: testKey1, EndKey: testKey2.Next()}), 2) + roachpb.MakeLockUpdate(txn1e2Commit, roachpb.Span{Key: testKey1, EndKey: testKey2.Next()}), 2) if err != nil { t.Fatal(err) } @@ -3948,7 +3948,7 @@ func TestMVCCResolveWithUpdatedTimestamp(t *testing.T) { // intent when making it permanent. txn := makeTxn(*txn1Commit, hlc.Timestamp{WallTime: 1}) if _, err = MVCCResolveWriteIntent(ctx, engine, nil, - roachpb.MakeIntent(txn, roachpb.Span{Key: testKey1})); err != nil { + roachpb.MakeLockUpdate(txn, roachpb.Span{Key: testKey1})); err != nil { t.Fatal(err) } @@ -3999,7 +3999,7 @@ func TestMVCCResolveWithPushedTimestamp(t *testing.T) { // This represents a straightforward push (i.e. from a read/write conflict). txn := makeTxn(*txn1, hlc.Timestamp{WallTime: 1}) if _, err = MVCCResolveWriteIntent(ctx, engine, nil, - roachpb.MakeIntent(txn, roachpb.Span{Key: testKey1})); err != nil { + roachpb.MakeLockUpdate(txn, roachpb.Span{Key: testKey1})); err != nil { t.Fatal(err) } @@ -4037,7 +4037,7 @@ func TestMVCCResolveTxnNoOps(t *testing.T) { // Resolve a non existent key; noop. if _, err := MVCCResolveWriteIntent(ctx, engine, nil, - roachpb.MakeIntent(txn1Commit, roachpb.Span{Key: testKey1})); err != nil { + roachpb.MakeLockUpdate(txn1Commit, roachpb.Span{Key: testKey1})); err != nil { t.Fatal(err) } @@ -4046,7 +4046,7 @@ func TestMVCCResolveTxnNoOps(t *testing.T) { t.Fatal(err) } if _, err := MVCCResolveWriteIntent(ctx, engine, nil, - roachpb.MakeIntent(txn2Commit, roachpb.Span{Key: testKey1})); err != nil { + roachpb.MakeLockUpdate(txn2Commit, roachpb.Span{Key: testKey1})); err != nil { t.Fatal(err) } @@ -4058,7 +4058,7 @@ func TestMVCCResolveTxnNoOps(t *testing.T) { txn1CommitWithTS := txn2Commit.Clone() txn1CommitWithTS.WriteTimestamp = hlc.Timestamp{WallTime: 1} if _, err := MVCCResolveWriteIntent(ctx, engine, nil, - roachpb.MakeIntent(txn1CommitWithTS, roachpb.Span{Key: testKey2})); err != nil { + roachpb.MakeLockUpdate(txn1CommitWithTS, roachpb.Span{Key: testKey2})); err != nil { t.Fatal(err) } }) @@ -4088,7 +4088,7 @@ func TestMVCCResolveTxnRange(t *testing.T) { } num, resumeSpan, err := MVCCResolveWriteIntentRange(ctx, engine, nil, - roachpb.MakeIntent(txn1Commit, roachpb.Span{Key: testKey1, EndKey: testKey4.Next()}), + roachpb.MakeLockUpdate(txn1Commit, roachpb.Span{Key: testKey1, EndKey: testKey4.Next()}), math.MaxInt64) if err != nil { t.Fatal(err) @@ -4172,7 +4172,7 @@ func TestMVCCResolveTxnRangeResume(t *testing.T) { // Resolve up to 5 intents. num, resumeSpan, err := MVCCResolveWriteIntentRange(ctx, engine, nil, - roachpb.MakeIntent(txn1Commit, roachpb.Span{Key: roachpb.Key("00"), EndKey: roachpb.Key("30")}), + roachpb.MakeLockUpdate(txn1Commit, roachpb.Span{Key: roachpb.Key("00"), EndKey: roachpb.Key("30")}), 5) if err != nil { t.Fatal(err) @@ -4929,7 +4929,7 @@ func TestResolveIntentWithLowerEpoch(t *testing.T) { } // Resolve the intent with a low epoch. if _, err := MVCCResolveWriteIntent(ctx, engine, nil, - roachpb.MakeIntent(txn1, roachpb.Span{Key: testKey1})); err != nil { + roachpb.MakeLockUpdate(txn1, roachpb.Span{Key: testKey1})); err != nil { t.Fatal(err) } diff --git a/pkg/storage/engine/testdata/mvcc_histories/update_existing_key_diff_txn b/pkg/storage/engine/testdata/mvcc_histories/update_existing_key_diff_txn index b0d4b5eb29a5..3d54be2bb6be 100644 --- a/pkg/storage/engine/testdata/mvcc_histories/update_existing_key_diff_txn +++ b/pkg/storage/engine/testdata/mvcc_histories/update_existing_key_diff_txn @@ -21,5 +21,5 @@ run ok with t=B get k=a inconsistent ---- -get: "a" -> intent {id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000033,0 min=0,0 seq=0} PENDING +get: "a" -> intent {id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000033,0 min=0,0 seq=0} get: "a" -> diff --git a/pkg/storage/gc/gc.go b/pkg/storage/gc/gc.go index 1e118aa5d314..9309bd5d5a5c 100644 --- a/pkg/storage/gc/gc.go +++ b/pkg/storage/gc/gc.go @@ -25,6 +25,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/keys" "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/cockroach/pkg/storage/abortspan" + "github.com/cockroachdb/cockroach/pkg/storage/concurrency/lock" "github.com/cockroachdb/cockroach/pkg/storage/engine" "github.com/cockroachdb/cockroach/pkg/storage/engine/enginepb" "github.com/cockroachdb/cockroach/pkg/storage/storagebase" @@ -134,7 +135,7 @@ type CleanupIntentsFunc func(context.Context, []roachpb.Intent) error // transaction record, pushing the transaction first if it is // PENDING. Once all intents are resolved successfully, removes the // transaction record. -type CleanupTxnIntentsAsyncFunc func(context.Context, *roachpb.Transaction, []roachpb.Intent) error +type CleanupTxnIntentsAsyncFunc func(context.Context, *roachpb.Transaction, []roachpb.LockUpdate) error // Run runs garbage collection for the specified descriptor on the // provided Engine (which is not mutated). It uses the provided gcFn @@ -169,8 +170,8 @@ func Run( // Maps from txn ID to txn and intent key slice. txnMap := map[uuid.UUID]*roachpb.Transaction{} - intentSpanMap := map[uuid.UUID][]roachpb.Span{} - err := processReplicatedKeyRange(ctx, desc, snap, now, newThreshold, gcer, txnMap, intentSpanMap, &info) + intentKeyMap := map[uuid.UUID][]roachpb.Key{} + err := processReplicatedKeyRange(ctx, desc, snap, now, newThreshold, gcer, txnMap, intentKeyMap, &info) if err != nil { return Info{}, err } @@ -199,7 +200,7 @@ func Run( // Push transactions (if pending) and resolve intents. var intents []roachpb.Intent for txnID, txn := range txnMap { - intents = append(intents, roachpb.AsIntents(intentSpanMap[txnID], txn)...) + intents = append(intents, roachpb.AsIntents(&txn.TxnMeta, intentKeyMap[txnID])...) } info.ResolveTotal += len(intents) log.Eventf(ctx, "cleanup of %d intents", len(intents)) @@ -214,7 +215,7 @@ func Run( // remove it. // // The logic iterates all versions of all keys in the range from oldest to -// newest. Expired intents are written into the txnMap and intentSpanMap. +// newest. Expired intents are written into the txnMap and intentKeyMap. func processReplicatedKeyRange( ctx context.Context, desc *roachpb.RangeDescriptor, @@ -223,7 +224,7 @@ func processReplicatedKeyRange( threshold hlc.Timestamp, gcer GCer, txnMap map[uuid.UUID]*roachpb.Transaction, - intentSpanMap map[uuid.UUID][]roachpb.Span, + intentKeyMap map[uuid.UUID][]roachpb.Key, info *Info, ) error { var alloc bufalloc.ByteAllocator @@ -257,9 +258,7 @@ func processReplicatedKeyRange( } info.IntentsConsidered++ alloc, md.Key.Key = alloc.Copy(md.Key.Key, 0) - intentSpanMap[txnID] = append(intentSpanMap[txnID], roachpb.Span{ - Key: md.Key.Key, - }) + intentKeyMap[txnID] = append(intentKeyMap[txnID], md.Key.Key) } } } @@ -406,7 +405,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.IntentSpans) > 0 { - return cleanupTxnIntentsAsyncFn(ctx, txn, roachpb.AsIntents(txn.IntentSpans, txn)) + return cleanupTxnIntentsAsyncFn(ctx, txn, roachpb.AsLockUpdates(txn, txn.IntentSpans, lock.Replicated)) } gcKeys = append(gcKeys, roachpb.GCRequest_GCKey{Key: key}) // zero timestamp return nil diff --git a/pkg/storage/gc/gc_old_test.go b/pkg/storage/gc/gc_old_test.go index 036bcb1c88fc..a586f220eacb 100644 --- a/pkg/storage/gc/gc_old_test.go +++ b/pkg/storage/gc/gc_old_test.go @@ -82,7 +82,7 @@ func runGCOld( // Maps from txn ID to txn and intent key slice. txnMap := map[uuid.UUID]*roachpb.Transaction{} - intentSpanMap := map[uuid.UUID][]roachpb.Span{} + intentKeyMap := map[uuid.UUID][]roachpb.Key{} // processKeysAndValues is invoked with each key and its set of // values. Intents older than the intent age threshold are sent for @@ -119,7 +119,7 @@ func runGCOld( info.PushTxn++ } info.IntentsConsidered++ - intentSpanMap[txnID] = append(intentSpanMap[txnID], roachpb.Span{Key: expBaseKey}) + intentKeyMap[txnID] = append(intentKeyMap[txnID], expBaseKey) } // With an active intent, GC ignores MVCC metadata & intent value. startIdx = 2 @@ -237,7 +237,7 @@ func runGCOld( // Push transactions (if pending) and resolve intents. var intents []roachpb.Intent for txnID, txn := range txnMap { - intents = append(intents, roachpb.AsIntents(intentSpanMap[txnID], txn)...) + intents = append(intents, roachpb.AsIntents(&txn.TxnMeta, intentKeyMap[txnID])...) } info.ResolveTotal += len(intents) log.Eventf(ctx, "cleanup of %d intents", len(intents)) diff --git a/pkg/storage/gc/gc_random_test.go b/pkg/storage/gc/gc_random_test.go index 9b4291bd7fde..7519fca910b1 100644 --- a/pkg/storage/gc/gc_random_test.go +++ b/pkg/storage/gc/gc_random_test.go @@ -136,7 +136,7 @@ func BenchmarkRun(b *testing.B) { func(ctx context.Context, intents []roachpb.Intent) error { return nil }, - func(ctx context.Context, txn *roachpb.Transaction, intents []roachpb.Intent) error { + func(ctx context.Context, txn *roachpb.Transaction, intents []roachpb.LockUpdate) error { return nil }) } @@ -206,7 +206,7 @@ func (f *fakeGCer) GC(ctx context.Context, keys []roachpb.GCRequest_GCKey) error } func (f *fakeGCer) resolveIntentsAsync( - _ context.Context, txn *roachpb.Transaction, intents []roachpb.Intent, + _ context.Context, txn *roachpb.Transaction, intents []roachpb.LockUpdate, ) error { f.txnIntents = append(f.txnIntents, txnIntents{txn: txn, intents: intents}) return nil @@ -244,5 +244,5 @@ func intentLess(a, b *roachpb.Intent) bool { type txnIntents struct { txn *roachpb.Transaction - intents []roachpb.Intent + intents []roachpb.LockUpdate } diff --git a/pkg/storage/gc_queue.go b/pkg/storage/gc_queue.go index 2b516ba704f6..00aac943c3bc 100644 --- a/pkg/storage/gc_queue.go +++ b/pkg/storage/gc_queue.go @@ -426,7 +426,7 @@ func (gcq *gcQueue) process(ctx context.Context, repl *Replica, sysCfg *config.S } return err }, - func(ctx context.Context, txn *roachpb.Transaction, intents []roachpb.Intent) error { + func(ctx context.Context, txn *roachpb.Transaction, intents []roachpb.LockUpdate) error { err := repl.store.intentResolver. CleanupTxnIntentsOnGCAsync(ctx, repl.RangeID, txn, intents, gcTimestamp, func(pushed, succeeded bool) { diff --git a/pkg/storage/gc_queue_test.go b/pkg/storage/gc_queue_test.go index d4b825f0d0e3..eb768168bcfd 100644 --- a/pkg/storage/gc_queue_test.go +++ b/pkg/storage/gc_queue_test.go @@ -516,7 +516,7 @@ func TestGCQueueProcess(t *testing.T) { func(ctx context.Context, intents []roachpb.Intent) error { return nil }, - func(ctx context.Context, txn *roachpb.Transaction, intents []roachpb.Intent) error { + func(ctx context.Context, txn *roachpb.Transaction, intents []roachpb.LockUpdate) error { return nil }) }() diff --git a/pkg/storage/intentresolver/contention_queue.go b/pkg/storage/intentresolver/contention_queue.go index 6a65fddb6d42..ef67e656af83 100644 --- a/pkg/storage/intentresolver/contention_queue.go +++ b/pkg/storage/intentresolver/contention_queue.go @@ -159,7 +159,7 @@ func (cq *contentionQueue) add( return nil, wiErr, false, nil } intent := wiErr.Intents[0] - key := string(intent.Span.Key) + key := string(intent.Key) curPusher := newPusher(h.Txn) log.VEventf(ctx, 3, "adding %s to contention queue on intent %s @%s", txnID(h.Txn), intent.Key, intent.Txn.ID.Short()) @@ -221,7 +221,7 @@ func (cq *contentionQueue) add( log.VEventf(ctx, 3, "%s exiting contention queue to push %s", txnID(curPusher.txn), txnMeta.ID.Short()) wiErrCopy := *wiErr wiErrCopy.Intents = []roachpb.Intent{ - roachpb.MakePendingIntent(txnMeta, intent.Span), + roachpb.MakeIntent(txnMeta, intent.Key), } wiErr = &wiErrCopy } else { @@ -319,7 +319,7 @@ func (cq *contentionQueue) add( // make sure that we don't pollute the old contendedKey with any // new information. if newWIErr != nil { - sameKey := len(newWIErr.Intents) == 1 && newWIErr.Intents[0].Span.Equal(intent.Span) + sameKey := len(newWIErr.Intents) == 1 && newWIErr.Intents[0].Key.Equal(intent.Key) if sameKey { newIntentTxn = &newWIErr.Intents[0].Txn } else { diff --git a/pkg/storage/intentresolver/intent_resolver.go b/pkg/storage/intentresolver/intent_resolver.go index 2af81a136cbe..d34a62beb55c 100644 --- a/pkg/storage/intentresolver/intent_resolver.go +++ b/pkg/storage/intentresolver/intent_resolver.go @@ -22,6 +22,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/kv/kvbase" "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/cockroach/pkg/storage/batcheval/result" + "github.com/cockroachdb/cockroach/pkg/storage/concurrency/lock" "github.com/cockroachdb/cockroach/pkg/storage/engine/enginepb" "github.com/cockroachdb/cockroach/pkg/storage/storagebase" "github.com/cockroachdb/cockroach/pkg/storage/txnwait" @@ -250,7 +251,7 @@ func (ir *IntentResolver) ProcessWriteIntentError( // Possibly queue this processing if the write intent error is for a // single intent affecting a unitary key. var cleanup func(*roachpb.WriteIntentError, *enginepb.TxnMeta) - if len(wiErr.Intents) == 1 && len(wiErr.Intents[0].Span.EndKey) == 0 { + if len(wiErr.Intents) == 1 { var done bool var pErr *roachpb.Error // Note that the write intent error may be mutated here in the event @@ -331,18 +332,11 @@ func (ir *IntentResolver) maybePushIntents( h roachpb.Header, pushType roachpb.PushTxnType, skipIfInFlight bool, -) ([]roachpb.Intent, *roachpb.Error) { +) ([]roachpb.LockUpdate, *roachpb.Error) { // Attempt to push the transaction(s) which created the conflicting intent(s). pushTxns := make(map[uuid.UUID]*enginepb.TxnMeta) for i := range intents { intent := &intents[i] - if intent.Status != roachpb.PENDING { - // The current intent does not need conflict resolution - // 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) - } pushTxns[intent.Txn.ID] = &intent.Txn } @@ -363,8 +357,8 @@ func updateIntentTxnStatus( pushedTxns map[uuid.UUID]roachpb.Transaction, intents []roachpb.Intent, skipIfInFlight bool, - results []roachpb.Intent, -) []roachpb.Intent { + results []roachpb.LockUpdate, +) []roachpb.LockUpdate { for _, intent := range intents { pushee, ok := pushedTxns[intent.Txn.ID] if !ok { @@ -375,8 +369,8 @@ func updateIntentTxnStatus( // It must have been skipped. continue } - intent.SetTxn(&pushee) - results = append(results, intent) + up := roachpb.MakeLockUpdateWithDur(&pushee, roachpb.Span{Key: intent.Key}, lock.Replicated) + results = append(results, up) } return results } @@ -559,6 +553,7 @@ func (ir *IntentResolver) CleanupIntents( resolved := 0 const skipIfInFlight = true pushTxns := make(map[uuid.UUID]*enginepb.TxnMeta) + var resolveIntents []roachpb.LockUpdate for unpushed := intents; len(unpushed) > 0; { for k := range pushTxns { // clear the pushTxns map delete(pushTxns, k) @@ -579,8 +574,8 @@ func (ir *IntentResolver) CleanupIntents( if pErr != nil { return 0, errors.Wrapf(pErr.GoError(), "failed to push during intent resolution") } - resolveIntents := updateIntentTxnStatus(ctx, pushedTxns, unpushed[:i], - skipIfInFlight, unpushed[:0]) + resolveIntents = updateIntentTxnStatus(ctx, pushedTxns, unpushed[:i], + skipIfInFlight, resolveIntents[:0]) // resolveIntents with poison=true because we're resolving // intents outside of the context of an EndTxn. // @@ -627,7 +622,7 @@ func (ir *IntentResolver) CleanupTxnIntentsAsync( return } defer release() - intents := roachpb.AsIntents(et.Txn.IntentSpans, et.Txn) + intents := roachpb.AsLockUpdates(et.Txn, et.Txn.IntentSpans, lock.Replicated) 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) @@ -672,7 +667,7 @@ func (ir *IntentResolver) CleanupTxnIntentsOnGCAsync( ctx context.Context, rangeID roachpb.RangeID, txn *roachpb.Transaction, - intents []roachpb.Intent, + intents []roachpb.LockUpdate, now hlc.Timestamp, onComplete func(pushed, succeeded bool), ) error { @@ -807,7 +802,7 @@ func (ir *IntentResolver) cleanupFinishedTxnIntents( ctx context.Context, rangeID roachpb.RangeID, txn *roachpb.Transaction, - intents []roachpb.Intent, + intents []roachpb.LockUpdate, now hlc.Timestamp, poison bool, onComplete func(error), @@ -882,14 +877,14 @@ func (ir *IntentResolver) lookupRangeID(ctx context.Context, key roachpb.Key) ro // ResolveIntent synchronously resolves an intent according to opts. func (ir *IntentResolver) ResolveIntent( - ctx context.Context, intent roachpb.Intent, opts ResolveOptions, + ctx context.Context, intent roachpb.LockUpdate, opts ResolveOptions, ) *roachpb.Error { - return ir.ResolveIntents(ctx, []roachpb.Intent{intent}, opts) + return ir.ResolveIntents(ctx, []roachpb.LockUpdate{intent}, opts) } // ResolveIntents synchronously resolves intents according to opts. func (ir *IntentResolver) ResolveIntents( - ctx context.Context, intents []roachpb.Intent, opts ResolveOptions, + ctx context.Context, intents []roachpb.LockUpdate, opts ResolveOptions, ) *roachpb.Error { if len(intents) == 0 { return nil diff --git a/pkg/storage/intentresolver/intent_resolver_test.go b/pkg/storage/intentresolver/intent_resolver_test.go index 2d214a81e6ee..39dcd4f4ceab 100644 --- a/pkg/storage/intentresolver/intent_resolver_test.go +++ b/pkg/storage/intentresolver/intent_resolver_test.go @@ -37,45 +37,6 @@ import ( "github.com/stretchr/testify/assert" ) -// TestPushTransactionsWithNonPendingIntent verifies that maybePushIntents -// returns an error when a non-pending intent is passed. -func TestPushTransactionsWithNonPendingIntent(t *testing.T) { - defer leaktest.AfterTest(t)() - clock := hlc.NewClock(hlc.UnixNano, time.Nanosecond) - db := client.NewDB(log.AmbientContext{ - Tracer: tracing.NewTracer(), - }, client.NonTransactionalFactoryFunc(func(context.Context, roachpb.BatchRequest) ( - *roachpb.BatchResponse, *roachpb.Error) { - return nil, nil - }), clock) - stopper := stop.NewStopper() - defer stopper.Stop(context.Background()) - ir := New(Config{ - Stopper: stopper, - DB: db, - Clock: clock, - }) - - testCases := [][]roachpb.Intent{ - {{Span: roachpb.Span{Key: roachpb.Key("a")}, Status: roachpb.PENDING}, - {Span: roachpb.Span{Key: roachpb.Key("b")}, Status: roachpb.STAGING}}, - {{Span: roachpb.Span{Key: roachpb.Key("a")}, Status: roachpb.PENDING}, - {Span: roachpb.Span{Key: roachpb.Key("b")}, Status: roachpb.ABORTED}}, - {{Span: roachpb.Span{Key: roachpb.Key("a")}, Status: roachpb.PENDING}, - {Span: roachpb.Span{Key: roachpb.Key("b")}, Status: roachpb.COMMITTED}}, - } - for _, intents := range testCases { - if _, pErr := ir.maybePushIntents( - context.Background(), intents, roachpb.Header{}, roachpb.PUSH_TOUCH, true, - ); !testutils.IsPError(pErr, "unexpected (STAGING|ABORTED|COMMITTED) intent") { - t.Errorf("expected error on non-pending intent, but got %s", pErr) - } - if cnt := len(ir.mu.inFlightPushes); cnt != 0 { - t.Errorf("expected no inflight pushes refcount map entries, found %d", cnt) - } - } -} - // TestCleanupTxnIntentsOnGCAsync exercises the code which is used to // asynchronously clean up transaction intents and then transaction records. // This method is invoked from the storage GC queue. @@ -93,7 +54,7 @@ func TestCleanupTxnIntentsOnGCAsync(t *testing.T) { } type testCase struct { txn *roachpb.Transaction - intents []roachpb.Intent + intents []roachpb.LockUpdate sendFuncs *sendFuncs expectPushed bool expectSucceed bool @@ -147,9 +108,9 @@ func TestCleanupTxnIntentsOnGCAsync(t *testing.T) { // has been pushed but that the garbage collection was not successful. { txn: txn1, - intents: []roachpb.Intent{ - roachpb.MakeIntent(txn1, roachpb.Span{Key: key}), - roachpb.MakeIntent(txn1, roachpb.Span{Key: key, EndKey: roachpb.Key("b")}), + intents: []roachpb.LockUpdate{ + roachpb.MakeLockUpdate(txn1, roachpb.Span{Key: key}), + roachpb.MakeLockUpdate(txn1, roachpb.Span{Key: key, EndKey: roachpb.Key("b")}), }, sendFuncs: newSendFuncs(t, singlePushTxnSendFunc(t), @@ -167,10 +128,10 @@ func TestCleanupTxnIntentsOnGCAsync(t *testing.T) { // that the txn has both been pushed and successfully resolved. { txn: txn1, - intents: []roachpb.Intent{ - roachpb.MakeIntent(txn1, roachpb.Span{Key: key}), - roachpb.MakeIntent(txn1, roachpb.Span{Key: roachpb.Key("aa")}), - roachpb.MakeIntent(txn1, roachpb.Span{Key: key, EndKey: roachpb.Key("b")}), + intents: []roachpb.LockUpdate{ + roachpb.MakeLockUpdate(txn1, roachpb.Span{Key: key}), + roachpb.MakeLockUpdate(txn1, roachpb.Span{Key: roachpb.Key("aa")}), + roachpb.MakeLockUpdate(txn1, roachpb.Span{Key: key, EndKey: roachpb.Key("b")}), }, sendFuncs: func() *sendFuncs { s := newSendFuncs(t) @@ -206,9 +167,9 @@ func TestCleanupTxnIntentsOnGCAsync(t *testing.T) { // has been pushed but that the garbage collection was not successful. { txn: txn3, - intents: []roachpb.Intent{ - roachpb.MakeIntent(txn3, roachpb.Span{Key: key}), - roachpb.MakeIntent(txn3, roachpb.Span{Key: key, EndKey: roachpb.Key("b")}), + intents: []roachpb.LockUpdate{ + roachpb.MakeLockUpdate(txn3, roachpb.Span{Key: key}), + roachpb.MakeLockUpdate(txn3, roachpb.Span{Key: key, EndKey: roachpb.Key("b")}), }, sendFuncs: newSendFuncs(t, singlePushTxnSendFunc(t), @@ -226,10 +187,10 @@ func TestCleanupTxnIntentsOnGCAsync(t *testing.T) { // that the txn has both been pushed and successfully resolved. { txn: txn3, - intents: []roachpb.Intent{ - roachpb.MakeIntent(txn3, roachpb.Span{Key: key}), - roachpb.MakeIntent(txn3, roachpb.Span{Key: roachpb.Key("aa")}), - roachpb.MakeIntent(txn3, roachpb.Span{Key: key, EndKey: roachpb.Key("b")}), + intents: []roachpb.LockUpdate{ + roachpb.MakeLockUpdate(txn3, roachpb.Span{Key: key}), + roachpb.MakeLockUpdate(txn3, roachpb.Span{Key: roachpb.Key("aa")}), + roachpb.MakeLockUpdate(txn3, roachpb.Span{Key: key, EndKey: roachpb.Key("b")}), }, sendFuncs: func() *sendFuncs { s := newSendFuncs(t) @@ -248,7 +209,7 @@ func TestCleanupTxnIntentsOnGCAsync(t *testing.T) { // is no push but that the gc has occurred successfully. { txn: txn4, - intents: []roachpb.Intent{}, + intents: []roachpb.LockUpdate{}, sendFuncs: newSendFuncs(t, gcSendFunc(t)), expectSucceed: true, }, @@ -422,7 +383,7 @@ func TestContendedIntent(t *testing.T) { testCases[i].cancelFunc = cancel t.Run(tc.pusher.ID.String(), func(t *testing.T) { wiErr := &roachpb.WriteIntentError{Intents: []roachpb.Intent{ - roachpb.MakePendingIntent(&origTxn.TxnMeta, roachpb.Span{Key: keyA})}} + roachpb.MakeIntent(&origTxn.TxnMeta, keyA)}} h := roachpb.Header{Txn: tc.pusher} wg.Add(1) go func(idx int) { @@ -498,7 +459,7 @@ func TestContendedIntent(t *testing.T) { } { t.Run(name, func(t *testing.T) { wiErr := &roachpb.WriteIntentError{Intents: []roachpb.Intent{ - roachpb.MakePendingIntent(&origTxn.TxnMeta, roachpb.Span{Key: keyA})}} + roachpb.MakeIntent(&origTxn.TxnMeta, keyA)}} h := roachpb.Header{Txn: pusher} cleanupFunc, pErr := ir.ProcessWriteIntentError(ctx, roachpb.NewError(wiErr), h, roachpb.PUSH_ABORT) if pErr != nil { @@ -527,13 +488,13 @@ func TestContendedIntent(t *testing.T) { // transaction. This should lean to a new push on the new transaction and // an intent resolution of the original intent. f(&roachpb.WriteIntentError{Intents: []roachpb.Intent{ - roachpb.MakePendingIntent(&unrelatedRWTxn.TxnMeta, roachpb.Span{Key: keyA})}}, nil) + roachpb.MakeIntent(&unrelatedRWTxn.TxnMeta, keyA)}}, nil) verifyPushTxn(<-reqChan, rwTxn2.ID, unrelatedRWTxn.ID) verifyResolveIntent(<-reqChan, rwTxn1.Key) case 5: verifyPushTxn(<-reqChan, rwTxn3.ID, unrelatedRWTxn.ID) f(&roachpb.WriteIntentError{Intents: []roachpb.Intent{ - roachpb.MakePendingIntent(&rwTxn1.TxnMeta, roachpb.Span{Key: keyB})}}, nil) + roachpb.MakeIntent(&rwTxn1.TxnMeta, keyB)}}, nil) case 6: f(nil, &testCases[idx].pusher.TxnMeta) default: @@ -574,7 +535,7 @@ func TestCleanupIntentsAsyncThrottled(t *testing.T) { } wg.Wait() testIntents := []roachpb.Intent{ - roachpb.MakeIntent(txn, roachpb.Span{Key: roachpb.Key("a")}), + roachpb.MakeIntent(&txn.TxnMeta, roachpb.Key("a")), } // Running with allowSyncProcessing = false should result in an error and no // requests being sent. @@ -599,7 +560,7 @@ func TestCleanupIntentsAsync(t *testing.T) { clock := hlc.NewClock(hlc.UnixNano, time.Nanosecond) txn := newTransaction("txn", roachpb.Key("a"), 1, clock) testIntents := []roachpb.Intent{ - roachpb.MakeIntent(txn, roachpb.Span{Key: roachpb.Key("a")}), + roachpb.MakeIntent(&txn.TxnMeta, roachpb.Key("a")), } cases := []testCase{ { @@ -649,10 +610,10 @@ func TestCleanupMultipleIntentsAsync(t *testing.T) { txn1 := newTransaction("txn1", roachpb.Key("a"), 1, clock) txn2 := newTransaction("txn2", roachpb.Key("c"), 1, clock) testIntents := []roachpb.Intent{ - {Span: roachpb.Span{Key: roachpb.Key("a")}, Txn: txn1.TxnMeta}, - {Span: roachpb.Span{Key: roachpb.Key("b")}, Txn: txn1.TxnMeta}, - {Span: roachpb.Span{Key: roachpb.Key("c")}, Txn: txn2.TxnMeta}, - {Span: roachpb.Span{Key: roachpb.Key("d")}, Txn: txn2.TxnMeta}, + roachpb.MakeIntent(&txn1.TxnMeta, roachpb.Key("a")), + roachpb.MakeIntent(&txn1.TxnMeta, roachpb.Key("b")), + roachpb.MakeIntent(&txn2.TxnMeta, roachpb.Key("c")), + roachpb.MakeIntent(&txn2.TxnMeta, roachpb.Key("d")), } // We expect to see a single PushTxn req for all four intents and a @@ -991,7 +952,7 @@ func TestCleanupIntents(t *testing.T) { // Set txn.ID to a very small value so it's sorted deterministically first. txn.ID = uuid.UUID{15: 0x01} testIntents := []roachpb.Intent{ - roachpb.MakeIntent(txn, roachpb.Span{Key: roachpb.Key("a")}), + roachpb.MakeIntent(&txn.TxnMeta, roachpb.Key("a")), } type testCase struct { intents []roachpb.Intent @@ -1075,7 +1036,7 @@ func makeTxnIntents(t *testing.T, clock *hlc.Clock, numIntents int) []roachpb.In for i := 0; i < numIntents; i++ { txn := newTransaction("test", roachpb.Key("a"), 1, clock) ret = append(ret, - roachpb.MakeIntent(txn, roachpb.Span{Key: txn.Key})) + roachpb.MakeIntent(&txn.TxnMeta, txn.Key)) } return ret } diff --git a/pkg/storage/replica_test.go b/pkg/storage/replica_test.go index 0a7cad6e215e..d25180be28d2 100644 --- a/pkg/storage/replica_test.go +++ b/pkg/storage/replica_test.go @@ -4284,8 +4284,8 @@ func TestEndTxnRollbackAbortedTransaction(t *testing.T) { } if pErr := tc.store.intentResolver.ResolveIntents(context.TODO(), - []roachpb.Intent{ - roachpb.MakeIntent(&txnRecord, roachpb.Span{Key: key}), + []roachpb.LockUpdate{ + roachpb.MakeLockUpdate(&txnRecord, roachpb.Span{Key: key}), }, intentresolver.ResolveOptions{Wait: true, Poison: true}); pErr != nil { t.Fatal(pErr) } @@ -4981,8 +4981,8 @@ func TestReplicaResolveIntentNoWait(t *testing.T) { txn := newTransaction("name", key, 1, tc.Clock()) txn.Status = roachpb.COMMITTED if pErr := tc.store.intentResolver.ResolveIntents(context.Background(), - []roachpb.Intent{ - roachpb.MakeIntent(txn, roachpb.Span{Key: key}), + []roachpb.LockUpdate{ + roachpb.MakeLockUpdate(txn, roachpb.Span{Key: key}), }, intentresolver.ResolveOptions{Wait: false, Poison: true /* irrelevant */}, ); pErr != nil {