Skip to content

Commit

Permalink
even less logs...
Browse files Browse the repository at this point in the history
  • Loading branch information
MadSchemas committed Feb 19, 2024
1 parent 6450e30 commit 4f446dd
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 41 deletions.
8 changes: 4 additions & 4 deletions cpp_src/cluster/clusterizator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ Error Clusterizator::Replicate(UpdatesContainer&& recs, std::function<void()> be

std::pair<Error, bool> res;
if (ctx.GetOriginLSN().isEmpty()) {
auto recsCnt = recs.size();
std::cout << fmt::sprintf("Clusterizator::'%s' pushing %d records into queue\n", recs[0].GetNsName(), recsCnt);
//auto recsCnt = recs.size();
//std::cout << fmt::sprintf("Clusterizator::'%s' pushing %d records into queue\n", recs[0].GetNsName(), recsCnt);
res = updatesQueue_.Push(std::move(recs), std::move(beforeWaitF), ctx);
std::cout << fmt::sprintf("Clusterizator::'%s' replicated %d records. Result: %s\n", recs[0].GetNsName(), recsCnt,
res.first.ok() ? "OK" : res.first.what());
//std::cout << fmt::sprintf("Clusterizator::'%s' replicated %d records. Result: %s\n", recs[0].GetNsName(), recsCnt,
// res.first.ok() ? "OK" : res.first.what());
} else {
// Update can't be replicated to cluster from another node, so may only be replicated to async replicas
res = updatesQueue_.PushAsync(std::move(recs));
Expand Down
42 changes: 21 additions & 21 deletions cpp_src/core/namespace/namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@ class Namespace {

CounterGuardAIR32 cg(ns->cancelCommitCnt_);
if constexpr (std::is_same_v<T, Item>) {
auto name = GetName(ctx);
if (enumVal == ModeUpsert && !isSystemNamespaceNameFast(name)) {
std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(qr) into '%s' begin\n", name);
}
// auto name = GetName(ctx);
// if (enumVal == ModeUpsert && !isSystemNamespaceNameFast(name)) {
// std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(qr) into '%s' begin\n", name);
// }
auto wlck = ns->dataWLock(nsCtx.rdxContext);
cg.Reset();
qr.AddNamespace(ns, true);
added = true;
(*ns.*fn)(v, enumVal, pendedRepl, nsCtx);
qr.AddItem(v, true, false);
ns->replicate(std::move(pendedRepl), std::move(wlck), true, nullptr, nsCtx);
if (enumVal == ModeUpsert && !isSystemNamespaceNameFast(name)) {
std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(qr) into '%s' done\n", name);
}
// if (enumVal == ModeUpsert && !isSystemNamespaceNameFast(name)) {
// std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(qr) into '%s' done\n", name);
// }
} else {
auto params = longUpdDelLoggingParams_.load(std::memory_order_relaxed);
const bool isEnabled = params.thresholdUs >= 0 && !isSystemNamespaceNameFast(v.NsName());
Expand Down Expand Up @@ -135,24 +135,24 @@ class Namespace {
nsFuncWrapper<&NamespaceImpl::doUpdate, QueryType::QueryUpdate>(query, result, ctx);
}
void Upsert(Item &item, const RdxContext &ctx) {
auto name = GetName(ctx);
if (!isSystemNamespaceNameFast(name)) {
std::cout << fmt::sprintf("Namespace::Upsert(...) into '%s' begin\n", name);
}
//auto name = GetName(ctx);
//if (!isSystemNamespaceNameFast(name)) {
// std::cout << fmt::sprintf("Namespace::Upsert(...) into '%s' begin\n", name);
//}
nsFuncWrapper<&NamespaceImpl::Upsert>(item, ctx);
if (!isSystemNamespaceNameFast(name)) {
std::cout << fmt::sprintf("Namespace::Upsert(...) into '%s' done\n", name);
}
// if (!isSystemNamespaceNameFast(name)) {
// std::cout << fmt::sprintf("Namespace::Upsert(...) into '%s' done\n", name);
// }
}
void Upsert(Item &item, LocalQueryResults &qr, const RdxContext &ctx) {
auto name = GetName(ctx);
if (!isSystemNamespaceNameFast(name)) {
std::cout << fmt::sprintf("Namespace::Upsert(qr) into '%s' begin\n", name);
}
// auto name = GetName(ctx);
// if (!isSystemNamespaceNameFast(name)) {
// std::cout << fmt::sprintf("Namespace::Upsert(qr) into '%s' begin\n", name);
// }
nsFuncWrapper<&NamespaceImpl::modifyItem, ItemModifyMode::ModeUpsert>(item, qr, ctx);
if (!isSystemNamespaceNameFast(name)) {
std::cout << fmt::sprintf("Namespace::Upsert(qr) into '%s' done\n", name);
}
// if (!isSystemNamespaceNameFast(name)) {
// std::cout << fmt::sprintf("Namespace::Upsert(qr) into '%s' done\n", name);
// }
}
void Delete(Item &item, const RdxContext &ctx) { nsFuncWrapper<&NamespaceImpl::Delete>(item, ctx); }
void Delete(Item &item, LocalQueryResults &qr, const RdxContext &ctx) {
Expand Down
24 changes: 12 additions & 12 deletions cpp_src/core/namespace/namespaceimpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1478,18 +1478,18 @@ void NamespaceImpl::doTruncate(UpdatesContainer& pendedRepl, const NsContext& ct
}

void NamespaceImpl::ModifyItem(Item& item, ItemModifyMode mode, const RdxContext& ctx) {
auto name = GetName(ctx);
if (mode == ModeUpsert && !isSystemNamespaceNameFast(name)) {
std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(...) into %d:'%s' begin\n", wal_.GetServer(), name);
}
//sauto name = GetName(ctx);
//if (mode == ModeUpsert && !isSystemNamespaceNameFast(name)) {
// std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(...) into %d:'%s' begin\n", wal_.GetServer(), name);
//}
PerfStatCalculatorMT calc(updatePerfCounter_, enablePerfCounters_);
UpdatesContainer pendedRepl;

CounterGuardAIR32 cg(cancelCommitCnt_);
auto wlck = dataWLock(ctx);

if (mode == ModeUpsert && !isSystemNamespaceNameFast(name)) {
std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(...) into %d:'%s' locked\n", wal_.GetServer(), name);
if (mode == ModeUpsert && !isSystemNamespaceNameFast(name_)) {
std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(...) into %d:'%s' locked\n", wal_.GetServer(), name_);
}
cg.Reset();
calc.LockHit();
Expand All @@ -1498,14 +1498,14 @@ void NamespaceImpl::ModifyItem(Item& item, ItemModifyMode mode, const RdxContext
}
modifyItem(item, mode, pendedRepl, NsContext(ctx));

if (mode == ModeUpsert && !isSystemNamespaceNameFast(name)) {
std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(...) into %d:'%s' replicate call with %d recs\n", wal_.GetServer(), name,
pendedRepl.size());
}
//if (mode == ModeUpsert && !isSystemNamespaceNameFast(name)) {
// std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(...) into %d:'%s' replicate call with %d recs\n", wal_.GetServer(), name,
// pendedRepl.size());
//}

replicate(std::move(pendedRepl), std::move(wlck), true, nullptr, ctx);
if (mode == ModeUpsert && !isSystemNamespaceNameFast(name)) {
std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(...) into %d:'%s' end\n", wal_.GetServer(), name);
if (mode == ModeUpsert && !isSystemNamespaceNameFast(name_)) {
std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(...) into %d:'%s' end\n", wal_.GetServer(), name_);
}
}

Expand Down
8 changes: 4 additions & 4 deletions cpp_src/core/reindexer_impl/reindexerimpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -973,16 +973,16 @@ Error ReindexerImpl::Update(const Query& q, LocalQueryResults& result, const Rdx
}

Error ReindexerImpl::Upsert(std::string_view nsName, Item& item, const RdxContext& ctx) {
std::cout << fmt::sprintf("ReindexerImpl::Upsert(...) into '%s' begin\n", nsName);
//std::cout << fmt::sprintf("ReindexerImpl::Upsert(...) into '%s' begin\n", nsName);
auto res = APPLY_NS_FUNCTION11(true, Upsert, item);
std::cout << fmt::sprintf("ReindexerImpl::Upsert(...) into '%s' done\n", nsName);
//std::cout << fmt::sprintf("ReindexerImpl::Upsert(...) into '%s' done\n", nsName);
return res;
}

Error ReindexerImpl::Upsert(std::string_view nsName, Item& item, LocalQueryResults& qr, const RdxContext& ctx) {
std::cout << fmt::sprintf("ReindexerImpl::Upsert(qr) into '%s' begin\n", nsName);
//std::cout << fmt::sprintf("ReindexerImpl::Upsert(qr) into '%s' begin\n", nsName);
auto res = APPLY_NS_FUNCTION22(true, Upsert, item, qr);
std::cout << fmt::sprintf("ReindexerImpl::Upsert(qr) into '%s' done\n", nsName);
//std::cout << fmt::sprintf("ReindexerImpl::Upsert(qr) into '%s' done\n", nsName);
return res;
}

Expand Down

0 comments on commit 4f446dd

Please sign in to comment.