Skip to content

Commit

Permalink
Reapply reverted PR enabling view export (#13677)
Browse files Browse the repository at this point in the history
Co-authored-by: Ilnaz Nizametdinov <[email protected]>
  • Loading branch information
jepett0 and CyberROFL authored Jan 24, 2025
1 parent 7d1c29a commit 1d3289e
Show file tree
Hide file tree
Showing 28 changed files with 1,058 additions and 202 deletions.
1 change: 1 addition & 0 deletions ydb/core/protos/feature_flags.proto
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,5 @@ message TFeatureFlags {
optional bool DisableLocalDBEraseCache = 161 [default = false];
optional bool EnableExportChecksums = 162 [default = false];
optional bool EnableTopicTransfer = 163 [default = false];
optional bool EnableViewExport = 164 [default = false];
}
1 change: 1 addition & 0 deletions ydb/core/tx/schemeshard/schemeshard__init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4329,6 +4329,7 @@ struct TSchemeShard::TTxInit : public TTransactionBase<TSchemeShard> {

item.SourcePathId.OwnerId = rowset.GetValueOrDefault<Schema::ExportItems::SourceOwnerPathId>(selfId);
item.SourcePathId.LocalPathId = rowset.GetValue<Schema::ExportItems::SourcePathId>();
item.SourcePathType = rowset.GetValue<Schema::ExportItems::SourcePathType>();

item.State = static_cast<TExportInfo::EState>(rowset.GetValue<Schema::ExportItems::State>());
item.WaitTxId = rowset.GetValueOrDefault<Schema::ExportItems::BackupTxId>(InvalidTxId);
Expand Down
7 changes: 6 additions & 1 deletion ydb/core/tx/schemeshard/schemeshard_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ void TSchemeShard::PersistCreateExport(NIceDb::TNiceDb& db, const TExportInfo::T
NIceDb::TUpdate<Schema::ExportItems::SourcePathName>(item.SourcePathName),
NIceDb::TUpdate<Schema::ExportItems::SourceOwnerPathId>(item.SourcePathId.OwnerId),
NIceDb::TUpdate<Schema::ExportItems::SourcePathId>(item.SourcePathId.LocalPathId),
NIceDb::TUpdate<Schema::ExportItems::State>(static_cast<ui8>(item.State))
NIceDb::TUpdate<Schema::ExportItems::State>(static_cast<ui8>(item.State)),
NIceDb::TUpdate<Schema::ExportItems::SourcePathType>(item.SourcePathType)
);
}
}
Expand Down Expand Up @@ -231,6 +232,10 @@ void TSchemeShard::Handle(TEvExport::TEvListExportsRequest::TPtr& ev, const TAct
Execute(CreateTxListExports(ev), ctx);
}

void TSchemeShard::Handle(TEvPrivate::TEvExportSchemeUploadResult::TPtr& ev, const TActorContext& ctx) {
Execute(CreateTxProgressExport(ev), ctx);
}

void TSchemeShard::ResumeExports(const TVector<ui64>& exportIds, const TActorContext& ctx) {
for (const ui64 id : exportIds) {
Execute(CreateTxProgressExport(id), ctx);
Expand Down
11 changes: 8 additions & 3 deletions ydb/core/tx/schemeshard/schemeshard_export__cancel.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include "schemeshard_xxport__tx_base.h"
#include "schemeshard_export_flow_proposals.h"
#include "schemeshard_export.h"
#include "schemeshard_audit_log.h"
#include "schemeshard_export.h"
#include "schemeshard_export_flow_proposals.h"
#include "schemeshard_export_helpers.h"
#include "schemeshard_impl.h"
#include "schemeshard_xxport__tx_base.h"

#include <ydb/public/api/protos/ydb_issue_message.pb.h>
#include <ydb/public/api/protos/ydb_status_codes.pb.h>
Expand Down Expand Up @@ -58,6 +59,10 @@ struct TSchemeShard::TExport::TTxCancel: public TSchemeShard::TXxport::TTxBase {
return true;
}

LOG_D("TExport::TTxCancel, cancelling manually"
<< ", info: " << exportInfo->ToString()
);

exportInfo->Issue = "Cancelled manually";

if (exportInfo->State < TExportInfo::EState::Transferring) {
Expand Down
Loading

0 comments on commit 1d3289e

Please sign in to comment.