I believe this will be to avoid a file being reclaimed during a sync on backup?
The proper way would be to change setAutoReclaim(false). That attribute is currently for test only but it could be used for this purpose.. while you would just need to change the visibility of the method.
I will wait Francisco on this, as I'm a bit confused about it.
My bad. I had misundestood the meaning of the API (which is not a real excuse since studying the code clearly makes it easy to discover what happens, OTOH having some minimal javadoc for these would make such SNAFUs much harder to make).
This removes the wrong API call: https://github.com/hornetq/hornetq/commit/61d50577a75deb387d5f1c3bba9932710615bacd
This one adds Javadoc documentation to the methods: https://github.com/hornetq/hornetq/commit/6416853d5d3acfd04308b0a711f4dbe2ee8ce95f
You still need to disable reclaiming while you are doing the copies. Are you setting the reclaim attribute anywhere?