View Issue Details

IDProjectCategoryView StatusLast Update
0003382SymmetricDSBugpublic2019-05-13 14:26
ReporterandythueringAssigned Topmarzullo 
Prioritynormal 
Status assignedResolutionopen 
Product Version3.9.2 
Target Version3.10.3Fixed in Version 
Summary0003382: MV-Store DB corrupt after stopping SymmetricDS replication software
DescriptionUsing the db replication software SymmetricDS with a MV-Store DB leads to DB corruption and crash of h2 after SymmetricDS is stopped. H2 Versions 1.4.195 and 1.4.196 are affected, older versions were not tested. Migration to PageStore is a workaround.
After starting h2 again reconnection e.g. via Shell works sometimes. On disconnect the following stack trace is shown:
sql> quit
SQL Exception: General error: "java.lang.IllegalStateException: This map is closed [1.4.196/4]" [50000-196]
org.h2.jdbc.JdbcSQLException: General error: "java.lang.IllegalStateException: This map is closed [1.4.196/4]" [50000-196]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbException.java:295)
at org.h2.server.TcpServerThread.sendError(TcpServerThread.java:220)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:160)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: This map is closed [1.4.196/4]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:765)
at org.h2.mvstore.MVMap.beforeWrite(MVMap.java:1044)
at org.h2.mvstore.MVMap.remove(MVMap.java:542)
at org.h2.store.LobStorageMap.removeLob(LobStorageMap.java:342)
at org.h2.store.LobStorageMap.removeLob(LobStorageMap.java:335)
at org.h2.value.ValueLobDb.remove(ValueLobDb.java:233)
at org.h2.engine.Session.removeTemporaryLobs(Session.java:702)
at org.h2.engine.Session.close(Session.java:848)
at org.h2.engine.Database.closeOpenFilesAndUnlock(Database.java:1412)
at org.h2.engine.Database.close(Database.java:1297)
at org.h2.engine.Database.removeSession(Database.java:1179)
at org.h2.engine.Session.close(Session.java:851)
at org.h2.server.TcpServerThread.closeSession(TcpServerThread.java:184)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:290)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:158)
... 1 more

at org.h2.engine.SessionRemote.done(SessionRemote.java:629)
at org.h2.engine.SessionRemote.close(SessionRemote.java:575)
at org.h2.jdbc.JdbcConnection.close(JdbcConnection.java:395)
at org.h2.tools.Shell.promptLoop(Shell.java:313)
at org.h2.tools.Shell.runTool(Shell.java:152)
at org.h2.tools.Shell.main(Shell.java:81)

After this a restart of h2 is needed to get a connection again to the database, connections are no more possible otherwise.
I suppose that SymmetricDS does not close the connections correctly, but this should not lead to a database corruption. The replicated table has some lob fields.
Steps To ReproduceUse h2 database version 1.4.195 or 1.4.196, create a database with the MV-storage engine. Establish a table replication with a table which contains lob fields (not sure if the cause has to to with lobs). Quit SymDS, try reconnecting with a db client to the database. H2 has crashed and a reconnection only works after a restart of h2. On quitting a connection always a "This map is closed" stacktrace occurs and a restart of h2 is needed. Is it possible that SymDS does not close the connections to the db properly on exit?
Tagssym/sym_service

Relationships

related to 0003897 assignedpmarzullo Cleanly exit all job threads when engine is stopped 

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2018-01-19 11:29 andythuering New Issue
2019-04-24 13:15 elong Relationship added related to 0003897
2019-04-24 13:16 elong Tag Attached: sym/sym_service
2019-05-13 14:26 elong Assigned To => pmarzullo
2019-05-13 14:26 elong Status new => assigned
2019-05-13 14:26 elong Target Version => 3.10.3