Folks, while working to add the "replicas" level to shards (to make room for other properties), I noticed that the Overseer.updateSlice() method changed the existing ClusterState (which is advertised as being immutable). I re-wrote the method to be much shorter, and immutable with respect to the existing ClusterState, and started getting a test failure.
I eventually tried just adding back the part of the code that erroneously modified the existing ClusterState, and the test passed again (see the nocommit block in Overseer).
Any idea what's going on?
edit: the test that failed was LeaderElectionIntegrationTest. Not sure if it caused other failures.
edit: in Overseer.run() we have "ClusterState clusterState = reader.getClusterState();" and that is the state that is accidentally being modified (that accidentally makes things work). I assume the reader is supposed to update it's state via zookeeper - which means there is perhaps something wrong with reader.updateClusterState(true)?