lealone / Lealone

比 MySQL 和 MongoDB 快10倍的 OLTP 关系数据库和文档数据库
Other
2.48k stars 520 forks source link

UndoLog.size()" because "t.undoLog" is null #196

Closed cbqqkcel closed 1 year ago

cbqqkcel commented 1 year ago

2023-08-06T14:31:53.993+08:00 ERROR 21484 --- [nio-8100-exec-4] c.c.i.c.advice.GlobalResponseHandler : Throwable

java.lang.NullPointerException: Cannot invoke "org.lealone.transaction.aote.log.UndoLog.size()" because "t.undoLog" is null at org.lealone.transaction.aote.AOTransactionMap.size(AOTransactionMap.java:243) ~[lealone-aote-5.1.2.jar:na] at org.lealone.db.index.standard.StandardPrimaryIndex.getRowCount(StandardPrimaryIndex.java:343) ~[lealone-db-5.1.2.jar:na] at org.lealone.db.table.StandardTable.getRowCount(StandardTable.java:482) ~[lealone-db-5.1.2.jar:na] at org.lealone.sql.expression.aggregate.BuiltInAggregate.getValue(BuiltInAggregate.java:138) ~[lealone-sql-5.1.2.jar:na] at org.lealone.sql.expression.Alias.getValue(Alias.java:35) ~[lealone-sql-5.1.2.jar:na] at org.lealone.sql.query.QOperator.createRow(QOperator.java:136) ~[lealone-sql-5.1.2.jar:na] at org.lealone.sql.query.QAggregateQuick.run(QAggregateQuick.java:24) ~[lealone-sql-5.1.2.jar:na] at org.lealone.sql.query.YieldableSelect.executeInternal(YieldableSelect.java:92) ~[lealone-sql-5.1.2.jar:na] at org.lealone.sql.executor.YieldableBase.run(YieldableBase.java:97) ~[lealone-sql-5.1.2.jar:na] at org.lealone.sql.StatementBase.syncExecute(StatementBase.java:509) ~[lealone-sql-5.1.2.jar:na] at org.lealone.sql.StatementBase.executeQuery(StatementBase.java:542) ~[lealone-sql-5.1.2.jar:na] at org.lealone.client.jdbc.JdbcStatement.executeQuerySQLCommand(JdbcStatement.java:376) ~[lealone-client-5.1.2.jar:na] at org.lealone.client.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:306) ~[lealone-client-5.1.2.jar:na] at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:65) ~[mybatis-3.5.13.jar:3.5.13]

在查询中突然报了一个这样的错。无法重现。

cbqqkcel commented 1 year ago

升级到最新版依然会有这个问题

codefollower commented 1 year ago

这是个并发 bug,其他事务正在提交把 undo log 置 null 了,所以产生 NPE。 bug 已经修复,感谢报告问题。