最近遇到hive执行create,drop table语句时出现延时其它语句正常,平时秒级现在都需要200s才完成。经过排查发现有个用户使用手机号做动态分区字段,导致一下有上百万分区写入,hive metastore server出现问题,线程数飙升至1k多,内存升高。将任务停止后线程数下降,内存下降恢复正常水平,但是create,drop table还是不正常耗时200s才执行完成。
sentry出现如下警告日志:
timed out wait request for id xxxx
hive metastore server 出现如下Error日志:
Failed to sync requested HMS notifications up to the event ID xxxxx
查看sentry 异常CounterWait源码发现传递的id比 currentid 大导致一直等待超时,超时时间为200s。
public long waitFor(long value) throws InterruptedException, TimeoutException {
// Fast path - counter value already reached, no need to block
if (value <= currentId.get()) {
return currentId.get();
}
// Enqueue the waiter for this value
ValueEvent eid =