Skip to content

Commit c29b279

Browse files
0AyanamiReiYour Name
authored andcommitted
[improvement](BeConfig)Add Be config to control the public or private endpoint (#57580)
1 parent 35a8a19 commit c29b279

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
@@ -64,6 +64,8 @@ DEFINE_mInt32(mow_stream_load_commit_retry_times, "5");
6464

6565
DEFINE_mBool(save_load_error_log_to_s3, "false");
6666

67+
DEFINE_mBool(use_public_endpoint_for_error_log, "true");
68+
6769
DEFINE_mInt32(sync_load_for_tablets_thread, "32");
6870

6971
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
@@ -106,6 +106,9 @@ DECLARE_mInt32(mow_stream_load_commit_retry_times);
106106

107107
DECLARE_mBool(save_load_error_log_to_s3);
108108

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

be/src/runtime/runtime_state.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,10 @@ std::string RuntimeState::get_error_log_file_path() {
463463
}
464464
// expiration must be less than a week (in seconds) for presigned url
465465
static const unsigned EXPIRATION_SECONDS = 7 * 24 * 60 * 60 - 1;
466-
// We should return a public endpoint to user.
467-
_error_log_file_path = _s3_error_fs->generate_presigned_url(_s3_error_log_file_path,
468-
EXPIRATION_SECONDS, true);
466+
// Use public or private endpoint based on configuration
467+
_error_log_file_path =
468+
_s3_error_fs->generate_presigned_url(_s3_error_log_file_path, EXPIRATION_SECONDS,
469+
config::use_public_endpoint_for_error_log);
469470
}
470471
return _error_log_file_path;
471472
}

0 commit comments

Comments
 (0)