You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2025/02/03 05:39:39 UTC
(kudu) branch master updated (d405ad330 -> 271ce3c91)
This is an automated email from the ASF dual-hosted git repository.
alexey pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
from d405ad330 [compaction] Add memory tracking for better OOM issues triaging
new cf2fcb317 [test] Address leftover comment from commit id d405ad3
new 691c3e68e [maintenance_manager] micro-optimisation on LogPrefix
new 271ce3c91 [master] tablet_id() accessors return const reference
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/kudu/master/catalog_manager.cc | 10 +++++-----
src/kudu/master/sys_catalog.cc | 4 ++--
src/kudu/master/sys_catalog.h | 2 +-
src/kudu/tablet/compaction-highmem-test.cc | 2 +-
src/kudu/util/maintenance_manager.cc | 5 +----
src/kudu/util/maintenance_manager.h | 5 ++++-
6 files changed, 14 insertions(+), 14 deletions(-)
(kudu) 01/03: [test] Address leftover comment from commit id d405ad3
Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
commit cf2fcb317e028e1f35d16639937c046173792caa
Author: Ashwani Raina <ar...@cloudera.com>
AuthorDate: Wed Jan 29 13:28:42 2025 +0530
[test] Address leftover comment from commit id d405ad3
Trivial change to make compaction_mem_usage_approx compile time constant.
Addresses the following leftover comment:
https://gerrit.cloudera.org/c/22079/16/src/kudu/tablet/compaction-highmem-test.cc#244
Change-Id: Icc49acbfd713f5f9f9cf6635b87825f2c1622299
Reviewed-on: http://gerrit.cloudera.org:8080/22416
Reviewed-by: Zoltan Martonka <zm...@cloudera.com>
Reviewed-by: Attila Bukor <ab...@apache.org>
Tested-by: Attila Bukor <ab...@apache.org>
---
src/kudu/tablet/compaction-highmem-test.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/kudu/tablet/compaction-highmem-test.cc b/src/kudu/tablet/compaction-highmem-test.cc
index 7bb0b3e1b..63301898b 100644
--- a/src/kudu/tablet/compaction-highmem-test.cc
+++ b/src/kudu/tablet/compaction-highmem-test.cc
@@ -241,7 +241,7 @@ TEST_F(TestHighMemCompaction, TestMajorCompactionMemoryPressure) {
// Approximate memory consumed by delta compaction during the course of this test.
// Total consumption would always exceed this usage. Since we want to be
// certain that warning threshold limit is crossed, this value is kept low.
- const int64_t compaction_mem_usage_approx = 3 * 1024 * 1024;
+ constexpr int64_t compaction_mem_usage_approx = 3 * 1024 * 1024;
// Set appropriate flags to ensure memory threshold checks fail.
FLAGS_memory_limit_compact_usage_warn_threshold_percentage =
(kudu) 02/03: [maintenance_manager] micro-optimisation on LogPrefix
Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 691c3e68ecf58c83cbb5fc5448fc2d7a51196311
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Thu Jan 30 16:42:48 2025 -0800
[maintenance_manager] micro-optimisation on LogPrefix
There is just a single instance of MaintenanceManager per Kudu server,
so it makes sense to store its log prefix as a field and avoid
allocating memory and constructing the string every time a log message
is issued.
This patch doesn't contain any functional modifications.
Change-Id: I40398106af386eb352cef05df7644941a230a468
Reviewed-on: http://gerrit.cloudera.org:8080/22428
Reviewed-by: Ashwani Raina <ar...@cloudera.com>
Reviewed-by: Mahesh Reddy <mr...@cloudera.com>
Tested-by: Alexey Serbin <al...@apache.org>
Reviewed-by: Yifan Zhang <ch...@163.com>
---
src/kudu/util/maintenance_manager.cc | 5 +----
src/kudu/util/maintenance_manager.h | 5 ++++-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/kudu/util/maintenance_manager.cc b/src/kudu/util/maintenance_manager.cc
index 2fbfbb032..ac2ac9067 100644
--- a/src/kudu/util/maintenance_manager.cc
+++ b/src/kudu/util/maintenance_manager.cc
@@ -203,6 +203,7 @@ MaintenanceManager::MaintenanceManager(
string server_uuid,
const scoped_refptr<MetricEntity>& metric_entity)
: server_uuid_(std::move(server_uuid)),
+ log_prefix_(Substitute("P $0: ", server_uuid_)),
num_threads_(options.num_threads > 0
? options.num_threads
: FLAGS_maintenance_manager_num_threads),
@@ -697,10 +698,6 @@ void MaintenanceManager::GetMaintenanceManagerStatusDump(
}
}
-string MaintenanceManager::LogPrefix() const {
- return Substitute("P $0: ", server_uuid_);
-}
-
bool MaintenanceManager::HasFreeThreads() {
return num_threads_ > running_ops_;
}
diff --git a/src/kudu/util/maintenance_manager.h b/src/kudu/util/maintenance_manager.h
index bc9a9b7d3..819b328c4 100644
--- a/src/kudu/util/maintenance_manager.h
+++ b/src/kudu/util/maintenance_manager.h
@@ -362,7 +362,9 @@ class MaintenanceManager : public std::enable_shared_from_this<MaintenanceManage
void LaunchOp(MaintenanceOp* op);
- std::string LogPrefix() const;
+ const std::string& LogPrefix() const {
+ return log_prefix_;
+ }
bool HasFreeThreads();
@@ -385,6 +387,7 @@ class MaintenanceManager : public std::enable_shared_from_this<MaintenanceManage
bool ProceedWithFlush(double* used_memory_percentage);
const std::string server_uuid_;
+ const std::string log_prefix_;
const int32_t num_threads_;
const MonoDelta polling_interval_;
(kudu) 03/03: [master] tablet_id() accessors return const reference
Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 271ce3c91d61c54732f8bcb8e08b121b2f5e6b57
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Thu Jan 30 18:50:13 2025 -0800
[master] tablet_id() accessors return const reference
This patch doesn't contain any functional modifications.
Change-Id: If9d2aee19c0eade2ea41042b553c116b5028e49f
Reviewed-on: http://gerrit.cloudera.org:8080/22429
Tested-by: Kudu Jenkins
Reviewed-by: Ashwani Raina <ar...@cloudera.com>
Reviewed-by: Mahesh Reddy <mr...@cloudera.com>
Reviewed-by: Yifan Zhang <ch...@163.com>
---
src/kudu/master/catalog_manager.cc | 10 +++++-----
src/kudu/master/sys_catalog.cc | 4 ++--
src/kudu/master/sys_catalog.h | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/kudu/master/catalog_manager.cc b/src/kudu/master/catalog_manager.cc
index ef1ffdb47..d275b61a9 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -4496,7 +4496,7 @@ class RetryingTSRpcTask : public MonitoredTask {
}
// Return the id of the tablet that is the subject of the async request.
- virtual string tablet_id() const = 0;
+ virtual const string& tablet_id() const = 0;
MonoTime start_timestamp() const override { return start_ts_; }
MonoTime completion_timestamp() const override { return end_ts_; }
@@ -4766,7 +4766,7 @@ class AsyncCreateReplica : public RetrySpecificTSRpcTask {
}
protected:
- string tablet_id() const override { return tablet_id_; }
+ const string& tablet_id() const override { return tablet_id_; }
void HandleResponse(int attempt) override {
if (!resp_.has_error()) {
@@ -4826,7 +4826,7 @@ class AsyncDeleteReplica : public RetrySpecificTSRpcTask {
}
protected:
- string tablet_id() const override { return tablet_id_; }
+ const string& tablet_id() const override { return tablet_id_; }
void HandleResponse(int attempt) override {
if (resp_.has_error()) {
@@ -4931,7 +4931,7 @@ class AsyncAlterTable : public RetryingTSRpcTask {
}
private:
- string tablet_id() const override { return tablet_->id(); }
+ const string& tablet_id() const override { return tablet_->id(); }
void HandleResponse(int /*attempt*/) override {
if (resp_.has_error()) {
@@ -5010,7 +5010,7 @@ class AsyncChangeConfigTask : public RetryingTSRpcTask {
consensus::ChangeConfigResponsePB resp_;
private:
- string tablet_id() const override { return tablet_->id(); }
+ const string& tablet_id() const override { return tablet_->id(); }
};
AsyncChangeConfigTask::AsyncChangeConfigTask(Master* master,
diff --git a/src/kudu/master/sys_catalog.cc b/src/kudu/master/sys_catalog.cc
index 545dfad0b..abff6e565 100644
--- a/src/kudu/master/sys_catalog.cc
+++ b/src/kudu/master/sys_catalog.cc
@@ -261,7 +261,7 @@ Status SysCatalogTable::Load(FsManager *fs_manager) {
}
LOG(INFO) << "Verifying existing consensus state";
- const string tablet_id = metadata->tablet_id();
+ const auto& tablet_id = metadata->tablet_id();
scoped_refptr<ConsensusMetadata> cmeta;
RETURN_NOT_OK_PREPEND(cmeta_manager_->Load(tablet_id, &cmeta),
"Unable to load consensus metadata for tablet " + tablet_id);
@@ -378,7 +378,7 @@ Status SysCatalogTable::CreateNew(FsManager *fs_manager) {
}
}
- string tablet_id = metadata->tablet_id();
+ const auto& tablet_id = metadata->tablet_id();
RETURN_NOT_OK_PREPEND(cmeta_manager_->Create(tablet_id, config, consensus::kMinimumTerm),
"Unable to persist consensus metadata for tablet " + tablet_id);
diff --git a/src/kudu/master/sys_catalog.h b/src/kudu/master/sys_catalog.h
index 79a697afc..2cbe7984a 100644
--- a/src/kudu/master/sys_catalog.h
+++ b/src/kudu/master/sys_catalog.h
@@ -321,7 +321,7 @@ class SysCatalogTable {
Status CreateDistributedConfig(const MasterOptions& options,
consensus::RaftConfigPB* committed_config);
- std::string tablet_id() const {
+ const std::string& tablet_id() const {
return tablet_replica_->tablet_id();
}