Skip to content

Commit

Permalink
5.4.19-20240428_17142882 release
Browse files Browse the repository at this point in the history
  • Loading branch information
pzxpolar committed May 9, 2024
1 parent 239c6ff commit db4d3a3
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3455,7 +3455,7 @@ public static class ConnectionParamValues {
ConnectionProperties.ADVISE_TYPE, null, true);

public static final BooleanConfigParam ENABLE_HLL = new BooleanConfigParam(
ConnectionProperties.ENABLE_HLL, false, true);
ConnectionProperties.ENABLE_HLL, true, true);

public static final IntConfigParam HLL_PARALLELISM = new IntConfigParam(
ConnectionProperties.HLL_PARALLELISM,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public void read() throws IOException {
lastReadTime = TimeUtil.currentTimeMillis();
if (got < 0) {
logout();
throw new TddlRuntimeException(ERR_PACKET_READ, "end of stream has been reached unexpectedly");
throw new EOFException();
}
buffer.writerIndex(buffer.writerIndex() + got);
netInBytes += got;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public boolean isSchemaCaseSensitive() {
public RelDataType deriveSumType(RelDataTypeFactory typeFactory, RelDataType argumentType) {
RelDataType sumType;
switch (argumentType.getSqlTypeName()) {
case DECIMAL:
return argumentType;
case VARCHAR:
case CHAR:
case BINARY:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import com.alibaba.polardbx.common.utils.MergeHashMap;
import com.alibaba.polardbx.common.utils.Pair;
import com.alibaba.polardbx.common.utils.TStringUtil;
import com.alibaba.polardbx.common.utils.logger.Level;
import com.alibaba.polardbx.common.utils.logger.Logger;
import com.alibaba.polardbx.common.utils.logger.LoggerFactory;
import com.alibaba.polardbx.common.utils.thread.ThreadCpuStatUtil;
Expand Down Expand Up @@ -225,7 +226,7 @@
*/
public final class ServerConnection extends FrontendConnection implements Reschedulable {

private static final Logger logger = LoggerFactory.getLogger(ServerConnection.class);
protected static final Logger logger = LoggerFactory.getLogger(ServerConnection.class);
private static final Logger io_logger = LoggerFactory.getLogger("net_error");
private static final Logger cdcLogger = LoggerFactory.getLogger("cdc_log");
private static final ErrorPacket shutDownError = PacketUtil.getShutdown();
Expand Down Expand Up @@ -2089,29 +2090,18 @@ public void handleError(ErrorCode errCode, Throwable t) {
}

public void handleError(ErrorCode errCode, Throwable t, String sql, boolean fatal) {

String db = this.schema;
if (db == null) {
db = "";
}
// 取得配置文件
SchemaConfig schema = getSchemaConfig();

String message = t.getMessage();
Throwable ex;
if (!ErrorCode.match(message)) {
logger.error(t.getMessage(), t);
if (t instanceof NullPointerException) {
ex = new TddlRuntimeException(ERR_SERVER, "unknown NPE");
message = "unknown NPE";
// NPE (NullPointerException) may not have been handled correctly,
// to avoid the exception being swallowed, print the exception stack trace again.
} else {
ex = new TddlRuntimeException(ERR_SERVER, message);
message = t.getMessage();
}
logger.error(ex.getMessage(), t);
message = ex.getMessage();
} else {
ex = t;
}

String sqlState = null;
Expand Down Expand Up @@ -2152,35 +2142,8 @@ public void handleError(ErrorCode errCode, Throwable t, String sql, boolean fata
io_logger.info(toString(), t);
}
} else {
if (ex instanceof EOFException || ex instanceof ClosedChannelException) {
if (logger.isInfoEnabled()) {
buildMDC();
logger.info(ex);
}
} else if (isConnectionReset(ex)) {
if (logger.isInfoEnabled()) {
buildMDC();
logger.info(ex);
}
} else if (isTableNotFount(ex) || isColumnNotFount(ex)) {
if (logger.isDebugEnabled()) {
buildMDC();
logger.debug(ex);
}
} else if (isMySQLIntegrityConstraintViolationException(ex)) {
if (logger.isDebugEnabled()) {
buildMDC();
logger.debug(ex);
}
} else {
if (logger.isWarnEnabled()) {
buildMDC();
if (schema != null) {
schema.getDataSource().getStatistics().errorCount++;
}
logger.warn("[ERROR-CODE: " + errCode + "][" + this.traceId + "] SQL: " + sql, ex);
}
}
// use origin exception t to judge log level
logError(logger, errCode, sql, t, schema);
}

switch (errCode) {
Expand All @@ -2196,6 +2159,38 @@ public void handleError(ErrorCode errCode, Throwable t, String sql, boolean fata
}
}

protected void logError(Logger logger, ErrorCode errCode, String sql, Throwable ex, SchemaConfig schema) {
if (ex instanceof EOFException || ex instanceof ClosedChannelException) {
if (logger.isInfoEnabled()) {
buildMDC();
logger.info(ex);
}
} else if (isConnectionReset(ex)) {
if (logger.isInfoEnabled()) {
buildMDC();
logger.info(ex);
}
} else if (isTableNotFount(ex) || isColumnNotFount(ex)) {
if (logger.isDebugEnabled()) {
buildMDC();
logger.debug(ex);
}
} else if (isMySQLIntegrityConstraintViolationException(ex)) {
if (logger.isDebugEnabled()) {
buildMDC();
logger.debug(ex);
}
} else {
if (logger.isWarnEnabled()) {
buildMDC();
if (schema != null) {
schema.getDataSource().getStatistics().errorCount++;
}
logger.warn("[ERROR-CODE: " + errCode + "][" + this.traceId + "] SQL: " + sql, ex);
}
}
}

public void handleErrorForTrx(Throwable t) {
// Handle specific errors.
if (t.getMessage().contains("Unknown system variable 'innodb_mark_distributed'")) {
Expand Down
2 changes: 1 addition & 1 deletion saveVersion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fi
# for rpm
if [ "x${RELEASE}" != "x" ];then
# since 5.4.19, version changes into "5.4.19-${DATE}_${BUILDNUMBER}-SNAPSHOT"
ec="echo $version | sed 's/SNAPSHOT/$RELEASE/g'"
ec="echo $version | sed 's/_.*-SNAPSHOT//'"
version=`eval $ec`
elif [ "x${FW_BRANCH_NAME}" != "x" ]; then
# for fastwork read from rpm tag build name
Expand Down

0 comments on commit db4d3a3

Please sign in to comment.