Skip to content

DRAFT: schemeshard build time works #11670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ydb/core/tx/schemeshard/olap/layout/layout.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "layout.h"
#include <ydb/core/tx/schemeshard/schemeshard_impl.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_iface.h>
#include <ydb/library/actors/core/log.h>

namespace NKikimr::NSchemeShard {

std::vector<ui64> TColumnTablesLayout::ShardIdxToTabletId(const std::vector<TShardIdx>& shards, const TSchemeShard& ss) {
std::vector<ui64> TColumnTablesLayout::ShardIdxToTabletId(const std::vector<TShardIdx>& shards, const TSchemeshardState& ss) {
std::vector<ui64> result;
for (const auto& shardIdx : shards) {
auto* shardInfo = ss.ShardInfos.FindPtr(shardIdx);
Expand Down
4 changes: 2 additions & 2 deletions ydb/core/tx/schemeshard/olap/layout/layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class TLayoutIdSet {
}
};

class TSchemeShard;
struct TSchemeshardState;

class TColumnTablesLayout {
private:
Expand Down Expand Up @@ -107,7 +107,7 @@ class TColumnTablesLayout {
Groups.erase(std::remove_if(Groups.begin(), Groups.end(), pred), Groups.end());
}

static std::vector<ui64> ShardIdxToTabletId(const std::vector<TShardIdx>& shards, const TSchemeShard& ss);
static std::vector<ui64> ShardIdxToTabletId(const std::vector<TShardIdx>& shards, const TSchemeshardState& ss);

static TColumnTablesLayout BuildTrivial(const std::vector<ui64>& tabletIds);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "object.h"
#include <ydb/core/tx/schemeshard/schemeshard_impl.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_iface.h>

namespace NKikimr::NSchemeShard::NOlap::NAlter {

Expand All @@ -13,4 +13,4 @@ std::shared_ptr<NKikimr::NSchemeShard::NOlap::NAlter::ISSEntity> ISSEntity::GetE
return nullptr;
}

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "object.h"
#include <ydb/core/tx/schemeshard/schemeshard_impl.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_iface.h>

namespace NKikimr::NSchemeShard::NOlap::NAlter {

Expand Down Expand Up @@ -37,4 +37,4 @@ TConclusion<std::shared_ptr<ISSEntityUpdate>> TColumnTableEntity::DoCreateUpdate
return DoCreateUpdateImpl(context);
}

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "update.h"
#include <ydb/core/tx/schemeshard/schemeshard_impl.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_iface.h>

namespace NKikimr::NSchemeShard::NOlap::NAlter {

Expand Down Expand Up @@ -28,4 +28,4 @@ TConclusionStatus TColumnTableUpdate::DoFinish(const TUpdateFinishContext& conte
return TConclusionStatus::Success();
}

}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "update.h"
#include <ydb/core/tx/schemeshard/olap/operations/alter/in_store/object.h>
#include <ydb/core/tx/schemeshard/schemeshard_impl.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_iface.h>

namespace NKikimr::NSchemeShard::NOlap::NAlter {

Expand All @@ -23,4 +23,4 @@ NKikimr::TConclusionStatus TInStoreTableUpdate::DoStartImpl(const TUpdateStartCo
return DoStartInStoreImpl(context);
}

}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "update.h"
#include <ydb/core/tx/schemeshard/olap/operations/alter/abstract/converter.h>
#include <ydb/core/tx/schemeshard/schemeshard_impl.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_iface.h>

namespace NKikimr::NSchemeShard::NOlap::NAlter {

Expand Down Expand Up @@ -79,4 +79,4 @@ NKikimr::TConclusionStatus TInStoreShardsUpdate::DoFinishImpl(const TUpdateFinis
return TConclusionStatus::Success();
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "resharding/update.h"
#include "schema/update.h"
#include "transfer/update.h"
#include <ydb/core/tx/schemeshard/schemeshard_impl.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_iface.h>

namespace NKikimr::NSchemeShard::NOlap::NAlter {

Expand Down Expand Up @@ -85,4 +85,4 @@ NKikimr::TConclusion<NKikimrSchemeOp::TColumnTableSchema> TInStoreTable::GetTabl
return presetProto.GetSchema();
}

}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "update.h"
#include <ydb/core/tx/columnshard/bg_tasks/abstract/task.h>
#include <ydb/core/tx/schemeshard/olap/bg_tasks/tx_chain/task.h>
#include <ydb/core/tx/schemeshard/schemeshard_impl.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_iface.h>
#include <ydb/core/tx/sharding/sharding.h>

namespace NKikimr::NSchemeShard::NOlap::NAlter {
Expand Down Expand Up @@ -60,4 +60,4 @@ TConclusionStatus TInStoreShardingUpdate::DoInitialize(const TUpdateInitializati
return TConclusionStatus::Success();
}

}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "update.h"
#include <ydb/core/tx/columnshard/data_sharing/initiator/controller/schemeshard.h>
#include <ydb/core/tx/schemeshard/schemeshard_impl.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_iface.h>
#include <ydb/core/tx/columnshard/common/snapshot.h>

namespace NKikimr::NSchemeShard::NOlap::NAlter {
Expand All @@ -15,7 +15,7 @@ NKikimr::TConclusionStatus TInStoreShardsTransfer::DoInitializeImpl(const TUpdat
NKikimrColumnShardDataSharingProto::TDestinationSession destinationSession;
destinationSession.SetSessionId(alter.GetSessionId());
*destinationSession.MutableInitiatorController() = NKikimr::NOlap::NDataSharing::TInitiatorControllerContainer(
std::make_shared<NKikimr::NOlap::NDataSharing::TSSInitiatorController>(context.GetSSOperationContext()->SS->TabletID(), 0)).SerializeToProto();
std::make_shared<NKikimr::NOlap::NDataSharing::TSSInitiatorController>(ui64(context.GetSSOperationContext()->SS->SelfTabletId()), 0)).SerializeToProto();
{
auto& pathIdRemap = *destinationSession.AddPathIds();
pathIdRemap.SetSourcePathId(context.GetOriginalEntity().GetPathId().LocalPathId);
Expand All @@ -42,4 +42,4 @@ NKikimr::TConclusionStatus TInStoreShardsTransfer::DoInitializeImpl(const TUpdat
return TConclusionStatus::Success();
}

}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "object.h"
#include "update.h"
#include <ydb/core/tx/schemeshard/schemeshard_impl.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_iface.h>

namespace NKikimr::NSchemeShard::NOlap::NAlter {

Expand Down Expand Up @@ -40,4 +40,4 @@ NKikimr::TConclusionStatus TStandaloneTable::InitializeFromTableInfo() {
return TConclusionStatus::Success();
}

}
}
9 changes: 6 additions & 3 deletions ydb/core/tx/schemeshard/olap/operations/alter_store.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#include <ydb/core/tx/schemeshard/schemeshard__operation_part.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_iface.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_common.h>
#include <ydb/core/tx/schemeshard/schemeshard_impl.h>

#include <ydb/library/formats/arrow/accessor/common/const.h>
#include <ydb/core/tx/columnshard/columnshard.h>
#include <ydb/core/base/hive.h>

#include "checks.h"

Expand Down Expand Up @@ -149,7 +152,7 @@ class TConfigureParts: public TSubOperationState {
if (shard.TabletType == ETabletType::ColumnShard) {
auto event = std::make_unique<TEvColumnShard::TEvProposeTransaction>(
NKikimrTxColumnShard::TX_KIND_SCHEMA,
context.SS->TabletID(),
ui64(context.SS->SelfTabletId()),
context.Ctx.SelfID,
ui64(OperationId.GetTxId()),
columnShardTxBody, seqNo,
Expand Down Expand Up @@ -594,7 +597,7 @@ class TAlterOlapStore: public TSubOperation {
"TAlterOlapStore AbortUnsafe"
<< ", opId: " << OperationId
<< ", forceDropId: " << forceDropTxId
<< ", at schemeshard: " << context.SS->TabletID());
<< ", at schemeshard: " << context.SS->SelfTabletId());

context.OnComplete.DoneOperation(OperationId);
}
Expand Down
15 changes: 9 additions & 6 deletions ydb/core/tx/schemeshard/olap/operations/alter_table.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#include "alter/abstract/object.h"
#include "alter/abstract/update.h"
#include <ydb/core/tx/schemeshard/schemeshard__operation_part.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_iface.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_common.h>
#include <ydb/core/tx/schemeshard/schemeshard_impl.h>

#include <ydb/core/scheme/scheme_types_proto.h>
#include <ydb/core/tx/columnshard/columnshard.h>
#include <ydb/core/base/hive.h>


namespace NKikimr::NSchemeShard::NOlap::NAlter {

Expand Down Expand Up @@ -59,7 +62,7 @@ class TConfigureParts: public TSubOperationState {
auto txShardString = update->GetShardTxBodyString((ui64)tabletId, seqNo);
auto event = std::make_unique<TEvColumnShard::TEvProposeTransaction>(
update->GetShardTransactionKind(),
context.SS->TabletID(),
ui64(context.SS->SelfTabletId()),
context.Ctx.SelfID,
ui64(OperationId.GetTxId()),
txShardString, seqNo,
Expand Down Expand Up @@ -106,7 +109,7 @@ class TPropose: public TSubOperationState {
<< " at tablet: " << ssId
<< ", stepId: " << step);

TTxState* txState = context.SS->FindTxSafe(OperationId, TTxState::TxAlterColumnTable);
TTxState* txState = context.SS->FindTxSafe(OperationId, TTxState::TxAlterColumnTable);

TPathId pathId = txState->TargetPathId;
TPathElement::TPtr path = context.SS->PathsById.at(pathId);
Expand Down Expand Up @@ -142,10 +145,10 @@ class TPropose: public TSubOperationState {
TTabletId ssId = context.SS->SelfTabletId();

LOG_INFO_S(context.Ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
DebugHint() << " HandleReply ProgressState"
DebugHint() << " ProgressState"
<< " at tablet: " << ssId);

TTxState* txState = context.SS->FindTxSafe(OperationId, TTxState::TxAlterColumnTable);
TTxState* txState = context.SS->FindTxSafe(OperationId, TTxState::TxAlterColumnTable);

TSet<TTabletId> shardSet;
for (const auto& shard : txState->Shards) {
Expand Down Expand Up @@ -394,7 +397,7 @@ class TAlterColumnTable: public TSubOperation {
"TAlterColumnTable AbortUnsafe"
<< ", opId: " << OperationId
<< ", forceDropId: " << forceDropTxId
<< ", at schemeshard: " << context.SS->TabletID());
<< ", at schemeshard: " << context.SS->SelfTabletId());

context.OnComplete.DoneOperation(OperationId);
}
Expand Down
8 changes: 4 additions & 4 deletions ydb/core/tx/schemeshard/olap/operations/create_store.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <ydb/core/tx/schemeshard/schemeshard__operation_part.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_iface.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_common.h>
#include <ydb/core/tx/schemeshard/schemeshard_impl.h>
#include <ydb/core/tx/schemeshard/schemeshard__op_traits.h>

#include <ydb/core/base/subdomain.h>
Expand All @@ -17,7 +17,7 @@ namespace {

void ApplySharding(TTxId txId, TPathId pathId, TOlapStoreInfo::TPtr storeInfo,
const TChannelsBindings& channelsBindings,
TTxState& txState, TSchemeShard* ss)
TTxState& txState, TSchemeshardState* ss)
{
ui32 numShards = storeInfo->GetColumnShards().size();
txState.Shards.reserve(numShards);
Expand Down Expand Up @@ -96,7 +96,7 @@ class TConfigureParts: public TSubOperationState {
if (shard.TabletType == ETabletType::ColumnShard) {
auto event = std::make_unique<TEvColumnShard::TEvProposeTransaction>(
NKikimrTxColumnShard::TX_KIND_SCHEMA,
context.SS->TabletID(),
ui64(context.SS->SelfTabletId()),
context.Ctx.SelfID,
ui64(OperationId.GetTxId()),
columnShardTxBody, seqNo,
Expand Down Expand Up @@ -518,7 +518,7 @@ class TCreateOlapStore: public TSubOperation {
"TCreateOlapStore AbortUnsafe"
<< ", opId: " << OperationId
<< ", forceDropId: " << forceDropTxId
<< ", at schemeshard: " << context.SS->TabletID());
<< ", at schemeshard: " << context.SS->SelfTabletId());

context.OnComplete.DoneOperation(OperationId);
}
Expand Down
8 changes: 4 additions & 4 deletions ydb/core/tx/schemeshard/olap/operations/create_table.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <ydb/core/tx/schemeshard/schemeshard__operation_part.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_iface.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_common.h>
#include <ydb/core/tx/schemeshard/schemeshard_impl.h>
#include <ydb/core/tx/schemeshard/schemeshard__op_traits.h>

#include <ydb/core/base/subdomain.h>
Expand Down Expand Up @@ -313,7 +313,7 @@ class TConfigureParts: public TSubOperationState {
if (shard.TabletType == ETabletType::ColumnShard) {
auto event = std::make_unique<TEvColumnShard::TEvProposeTransaction>(
NKikimrTxColumnShard::TX_KIND_SCHEMA,
context.SS->TabletID(),
ui64(context.SS->SelfTabletId()),
context.Ctx.SelfID,
ui64(OperationId.GetTxId()),
columnShardTxBody, seqNo,
Expand Down Expand Up @@ -404,7 +404,7 @@ class TPropose: public TSubOperationState {
TTabletId ssId = context.SS->SelfTabletId();

LOG_INFO_S(context.Ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
DebugHint() << " HandleReply ProgressState"
DebugHint() << " ProgressState"
<< " at tablet: " << ssId);

TTxState* txState = context.SS->FindTx(OperationId);
Expand Down Expand Up @@ -875,7 +875,7 @@ class TCreateColumnTable: public TSubOperation {
"TCreateColumnTable AbortUnsafe"
<< ", opId: " << OperationId
<< ", forceDropId: " << forceDropTxId
<< ", at schemeshard: " << context.SS->TabletID());
<< ", at schemeshard: " << context.SS->SelfTabletId());

context.OnComplete.DoneOperation(OperationId);
}
Expand Down
5 changes: 3 additions & 2 deletions ydb/core/tx/schemeshard/olap/operations/drop_store.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include <ydb/core/tx/schemeshard/schemeshard__operation_part.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_iface.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_common.h>
#include <ydb/core/tx/schemeshard/schemeshard_impl.h>

#include <ydb/core/base/subdomain.h>
#include <ydb/core/tx/columnshard/columnshard.h>

namespace NKikimr::NSchemeShard {

Expand Down Expand Up @@ -389,7 +390,7 @@ class TDropOlapStore: public TSubOperation {
"TDropOlapStore AbortUnsafe"
<< ", opId: " << OperationId
<< ", forceDropId: " << forceDropTxId
<< ", at schemeshard: " << context.SS->TabletID());
<< ", at schemeshard: " << context.SS->SelfTabletId());

TTxState* txState = context.SS->FindTx(OperationId);
Y_ABORT_UNLESS(txState);
Expand Down
7 changes: 4 additions & 3 deletions ydb/core/tx/schemeshard/olap/operations/drop_table.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include <ydb/core/tx/schemeshard/schemeshard__operation_part.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_iface.h>
#include <ydb/core/tx/schemeshard/schemeshard__operation_common.h>
#include <ydb/core/tx/schemeshard/schemeshard_impl.h>

#include <ydb/core/base/subdomain.h>
#include <ydb/core/tx/columnshard/columnshard.h>

namespace NKikimr::NSchemeShard {

Expand Down Expand Up @@ -66,7 +67,7 @@ class TDropParts: public TSubOperationState {
{
auto event = std::make_unique<TEvColumnShard::TEvProposeTransaction>(
NKikimrTxColumnShard::TX_KIND_SCHEMA,
context.SS->TabletID(),
ui64(context.SS->SelfTabletId()),
context.Ctx.SelfID,
ui64(OperationId.GetTxId()),
columnShardTxBody, seqNo,
Expand Down Expand Up @@ -479,7 +480,7 @@ class TDropColumnTable: public TSubOperation {
"TDropColumnTable AbortUnsafe"
<< ", opId: " << OperationId
<< ", forceDropId: " << forceDropTxId
<< ", at schemeshard: " << context.SS->TabletID());
<< ", at schemeshard: " << context.SS->SelfTabletId());

TTxState* txState = context.SS->FindTx(OperationId);
Y_ABORT_UNLESS(txState);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#pragma once

#include "schemeshard__operation_common.h"
#include "schemeshard_impl.h"
#include "schemeshard__operation_part.h"
#include "schemeshard__operation_iface.h"

#include "schemeshard_path.h"

#include <util/generic/string.h>

Expand Down
Loading
Loading