-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-25914 Provide slow/large logs on RegionServer UI #3319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
|
||
| if(rs.isOnline()) { | ||
| try (Admin rsAdmin = rs.getConnection().getAdmin()) { | ||
| slowLogs = (List<OnlineLogRecord>)(List<?>)rsAdmin.getLogEntries(new HashSet<ServerName>(Arrays.asList(rs.getServerName())), "SLOW_LOG", ServerType.REGION_SERVER, HConstants.DEFAULT_SLOW_LOG_RING_BUFFER_SIZE, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, in general, we need to get this information from master? Then why not provide it on master status site...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Apache9 Basically the ring buffers that store this slow/large RPC log info operate at RegionServer side, hence individual RegionServer will have it's own ring buffer to provide this logs. As opposed to say BalancerDecision or BalancerRejection logs (which are also built on the same framework - NamedQueue) have ring buffers running at master side, so they are displayed only at master page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If they are on region server, then why we need to use Admin to get these slow logs...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point. We have generic Admin API to retrieve all kind of log records, regardless of whether ring buffers operate on Master or RegionServer.
Admin#getLogEntries here
/**
* Retrieve recent online records from HMaster / RegionServers.
* Examples include slow/large RPC logs, balancer decisions by master.
*
* @param serverNames servers to retrieve records from, useful in case of records maintained
* by RegionServer as we can select specific server. In case of servertype=MASTER, logs will
* only come from the currently active master.
* @param logType string representing type of log records
* @param serverType enum for server type: HMaster or RegionServer
* @param limit put a limit to list of records that server should send in response
* @param filterParams additional filter params
* @return Log entries representing online records from servers
* @throws IOException if a remote or network exception occurs
*/
List<LogEntry> getLogEntries(Set<ServerName> serverNames, String logType,
ServerType serverType, int limit, Map<String, Object> filterParams) throws IOException;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on logType client connect master or RegionServer,
hbase/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java
Line 4257 in 479ae88
| switch (logType){ |
Here we are going to show slow/large logs of RegionSevrver, so instead of making Admin RPC we should directly fetch from HRegionServer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Apache9 @pankaj72981 As @virajjasani says, there is a generic admin API to retrieve all kinds of log entries. If getting logs from RS by admin API is not a good way. Let me think about any good way to retrieve it directly from RS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GeorryHuang Thanks, yes you can try to explore if you are able to directly fetch records from RegionServer.
|
🎊 +1 overall
This message was automatically generated. |
| import="org.apache.hadoop.hbase.client.Admin" | ||
| import="org.apache.hadoop.hbase.client.SnapshotDescription" | ||
| import="org.apache.hadoop.hbase.http.InfoServer" | ||
| import="org.apache.hadoop.hbase.master.HMaster" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These imports should not appear here, I will remove them
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
| List<OnlineLogRecord> largeLogs = null; | ||
|
|
||
| if(rs.isOnline()) { | ||
| try (Admin rsAdmin = rs.getConnection().getAdmin()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid Admin RPC here, can get SLOW_LOG directly from HRegionServer.
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
hbase-server/src/main/resources/hbase-webapps/regionserver/rsOperationDetails.jsp
Outdated
Show resolved
Hide resolved
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
No description provided.