Skip to content

Commit ea8caee

Browse files
authored
[improvement](BeConfig)Add Be config to control the public or private endpoint (#57580)
1 parent 030531a commit ea8caee

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

be/src/cloud/config.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ DEFINE_mInt32(mow_stream_load_commit_retry_times, "5");
6565

6666
DEFINE_mBool(save_load_error_log_to_s3, "false");
6767

68+
DEFINE_mBool(use_public_endpoint_for_error_log, "true");
69+
6870
DEFINE_mInt32(sync_load_for_tablets_thread, "32");
6971

7072
DEFINE_mBool(enable_new_tablet_do_compaction, "true");

be/src/cloud/config.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ DECLARE_mInt32(mow_stream_load_commit_retry_times);
107107

108108
DECLARE_mBool(save_load_error_log_to_s3);
109109

110+
// Whether to use public endpoint for error log presigned URL
111+
DECLARE_mBool(use_public_endpoint_for_error_log);
112+
110113
// the theads which sync the datas which loaded in other clusters
111114
DECLARE_mInt32(sync_load_for_tablets_thread);
112115

be/src/runtime/runtime_state.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,10 @@ std::string RuntimeState::get_error_log_file_path() {
424424
}
425425
// expiration must be less than a week (in seconds) for presigned url
426426
static const unsigned EXPIRATION_SECONDS = 7 * 24 * 60 * 60 - 1;
427-
// We should return a public endpoint to user.
428-
_error_log_file_path = _s3_error_fs->generate_presigned_url(_s3_error_log_file_path,
429-
EXPIRATION_SECONDS, true);
427+
// Use public or private endpoint based on configuration
428+
_error_log_file_path =
429+
_s3_error_fs->generate_presigned_url(_s3_error_log_file_path, EXPIRATION_SECONDS,
430+
config::use_public_endpoint_for_error_log);
430431
}
431432
return _error_log_file_path;
432433
}

0 commit comments

Comments
 (0)