FoundationDB/sql-layer — pull request #973 by nathanlws (2013-10-12 21:53:07+00:00)
Title: Move full text population to foreground and misc cleanup

In the process of pinning down intermittent failures when running `mvn verify` on FDB it became clear the full text background stuff still wasn't right.

A few problems are present:
- IndexWriter#rollback() *closes* the writer, which cannot be reopened
- IndexWriter#commit() called before the SQL Transaction was committed
- Background update could execute before the background populate

The last two could result in two, or more, Lucene entries for a single logged update.

Handling the rollback is just a big of reorganization to recreate it. Committing the layer before the writer is also straight forward -- while an inconsistent index is still possible, a file system failure is less likely than a SQL rollback.

Populate could perform delete + add or a more complex synchronization strategy could be devised. Both of those seem wasteful and the latter overkill. Given that background population doesn't really buy us anything, not to mention FT is disabled by default, just move it to the foreground to avoid the mess.

On sleepy, running the text portion of RestServiceFilesIT in a hard loop would fail a pretty high portion of the time. After 250 good runs in a row with these changes, I'm calling it good.