Details
-
Bug
-
Resolution: Fixed
-
Major
-
6.6.0, 6.6.1, 7.0.0-Beta1
-
Triaged
-
1
-
Yes
Description
What's the issue?
The merge sub-command is broken on Windows. Merges will fail with an error indicating that a file is in use by another process.
Steps to reproduce
1) Install 6.6.x Couchbase Server
2) Setup a single node cluster with only the data service
3) Load a sample bucket
4) Perform three backups (the last two will be empty)
5) Perform a merge
What's the fix?
Provisionally, this looks to be an issue with the atomic update of the cbbackupmgr stats files on Windows; we're failing to rename the file because it's currently open (it's closed using a defer statement). In CC some refactoring work took place which updated the way we read/wrote resources so that more functionality is shared. We should use there function where possible instead of manually encoding JSON and writing to a file. This should fix the issue explained above because the file will be opened/closed in an entirely different scope i.e. by the time we rename the file, it will definitely be closed.