internal Firebird consistency check (Incorrect snapshot deallocation - too few slots) -------------------------------------------------------------------------------------
Key: CORE-5930 URL: http://tracker.firebirdsql.org/browse/CORE-5930 Project: Firebird Core Issue Type: Bug Components: Engine Affects Versions: 4.0 Beta 1 Environment: Firebird-4.0.0.1227-0_x64 Windows 10 + Jaybird master Reporter: Mark Rotteveel I was just running the Jaybird tests against Firebird-4.0.0.1227-0_x64 (Windows 10). It has been a while since I tested with Firebird 4, so I don't know when this problem was introduced. When running the test org.firebirdsql.gds.TestReconnectTransaction.testReconnectTransaction, I get an error when trying to rollback a limbo transaction: java.sql.SQLException: internal Firebird consistency check (Incorrect snapshot deallocation - too few slots) [SQLState:XX000, ISC error code:335544333] In short this test will create a connection, start a transaction, prepare that transaction and then close the connection. This will create a limbo transaction. It then creates a new connection, start a transaction, look for the limbo transaction, reconnects the limbo transaction, and then rolls back the limbo transaction. The rollback of the limbo transaction is what fails. Test: https://github.com/FirebirdSQL/jaybird/blob/master/src/test/org/firebirdsql/gds/TestReconnectTransaction.java#L86 I have tried setting ReadConsistency = 0 in firebird.conf, but that has made no difference. After running this test, the log contains the following entries: """ RAMONA Sat Sep 29 18:05:26 2018 Database: D:\DEVELOPMENT\PROJECT\JAYBIRD\JAYBIRD\FBTEST.FDB internal Firebird consistency check (Incorrect snapshot deallocation - too few slots) RAMONA Sat Sep 29 18:05:27 2018 INET/inet_error: read errno = 10054, client host = Ramona, address = 127.0.0.1/61486, user = Mark RAMONA Sat Sep 29 18:05:27 2018 I/O error during "WriteFile" operation for file "D:\DEVELOPMENT\PROJECT\JAYBIRD\JAYBIRD\FBTEST.FDB" Error while trying to write to file The handle is invalid. RAMONA Sat Sep 29 18:05:27 2018 Database: D:\DEVELOPMENT\PROJECT\JAYBIRD\JAYBIRD\FBTEST.FDB I/O error during "WriteFile" operation for file "D:\DEVELOPMENT\PROJECT\JAYBIRD\JAYBIRD\FBTEST.FDB" Error while trying to write to file The handle is invalid. """ After this error has occurred, it also doesn't seem possible to gracefully shutdown Firebird. It seems to hang. After shutting down, new connections are rejected, but the process does not stop and needs to be killed. Attempting to connect after trying to stop Firebird logs: """ RAMONA Sat Sep 29 18:07:55 2018 Authentication error connection shutdown """ Likely a related issue, another test (org.firebirdsql.gds.ng.wire.version10.TestV10Transaction.testBasicPrepareAndRollback) gets stuck. This test creates a connection, starts a transaction (read committed record version wait), inserts a value into a table, prepares the transaction (to be committed later in the test). Test: https://github.com/FirebirdSQL/jaybird/blob/master/src/test/org/firebirdsql/gds/ng/AbstractTransactionTest.java#L154 (it hangs on assertValueForKey(key, false, null);) Then in a separate connection + transaction (also read committed record version wait), the test attempts to select from the table. This connection is stuck fetching rows (even when setting ReadConsistency = 0 in firebird.conf). This works fine in Firebird 3 and earlier. With setting ReadConsistency = 0 in firebird.conf this is logged (after killing the test): """ RAMONA Sat Sep 29 18:28:36 2018 INET/inet_error: read errno = 10054, client host = Ramona, address = 127.0.0.1/61927, user = Mark RAMONA Sat Sep 29 18:28:36 2018 INET/inet_error: read errno = 10054, client host = Ramona, address = 127.0.0.1/61926, user = Mark """ With setting ReadConsistency = 1 in firebird.conf: """ RAMONA Sat Sep 29 18:31:27 2018 INET/inet_error: read errno = 10054, client host = Ramona, address = 127.0.0.1/61943, user = Mark RAMONA Sat Sep 29 18:31:27 2018 INET/inet_error: read errno = 10054, client host = Ramona, address = 127.0.0.1/61944, user = Mark RAMONA Sat Sep 29 18:31:27 2018 Database: D:\DEVELOPMENT\PROJECT\JAYBIRD\JAYBIRD\FBTEST.FDB internal Firebird consistency check (TPC: Attempt to mark inactive transaction to be in limbo) RAMONA Sat Sep 29 18:31:27 2018 I/O error during "WriteFile" operation for file "D:\DEVELOPMENT\PROJECT\JAYBIRD\JAYBIRD\FBTEST.FDB" Error while trying to write to file The handle is invalid. RAMONA Sat Sep 29 18:31:27 2018 Database: D:\DEVELOPMENT\PROJECT\JAYBIRD\JAYBIRD\FBTEST.FDB I/O error during "WriteFile" operation for file "D:\DEVELOPMENT\PROJECT\JAYBIRD\JAYBIRD\FBTEST.FDB" Error while trying to write to file The handle is invalid. """ Interestingly after this test, Firebird has no problem shutting down with setting ReadConsistency = 0, but hangs with setting ReadConsistency = 1. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel