Skip to content

Commit cdd7738

Browse files
amarathavaleAmar Athavale
andauthored
Disabling database deletion as part of resource management (Azure#19374)
Co-authored-by: Amar Athavale <aathaval@linkedin.com>
1 parent c080eff commit cdd7738

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

sdk/cosmos/azure-cosmos-benchmark/ctl/linkedin/run_benchmark.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ jvm_opt=""
9898

9999
if [ -z "$ctl_graphite_endpoint" ]
100100
then
101-
java -Xmx8g -Xms8g $jvm_opt -Dcosmos.directModeProtocol=$protocol -Dazure.cosmos.directModeProtocol=$protocol -jar "$jar_file" -serviceEndpoint "$service_endpoint" -masterKey "$master_key" -databaseId "$database_name" -collectionId "$collection_name" -numberOfCollectionForCtl "$number_Of_collection" -throughput $throughput -consistencyLevel $consistency_level -concurrency $concurrency -numberOfOperations $number_of_operations -operation $operation -connectionMode $connection_mode -maxRunningTimeDuration $max_running_time_duration -numberOfPreCreatedDocuments $number_of_precreated_documents -printingInterval $printing_interval 2>&1 | tee -a "$log_filename"
101+
java -Xmx8g -Xms8g $jvm_opt -Dcosmos.directModeProtocol=$protocol -Dazure.cosmos.directModeProtocol=$protocol -jar "$jar_file" -serviceEndpoint "$service_endpoint" -masterKey "$master_key" -databaseId "$database_name" -collectionId "$collection_name" -numberOfCollectionForCtl "$number_Of_collection" -throughput $throughput -consistencyLevel $consistency_level -concurrency $concurrency -numberOfOperations $number_of_operations -operation $operation -connectionMode $connection_mode -maxRunningTimeDuration $max_running_time_duration -numberOfPreCreatedDocuments $number_of_precreated_documents -printingInterval $printing_interval -manageResources 2>&1 | tee -a "$log_filename"
102102
else
103-
java -Xmx8g -Xms8g $jvm_opt -Dcosmos.directModeProtocol=$protocol -Dazure.cosmos.directModeProtocol=$protocol -jar "$jar_file" -serviceEndpoint "$service_endpoint" -masterKey "$master_key" -databaseId "$database_name" -collectionId "$collection_name" -numberOfCollectionForCtl "$number_Of_collection" -throughput $throughput -consistencyLevel $consistency_level -concurrency $concurrency -numberOfOperations $number_of_operations -operation $operation -connectionMode $connection_mode -maxRunningTimeDuration $max_running_time_duration -graphiteEndpoint $ctl_graphite_endpoint -numberOfPreCreatedDocuments $number_of_precreated_documents -printingInterval $printing_interval 2>&1 | tee -a "$log_filename"
103+
java -Xmx8g -Xms8g $jvm_opt -Dcosmos.directModeProtocol=$protocol -Dazure.cosmos.directModeProtocol=$protocol -jar "$jar_file" -serviceEndpoint "$service_endpoint" -masterKey "$master_key" -databaseId "$database_name" -collectionId "$collection_name" -numberOfCollectionForCtl "$number_Of_collection" -throughput $throughput -consistencyLevel $consistency_level -concurrency $concurrency -numberOfOperations $number_of_operations -operation $operation -connectionMode $connection_mode -maxRunningTimeDuration $max_running_time_duration -graphiteEndpoint $ctl_graphite_endpoint -numberOfPreCreatedDocuments $number_of_precreated_documents -printingInterval $printing_interval -manageResources 2>&1 | tee -a "$log_filename"
104104
fi
105105

106106
end=`date +%s`

sdk/cosmos/azure-cosmos-benchmark/src/main/java/com/azure/cosmos/benchmark/linkedin/ResourceManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public interface ResourceManager {
2727
void createContainer() throws CosmosException;
2828

2929
/**
30-
* Delete all managed resources i.e. databases and containers
30+
* Delete all managed resources e.g. account, databases and/or containers etc
3131
*/
3232
void deleteResources();
3333
}

sdk/cosmos/azure-cosmos-benchmark/src/main/java/com/azure/cosmos/benchmark/linkedin/ResourceManagerImpl.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public ResourceManagerImpl(final Configuration configuration, final CosmosAsyncC
4040
@Override
4141
public void createDatabase() throws CosmosException {
4242
try {
43-
LOGGER.info("Creating database {} for the ctl workload", _configuration.getDatabaseId());
43+
LOGGER.info("Creating database {} for the ctl workload if one doesn't exist", _configuration.getDatabaseId());
4444
final ThroughputProperties throughputProperties = createManualThroughput(_configuration.getThroughput());
4545
_client.createDatabaseIfNotExists(_configuration.getDatabaseId(), throughputProperties)
4646
.block(RESOURCE_CRUD_WAIT_TIME);
@@ -73,16 +73,6 @@ public void deleteResources() {
7373
// Delete all the containers in the database
7474
deleteExistingContainers();
7575

76-
// Followed by the main database used for testing
77-
final CosmosAsyncDatabase database = _client.getDatabase(_configuration.getDatabaseId());
78-
try {
79-
LOGGER.info("Deleting the main database {} used in this test", _configuration.getDatabaseId());
80-
database.delete()
81-
.block(RESOURCE_CRUD_WAIT_TIME);
82-
} catch (CosmosException e) {
83-
LOGGER.error("Exception while deleting the database {}", _configuration.getDatabaseId(), e);
84-
throw e;
85-
}
8676
LOGGER.info("Resource cleanup completed");
8777
}
8878

0 commit comments

Comments
 (0)