One of the goals of the InChI project was to ensure uniqueness: 
Strict uniqueness of identifier
The same label always means the same substance, and the same substance always receives the same label (under the same labelling conditions). This is achieved through a well-defined procedure of obtaining canonical numbering of atoms.
Whilst this is often the case for InChI strings, there are some (complex) examples where the above goal has not been met, for example in the natural product Spongistatin (below) where two isomers incidentally have the same InChI key: 
Although InChI can sometimes break (as per above) most of the issues with InChI strings are with implementation (how the structure is parsed to the thing generating the string in the first place). Several (common) features are at present un-supported by the InChI implementation:
- Complex organometallics
- Markush structures
- Excited state and spin isomers
- Local stereochemistry/chirality
- Topological isomers
- Cluster molecules
- Unspecific isotopic enrichment
Generation of InChI strings
InChI is, by nature, an algorithm designed to be ran by a computer. Whilst strings can be parsed by humans (with ennough effort), the complexity of the strings is such that it is challenging to ensure they're correct. The InChI FAQ specifically deals with this:
You should not do so (though you of course can). This may give apparently reasonable answers but it is error-prone and may break relations in the InChI.
The most recent implementation of InChI is provided by the InChI trust, open source and free of charge.
As alluded to above, a common source of InChI errors is the way in which the structure of interest is passed to the algorithm rather than with a fundamental flaw with the process used to generate it. Sh*t in, sh*t out, so to speak.
To give a concrete example, consider the heterocyclic system below:
Clearly, the two tautomeric forms cannot be distinguished chemically, but depending on how the InChI string is generated, they may end up having the same or different strings. In this case, we need to specify to the InChI algorithm whether we want to fix the hydrogens (to show a single tautomer, each of which would have a unique InChI string), or not fix them (such that both tautomers have the same InChI string)
The real question you're possibly interested in isn't
How to determine the correct InChI for a certain compound?, but rather
How to validate an InChI string for a certain compound?.
Given the complexity of the InChI strings, this is a challenging thing, and to my knowledge there is no tool which allows a string to be provided and says whether it is valid or not (similarly you can't provide a proposed IUPAC name to any tool which will say whether it is the IUPAC preferred name).
One thing you can do is use the InChI string to generate a structure (ChemDraw does this). Using your strings from the question, it's evident that they actually refer to different forms of the molecule (cyclic vs acyclic, just imagine the terminal primary alcohol attacking the ketone).
Chemically, it may be that the cyclic and acyclic forms are in equilibrium- in this case there is no way for InChI to represent the mixture (and hence which structure used to generate the string is ambiguous). It could also be that they are separable chemically and not interconverting, in which case quite rightly they should have different InChI strings.
: Journal of Cheminformatics, 2015, 7, 23
: http://www-jmg.ch.cam.ac.uk/data/inchi/ Accessed 3-Sept-2017