diff --git a/db_stress_tool/db_stress_test_base.cc b/db_stress_tool/db_stress_test_base.cc index 1179ba9c92..d4102fb831 100644 --- a/db_stress_tool/db_stress_test_base.cc +++ b/db_stress_tool/db_stress_test_base.cc @@ -617,8 +617,21 @@ void StressTest::PreloadDbAndReopenAsReadOnly(int64_t number_of_keys, if (FLAGS_use_put_entity_one_in > 0 && (value_base % FLAGS_use_put_entity_one_in) == 0) { - s = db_->PutEntity(write_opts, cfh, key, - GenerateWideColumns(value_base, v)); + if (!FLAGS_use_txn) { + if (FLAGS_use_attribute_group) { + s = db_->PutEntity(write_opts, key, + GenerateAttributeGroups({cfh}, value_base, v)); + } else { + s = db_->PutEntity(write_opts, cfh, key, + GenerateWideColumns(value_base, v)); + } + } else { + s = ExecuteTransaction( + write_opts, /*thread=*/nullptr, [&](Transaction& txn) { + return txn.PutEntity(cfh, key, + GenerateWideColumns(value_base, v)); + }); + } } else if (FLAGS_use_merge) { if (!FLAGS_use_txn) { if (FLAGS_user_timestamp_size > 0) { diff --git a/db_stress_tool/db_stress_tool.cc b/db_stress_tool/db_stress_tool.cc index e7756a277c..34a45a603c 100644 --- a/db_stress_tool/db_stress_tool.cc +++ b/db_stress_tool/db_stress_tool.cc @@ -301,11 +301,11 @@ int db_stress_tool(int argc, char** argv) { } if (FLAGS_use_put_entity_one_in > 0 && - (FLAGS_use_full_merge_v1 || FLAGS_use_txn || FLAGS_test_multi_ops_txns || + (FLAGS_use_full_merge_v1 || FLAGS_test_multi_ops_txns || FLAGS_user_timestamp_size > 0)) { fprintf(stderr, - "Wide columns are incompatible with V1 Merge, transactions, and " - "user-defined timestamps\n"); + "Wide columns are incompatible with V1 Merge, the multi-op " + "transaction test, and user-defined timestamps\n"); exit(1); } diff --git a/db_stress_tool/no_batched_ops_stress.cc b/db_stress_tool/no_batched_ops_stress.cc index c18cf506b6..0d0e0c5e14 100644 --- a/db_stress_tool/no_batched_ops_stress.cc +++ b/db_stress_tool/no_batched_ops_stress.cc @@ -1483,12 +1483,18 @@ class NonBatchedOpsStressTest : public StressTest { if (FLAGS_use_put_entity_one_in > 0 && (value_base % FLAGS_use_put_entity_one_in) == 0) { - if (FLAGS_use_attribute_group) { - s = db_->PutEntity(write_opts, k, - GenerateAttributeGroups({cfh}, value_base, v)); + if (!FLAGS_use_txn) { + if (FLAGS_use_attribute_group) { + s = db_->PutEntity(write_opts, k, + GenerateAttributeGroups({cfh}, value_base, v)); + } else { + s = db_->PutEntity(write_opts, cfh, k, + GenerateWideColumns(value_base, v)); + } } else { - s = db_->PutEntity(write_opts, cfh, k, - GenerateWideColumns(value_base, v)); + s = ExecuteTransaction(write_opts, thread, [&](Transaction& txn) { + return txn.PutEntity(cfh, k, GenerateWideColumns(value_base, v)); + }); } } else if (FLAGS_use_timed_put_one_in > 0 && ((value_base + kLargePrimeForCommonFactorSkew) % diff --git a/tools/db_crashtest.py b/tools/db_crashtest.py index 94bdd7bb06..afded2211e 100644 --- a/tools/db_crashtest.py +++ b/tools/db_crashtest.py @@ -493,8 +493,6 @@ txn_params = { # pipeline write is not currnetly compatible with WritePrepared txns "enable_pipelined_write": 0, "create_timestamped_snapshot_one_in": random.choice([0, 20]), - # PutEntity in transactions is not yet implemented - "use_put_entity_one_in": 0, # Should not be used with TransactionDB which uses snapshot. "inplace_update_support": 0, # TimedPut is not supported in transaction @@ -508,8 +506,6 @@ optimistic_txn_params = { "occ_validation_policy": random.randint(0, 1), "share_occ_lock_buckets": random.randint(0, 1), "occ_lock_bucket_count": lambda: random.choice([10, 100, 500]), - # PutEntity in transactions is not yet implemented - "use_put_entity_one_in": 0, # Should not be used with OptimisticTransactionDB which uses snapshot. "inplace_update_support": 0, # TimedPut is not supported in transaction @@ -801,6 +797,9 @@ def finalize_and_sanitize(src_params): if dest_params.get("use_txn") == 1 and dest_params.get("txn_write_policy", 0) != 0: dest_params["sync_fault_injection"] = 0 dest_params["manual_wal_flush_one_in"] = 0 + # Wide-column pessimistic transaction APIs are initially supported for + # WriteCommitted only + dest_params["use_put_entity_one_in"] = 0 # Wide column stress tests require FullMergeV3 if dest_params["use_put_entity_one_in"] != 0: dest_params["use_full_merge_v1"] = 0