Skip to content

Commit

Permalink
Set clientSamplingProbability to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
hfu94 committed Feb 27, 2024
1 parent 3aac4a8 commit f6dd86a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
19 changes: 19 additions & 0 deletions fdbcli/fdbcli.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,8 @@ Reference<ITransaction> getTransaction(Reference<IDatabase> db,
if (tenant) {
tr = tenant->createTransaction();
} else {
TraceEvent("Test0226GetTxnInside").log();
std::cout << "Test0226GetTxnInside" << std::endl;
tr = db->createTransaction();
}
options->apply(tr);
Expand Down Expand Up @@ -1866,6 +1868,23 @@ ACTOR Future<int> cli(CLIOptions opt, LineNoise* plinenoise, Reference<ClusterCo
printUsage(tokens[0]);
is_error = true;
} else {
bool tr_b = false;
bool tenant_b = false;
if (tr) {
tr_b = true;
}
if (tenant) {
tenant_b = true;
}
TraceEvent("Test0226GetTxnBefore")
.detail("Tr", tr_b)
.detail("InTrans", intrans)
.detail("Tenant", tenant_b)
.log();
// to add std cout here
std::cout << "Test0226GetTxnBefore Tr=" << tr_b << " Tenant=" << tenant_b
<< " intrans=" << intrans
<< std::endl;
if (intrans) {
if (transtype == TransType::None) {
transtype = TransType::Db;
Expand Down
2 changes: 1 addition & 1 deletion fdbclient/ClientKnobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ void ClientKnobs::initialize(Randomize randomize) {
init( TIMEOUT_RETRY_UPPER_BOUND, 20.0 );

// Client Status Info
init(CSI_SAMPLING_PROBABILITY, -1.0);
init(CSI_SAMPLING_PROBABILITY, 1.0);
init(CSI_SIZE_LIMIT, std::numeric_limits<int64_t>::max());
if (randomize && BUGGIFY) {
CSI_SAMPLING_PROBABILITY = deterministicRandom()->random01() / 10; // rand range 0 - 0.1
Expand Down
2 changes: 2 additions & 0 deletions fdbclient/MultiVersionTransaction.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ Reference<ITenant> DLDatabase::openTenant(TenantNameRef tenantName) {
}

Reference<ITransaction> DLDatabase::createTransaction() {
TraceEvent("Test0226DLCreateTxn").log();
FdbCApi::FDBTransaction* tr;
throwIfError(api->databaseCreateTransaction(db, &tr));
return Reference<ITransaction>(new DLTransaction(api, tr));
Expand Down Expand Up @@ -2120,6 +2121,7 @@ Reference<ITenant> MultiVersionDatabase::openTenant(TenantNameRef tenantName) {
}

Reference<ITransaction> MultiVersionDatabase::createTransaction() {
TraceEvent("Test0226MultiVersionCreateTxn").log();
return Reference<ITransaction>(new MultiVersionTransaction(Reference<MultiVersionDatabase>::addRef(this),
Optional<Reference<MultiVersionTenant>>(),
dbState->transactionDefaultOptions));
Expand Down
1 change: 1 addition & 0 deletions fdbclient/NativeAPI.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9008,6 +9008,7 @@ Reference<TransactionLogInfo> Transaction::createTrLogInfoProbabilistically(cons
deterministicRandom()->random01() < clientSamplingProbability &&
(!g_network->isSimulated() || !g_simulator->speedUpSimulation)) {
std::cout << "Enabling TrLogInfo" << std::endl;
TraceEvent("Test0226EnableTrLogInfo").log();
return makeReference<TransactionLogInfo>(TransactionLogInfo::DATABASE);
}
}
Expand Down

0 comments on commit f6dd86a

Please sign in to comment.