Skip to content

Commit

Permalink
Revert "Prepare common library for locks (ydb-platform#1605)"
Browse files Browse the repository at this point in the history
This reverts commit 48e0cbf.
  • Loading branch information
ivanmorozov333 committed Apr 17, 2024
1 parent ed4a9cb commit 86fba2f
Show file tree
Hide file tree
Showing 57 changed files with 1,462 additions and 414 deletions.
2 changes: 1 addition & 1 deletion ydb/core/client/locks_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <ydb/core/engine/mkql_engine_flat_impl.h>
#include <ydb/core/testlib/test_client.h>
#include <ydb/core/tx/tx_proxy/proxy.h>
#include <ydb/core/tx/locks/locks.h>
#include <ydb/core/tx/datashard/datashard_locks.h>
#include <ydb/public/lib/deprecated/kicli/kicli.h>

#include <library/cpp/testing/unittest/tests_data.h>
Expand Down
2 changes: 1 addition & 1 deletion ydb/core/engine/minikql/minikql_engine_host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <ydb/library/yql/minikql/computation/mkql_custom_list.h>
#include <ydb/library/yql/minikql/mkql_string_util.h>
#include <ydb/library/yql/parser/pg_wrapper/interface/codec.h>
#include <ydb/core/tx/locks/sys_tables.h>
#include <ydb/core/tx/datashard/sys_tables.h>

#include <library/cpp/containers/stack_vector/stack_vec.h>

Expand Down
2 changes: 1 addition & 1 deletion ydb/core/kqp/runtime/kqp_stream_lookup_worker.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <ydb/library/yql/minikql/mkql_node.h>
#include <ydb/library/yql/minikql/computation/mkql_computation_node_holders.h>
#include <ydb/core/scheme/scheme_tabledefs.h>
#include <ydb/core/tx/locks/sys_tables.h>
#include <ydb/core/tx/datashard/sys_tables.h>
#include <ydb/core/tx/datashard/datashard.h>

namespace NKikimr {
Expand Down
1 change: 0 additions & 1 deletion ydb/core/kqp/ut/opt/kqp_ne_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include <ydb/public/sdk/cpp/client/ydb_proto/accessor.h>
#include <ydb/core/kqp/runtime/kqp_read_actor.h>
#include <ydb/core/tx/datashard/datashard_impl.h>

namespace NKikimr::NKqp {

Expand Down
1 change: 0 additions & 1 deletion ydb/core/kqp/ut/scan/kqp_scan_ut.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <ydb/core/kqp/ut/common/kqp_ut_common.h>
#include <ydb/core/kqp/counters/kqp_counters.h>
#include <ydb/core/tx/datashard/datashard_failpoints.h>
#include <ydb/core/tx/datashard/datashard_impl.h>
#include <ydb/core/tx/scheme_cache/scheme_cache.h>

#include <ydb/library/yql/dq/actors/compute/dq_compute_actor.h>
Expand Down
1 change: 0 additions & 1 deletion ydb/core/kqp/ut/scan/kqp_split_ut.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <ydb/core/kqp/ut/common/kqp_ut_common.h>
#include <ydb/core/kqp/counters/kqp_counters.h>
#include <ydb/core/tx/scheme_cache/scheme_cache.h>
#include <ydb/core/tx/datashard/datashard_impl.h>

#include <ydb/core/base/tablet_pipecache.h>
#include <ydb/core/kqp/runtime/kqp_read_actor.h>
Expand Down
2 changes: 1 addition & 1 deletion ydb/core/sys_view/common/schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "path.h"

#include <ydb/core/tablet_flat/flat_cxx_database.h>
#include <ydb/core/tx/locks/sys_tables.h>
#include <ydb/core/tx/datashard/sys_tables.h>

namespace NKikimr {
namespace NSysView {
Expand Down
19 changes: 0 additions & 19 deletions ydb/core/tx/columnshard/columnshard__init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "engines/column_engine_logs.h"
#include "export/manager/manager.h"
#include <ydb/core/tx/columnshard/blobs_action/blob_manager_db.h>
#include <ydb/core/tx/columnshard/transactions/locks_db.h>

#include <ydb/core/tablet/tablet_exception.h>
#include <ydb/core/tx/columnshard/operations/write.h>
Expand Down Expand Up @@ -40,7 +39,6 @@ void TTxInit::SetDefaults() {
Self->LastWriteId = TWriteId{0};
Self->LastPlannedStep = 0;
Self->LastPlannedTxId = 0;
Self->LastCompletedTx = NOlap::TSnapshot::Zero();
Self->OwnerPathId = 0;
Self->OwnerPath.clear();
Self->LongTxWrites.clear();
Expand Down Expand Up @@ -76,14 +74,6 @@ bool TTxInit::Precharge(TTransactionContext& txc) {
ready = ready && Schema::GetSpecialValue(db, Schema::EValueIds::OwnerPathId, Self->OwnerPathId);
ready = ready && Schema::GetSpecialValue(db, Schema::EValueIds::OwnerPath, Self->OwnerPath);

{
ui64 lastCompletedStep = 0;
ui64 lastCompletedTx = 0;
ready = ready && Schema::GetSpecialValue(db, Schema::EValueIds::LastCompletedStep, lastCompletedStep);
ready = ready && Schema::GetSpecialValue(db, Schema::EValueIds::LastCompletedTxId, lastCompletedTx);
Self->LastCompletedTx = NOlap::TSnapshot(lastCompletedStep, lastCompletedTx);
}

if (!ready) {
return false;
}
Expand Down Expand Up @@ -188,15 +178,6 @@ bool TTxInit::ReadEverything(TTransactionContext& txc, const TActorContext& ctx)
}
}
}
{
TMemoryProfileGuard g("TTxInit/LocksDB");
if (txc.DB.GetScheme().GetTableInfo(Schema::Locks::TableId)) {
TColumnShardLocksDb locksDb(*Self, txc);
if (!Self->SysLocks.Load(locksDb)) {
return false;
}
}
}

{
TMemoryProfileGuard g("TTxInit/NDataSharing::TExportsManager");
Expand Down
10 changes: 0 additions & 10 deletions ydb/core/tx/columnshard/columnshard__progress_tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ class TColumnShard::TTxProgressTx : public TTransactionBase<TColumnShard> {
if (!!plannedItem) {
ui64 step = plannedItem->PlanStep;
ui64 txId = plannedItem->TxId;
LastCompletedTx = NOlap::TSnapshot(step, txId);
if (LastCompletedTx > Self->LastCompletedTx) {
NIceDb::TNiceDb db(txc.DB);
Schema::SaveSpecialValue(db, Schema::EValueIds::LastCompletedStep, LastCompletedTx->GetPlanStep());
Schema::SaveSpecialValue(db, Schema::EValueIds::LastCompletedTxId, LastCompletedTx->GetTxId());
}

TxOperator = Self->ProgressTxController->GetVerifiedTxOperator(txId);
AFL_VERIFY(TxOperator->Progress(*Self, NOlap::TSnapshot(step, txId), txc));
Expand All @@ -57,16 +51,12 @@ class TColumnShard::TTxProgressTx : public TTransactionBase<TColumnShard> {
if (TxOperator) {
TxOperator->Complete(*Self, ctx);
}
if (LastCompletedTx) {
Self->LastCompletedTx = std::max(*LastCompletedTx, Self->LastCompletedTx);
}
Self->SetupIndexation();
}

private:
TTxController::ITransactionOperatior::TPtr TxOperator;
const ui32 TabletTxNo;
std::optional<NOlap::TSnapshot> LastCompletedTx;
};

void TColumnShard::EnqueueProgressTx(const TActorContext& ctx) {
Expand Down
1 change: 0 additions & 1 deletion ydb/core/tx/columnshard/columnshard_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ TColumnShard::TColumnShard(TTabletStorageInfo* info, const TActorId& tablet)
, ScanCounters("Scan")
, WritesMonitor(*this)
, NormalizerController(StoragesManager, SubscribeCounters)
, SysLocks(this)
{
TabletCountersPtr.reset(new TProtobufTabletCounters<
ESimpleCounters_descriptor,
Expand Down
34 changes: 0 additions & 34 deletions ydb/core/tx/columnshard/columnshard_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <ydb/core/tx/tiering/common.h>
#include <ydb/core/tx/time_cast/time_cast.h>
#include <ydb/core/tx/tx_processing.h>
#include <ydb/core/tx/locks/locks.h>
#include <ydb/services/metadata/service.h>
#include <ydb/services/metadata/abstract/common.h>

Expand Down Expand Up @@ -282,37 +281,6 @@ class TColumnShard
None /* "none" */
};

void IncCounter(NColumnShard::EPercentileCounters counter, const TDuration& latency) const {
TabletCounters->Percentile()[counter].IncrementFor(latency.MicroSeconds());
}

void IncCounter(NDataShard::ESimpleCounters counter, ui64 num = 1) const {
TabletCounters->Simple()[counter].Add(num);
}

// For syslocks
void IncCounter(NDataShard::ECumulativeCounters counter, ui64 num = 1) const {
TabletCounters->Cumulative()[counter].Increment(num);
}

void IncCounter(NDataShard::EPercentileCounters counter, ui64 num) const {
TabletCounters->Percentile()[counter].IncrementFor(num);
}

void IncCounter(NDataShard::EPercentileCounters counter, const TDuration& latency) const {
TabletCounters->Percentile()[counter].IncrementFor(latency.MilliSeconds());
}

inline TRowVersion LastCompleteTxVersion() const {
return TRowVersion(LastCompletedTx.GetPlanStep(), LastCompletedTx.GetTxId());
}

ui32 Generation() const { return Executor()->Generation(); }

bool IsUserTable(const TTableId&) const {
return true;
}

private:
void OverloadWriteFail(const EOverloadStatus overloadReason, const NEvWrite::TWriteData& writeData, const ui64 cookie, std::unique_ptr<NActors::IEventBase>&& event, const TActorContext& ctx);
EOverloadStatus CheckOverloaded(const ui64 tableId) const;
Expand Down Expand Up @@ -465,7 +433,6 @@ class TColumnShard
TWriteId LastWriteId = TWriteId{0};
ui64 LastPlannedStep = 0;
ui64 LastPlannedTxId = 0;
NOlap::TSnapshot LastCompletedTx = NOlap::TSnapshot::Zero();
ui64 LastExportNo = 0;

ui64 OwnerPathId = 0;
Expand Down Expand Up @@ -513,7 +480,6 @@ class TColumnShard
TSettings Settings;
TLimits Limits;
NOlap::TNormalizationController NormalizerController;
NDataShard::TSysLocks SysLocks;

void TryRegisterMediatorTimeCast();
void UnregisterMediatorTimeCast();
Expand Down
2 changes: 0 additions & 2 deletions ydb/core/tx/columnshard/columnshard_schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ struct Schema : NIceDb::Schema {
LastExportNumber = 10,
OwnerPathId = 11,
OwnerPath = 12,
LastCompletedStep = 13,
LastCompletedTxId = 14,
};

enum class EInsertTableIds : ui8 {
Expand Down
5 changes: 0 additions & 5 deletions ydb/core/tx/columnshard/transactions/locks_db.cpp

This file was deleted.

27 changes: 0 additions & 27 deletions ydb/core/tx/columnshard/transactions/locks_db.h

This file was deleted.

6 changes: 6 additions & 0 deletions ydb/core/tx/columnshard/transactions/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ PEERDIR(
ydb/core/tx/columnshard/data_sharing/destination/events
)

IF (OS_WINDOWS)
CFLAGS(
-DKIKIMR_DISABLE_S3_OPS
)
ENDIF()

YQL_LAST_ABI_VERSION()

END()
3 changes: 1 addition & 2 deletions ydb/core/tx/datashard/build_and_wait_dependencies_unit.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#include "datashard_impl.h"
#include "datashard_counters.h"
#include "datashard_pipeline.h"
#include "execution_unit_ctors.h"

#include <ydb/core/tx/locks/time_counters.h>

namespace NKikimr {
namespace NDataShard {

Expand Down
2 changes: 1 addition & 1 deletion ydb/core/tx/datashard/datashard__engine_host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "datashard_impl.h"
#include "datashard_user_db.h"
#include "datashard__engine_host.h"
#include <ydb/core/tx/locks/sys_tables.h>
#include "sys_tables.h"

#include <ydb/core/engine/minikql/minikql_engine_host.h>
#include <ydb/core/kqp/rm_service/kqp_rm_service.h>
Expand Down
2 changes: 1 addition & 1 deletion ydb/core/tx/datashard/datashard_active_transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

#include "datashard_active_transaction.h"
#include "datashard_kqp.h"
#include "datashard_locks.h"
#include "datashard_impl.h"
#include "datashard_failpoints.h"
#include "key_conflicts.h"

#include <ydb/core/tx/locks/locks.h>
#include <ydb/library/actors/util/memory_track.h>

namespace NKikimr {
Expand Down
2 changes: 1 addition & 1 deletion ydb/core/tx/datashard/datashard_active_transaction.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "datashard.h"
#include <ydb/core/tx/locks/locks.h>
#include "datashard_locks.h"
#include "datashard__engine_host.h"
#include "operation.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "time_counters.h"
#include "datashard_counters.h"
#include "datashard_impl.h"

namespace NKikimr {
namespace NDataShard {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion ydb/core/tx/datashard/datashard_dep_tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "datashard.h"
#include "datashard_user_table.h"
#include "datashard_active_transaction.h"
#include <ydb/core/tx/locks/range_treap.h>
#include "range_treap.h"

#include <library/cpp/containers/absl_flat_hash/flat_hash_map.h>

Expand Down
2 changes: 1 addition & 1 deletion ydb/core/tx/datashard/datashard_direct_transaction.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "datashard_impl.h"
#include <ydb/core/tx/locks/locks.h>
#include "datashard_locks.h"
#include "operation.h"

#include <ydb/core/engine/minikql/change_collector_iface.h>
Expand Down
4 changes: 2 additions & 2 deletions ydb/core/tx/datashard/datashard_impl.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "datashard.h"
#include "datashard_locks.h"
#include "datashard_trans_queue.h"
#include "datashard_outreadset.h"
#include "datashard_pipeline.h"
Expand Down Expand Up @@ -28,7 +29,6 @@
#include <ydb/core/tx/tx_processing.h>
#include <ydb/core/tx/tx_proxy/proxy.h>
#include <ydb/core/tx/schemeshard/schemeshard.h>
#include <ydb/core/tx/locks/locks.h>

#include <ydb/core/base/appdata.h>
#include <ydb/core/base/tablet_pipe.h>
Expand Down Expand Up @@ -1588,7 +1588,7 @@ class TDataShard

void AddUserTable(const TPathId& tableId, TUserTable::TPtr tableInfo) {
TableInfos[tableId.LocalPathId] = tableInfo;
SysLocks.UpdateSchema(tableId, tableInfo->KeyColumnTypes);
SysLocks.UpdateSchema(tableId, *tableInfo);
Pipeline.GetDepTracker().UpdateSchema(tableId, *tableInfo);
}

Expand Down
2 changes: 1 addition & 1 deletion ydb/core/tx/datashard/datashard_kqp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <ydb/core/kqp/runtime/kqp_tasks_runner.h>
#include <ydb/core/scheme/scheme_tablecell.h>
#include <ydb/core/scheme/scheme_types_proto.h>
#include <ydb/core/tx/locks/locks.h>
#include <ydb/core/tx/datashard/datashard_locks.h>
#include <ydb/core/tx/datashard/datashard_user_table.h>
#include <ydb/core/tx/datashard/range_ops.h>

Expand Down
5 changes: 0 additions & 5 deletions ydb/core/tx/datashard/datashard_kqp.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
#include "datashard.h"
#include "datashard_active_transaction.h"

#include "operation.h"
#include "key_validator.h"
#include "datashard_user_db.h"

#include <ydb/core/engine/minikql/minikql_engine_host.h>
#include <ydb/core/kqp/runtime/kqp_tasks_runner.h>
#include <ydb/core/tx/locks/locks_db.h>

#include <util/generic/ptr.h>

Expand Down
Loading

0 comments on commit 86fba2f

Please sign in to comment.