This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 2a335358aad [profile](bugfix) should not cache profile content because
the profile may not be a full profile (#27635)
2a335358aad is described below
commit 2a335358aad1ad2ee488c0bbc85dd0454ee1f962
Author: yiguolei <[email protected]>
AuthorDate: Tue Nov 28 10:17:30 2023 +0800
[profile](bugfix) should not cache profile content because the profile may
not be a full profile (#27635)
---------
Co-authored-by: yiguolei <[email protected]>
---
.../java/org/apache/doris/common/util/ProfileManager.java | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/common/util/ProfileManager.java
b/fe/fe-core/src/main/java/org/apache/doris/common/util/ProfileManager.java
index ae6eb311619..1a544583bed 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/util/ProfileManager.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/common/util/ProfileManager.java
@@ -71,8 +71,6 @@ public class ProfileManager {
}
private final RuntimeProfile profile;
- // cache the result of getProfileContent method
- private volatile String profileContent;
public Map<String, String> infoStrings = Maps.newHashMap();
public MultiProfileTreeBuilder builder = null;
public String errMsg = "";
@@ -81,12 +79,8 @@ public class ProfileManager {
// lazy load profileContent because sometimes profileContent is very
large
public String getProfileContent() {
- if (profileContent != null) {
- return profileContent;
- }
// no need to lock because the possibility of concurrent read is
very low
- profileContent = profile.toString();
- return profileContent;
+ return profile.toString();
}
public String getProfileBrief() {
@@ -103,7 +97,8 @@ public class ProfileManager {
}
}
- // only protect queryIdDeque; queryIdToProfileMap is concurrent, no need
to protect
+ // only protect queryIdDeque; queryIdToProfileMap is concurrent, no need to
+ // protect
private ReentrantReadWriteLock lock;
private ReadLock readLock;
private WriteLock writeLock;
@@ -165,7 +160,8 @@ public class ProfileManager {
ProfileElement element = createElement(profile);
// 'insert into' does have job_id, put all profiles key with query_id
String key = element.infoStrings.get(SummaryProfile.PROFILE_ID);
- // check when push in, which can ensure every element in the list has
QUERY_ID column,
+ // check when push in, which can ensure every element in the list has
QUERY_ID
+ // column,
// so there is no need to check when remove element from list.
if (Strings.isNullOrEmpty(key)) {
LOG.warn("the key or value of Map is null, "
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]