This is mitigated to some extent by randomly choosing the trigger to resume after cool down. It is recommended that scheduled triggers not be used for very frequent operations to avoid this problem.
Prior to this commit, new ZK nodes being simulated by the sim framework
were started with a version of -1. This causes problems, since -1 is
also coincidentally the flag value used to ignore optimistic concurrency
locking and force overwrite values.
While working on a related issue in SimDistribStateManager, I noticed
that `createData()` only worked successfully on nodes nested more than
one level under root. (i.e. `createData("/foo", someData, mode)` would
fail, while the same with "/foo/bar" wouldn't). This was due to an edge
case in SimDistribStateManager's path building logic. This commit fixes
this issue.
Today we have #numDocs() and #maxDoc() on IndexWriter. This is enough
to get all stats for the current index but it's subject to concurrency
and might return numbers that are not consistent ie. some cases can
return maxDoc < numDocs which is undesirable. This change adds a getDocStats()
method to index writer to allow fetching consistent numbers for these stats.
This change also deprecates IndexWriter#numDocs() and IndexWriter#maxDoc()
and replaces all their usages wiht IndexWriter#getDocStats()
Many of Solr's tests use CloudTestUtils' `waitForState` and
`clusterShape` methods to wait until a SolrCloud cluster matches a
particular expected shape. The code periodically checks on the cluster
state, and logs a message if a collection doesn't match the state we
expect of it. Prior to this commit, these log messages omitted the
collection name though, which makes things a little confusing when a
test is checking on the state of multiple collections simultaneously (as
can happen when Triggers fire in the background).
as much as possible, the tests actual use the time source directly from the cluster, so that even if the cluster is changed to use an alternate time source, the tests will be consistent
test no longer depends on changing static non-final non-volatile variables used by multiple threads
test also no longer depends on arbitrary sleep calls, instead threads await/poll on concurrent signaling objects/queues