pmemkv
pmemkv copied to clipboard
create_if_missing may cover up the real problem
Consider example:
- I create a testfile for engine cmap
- I now try to create a testfile (within the same path) e.g. for engine radix, with
create_if_missingflag set up - I got error
Failed creating pool: file .../testfile already exists- while I expect to get something like
Failed opening pool: wrong layout ("..."), pool created with layout "..."
- while I expect to get something like
So, to sum up - using create_if_missing flag may conceal from the user the real problem with their pool.
Perhaps we should print both errors (one from the open method and the other one, from the create method) if applicable.
Hm, yes, I think this might be a good idea. We would just need to make sure that in the documentation we have stated exactly what happens for create_if_missing (first create, then open) and also to clear the error if the second call succeeds.