We're writing a Java application that uses BDB HA, using je-5.0.34.
I read about the possibility of the ReplicatedEnvironment constructor throwing a InsufficientLogException (see http://docs.oracle.com/cd/E17277_02/html/ReplicationGuide/logfile-restore.html), usually if the node has been down for a long time. I want to trigger this scenario so I can test that our code to handle this exception works ok.
I had problems achieving this, so have tried modifying the StockQuotes application bundled in the examples/ folder. Here is what I modified:
- It now writes a large number of Quote objects with the same primary key, in an attempt to trigger the Cleaner. I also modified the Quote class to store a large String, for the same reason.
- I modified ReplicationConfig to allow BDB to reclaim log files after a second, like so: repConfig.setConfigParam(ReplicationConfig.REP_STREAM_TIMEOUT, "1 s");
I then inserted lots of Quote objects while one node was down, and then bought the node up again. However, I still don't get this exception. In fact, I see this in the logs:
120404 11:53:59:985 WARNING  Cleaner has 24 files not deleted because they are protected by replication.
My interpretation of this message is that the Cleaner has been forbidden from reclaiming log files because they're needed for replication. This surprises me, because I thought setting REP_STREAM_TIMEOUT to 1s would allow the Cleaner to reclaim the files once the node has been down for one second.
I must be missing something. Can anyone offer any advice on what I'm doing wrong?