rengolin/HPCC-Platform — comment on commit 435320365f5ab6a8419d8d280e0b99ab94c5cb15
File:  line 0
By rengolin:

The default behaviour is explicit in the constructor, setting ```defaultCopies``` to 2. This code means that, only when that function is used to get a file descriptor, the variable will be unconditionally set to 1, for whatever reason.

I don't understand the whole meaning of ```defaultCopies```, but according to the facts I have, and the fact that this is being changed elsewhere (when dealing with clusters and file parts), I believe this ok.

Facts:

* ```defaultCopies``` is the number of replicates a file will have. 1 means it's not possible to replicate (thus, we have that failure), 2 or more means we can replicate (or is already replicated) and it'll find N nodes to replicate to (or not replicate at all). 0 is not possible, and only happens if the file didn't have that value (but had ```redundancy```) in the first place.
* Some places set the value to 1 on external files, which makes sense, since you can't replicate an external file, nor you have copies of it in your own local DFS.
* Other places set ```@redundancy``` to 1 if ```defaultCopies``` is either 0 (previously non-existent) or more than 1, meaning that being redundant is the default behaviour.
* Redundancy is determined by the number of copies, if I force ```defaultCopies``` as 1, on the next round, a file that had redundancy, will not have it any more (it's still persisted as ```@redundancy```).

I'm not sure this is the best place, but it seems like a good change. If other parts of the system fail because of this, and I can't see why they would after looking at all the places that use this variable, we should fix it in the right place. To me, it looks as if that line was added in a rush to fix another bug, just as other lines I showed you earlier.

However, this does't fix the underlying issue of IPs being zero. But that issue will be revisited when we implement URI naming system, so I'm not too concerned about it now...