Merge branch 'stable-3.0' into stable-3.1

* stable-3.0:
  Revert "Remove documentation of obsolete gerrit.canLoadInIFrame"
  Fix typos in note-db.txt
  Document skipping of reindexing step for offline NoteDB migration
  Report end of NoteDB migration when skipping reindexing
  Clarify that index.batchThreads is relevant for offline reindexing
  Add project to output when reindexing changes in verbose mode
  Auto-flush SiteIndexer's PrintWriters
  Allow to re-index in verbose mode during NoteDB migration
  Avoid closing System.out after All-Users GC in NoteDB migration
  Honor project watches also for changes created via cherry-pick
  Report the index state after re-indexing

Change-Id: Icb446c6b8889e6eea790b2fe5ebc8e83ebc39082
This commit is contained in:
Marco Miller
2020-06-16 13:25:04 -04:00
7 changed files with 23 additions and 5 deletions

View File

@@ -24,7 +24,7 @@ public class CherryPickInput {
public String base;
public Integer parent;
public NotifyHandling notify = NotifyHandling.NONE;
public NotifyHandling notify = NotifyHandling.ALL;
public Map<RecipientType, NotifyInfo> notifyDetails;
public boolean keepReviewers;

View File

@@ -89,7 +89,7 @@ public abstract class SiteIndexer<K, V, I extends Index<K, V>> {
}
protected PrintWriter newPrintWriter(OutputStream out) {
return new PrintWriter(new OutputStreamWriter(out, UTF_8));
return new PrintWriter(new OutputStreamWriter(out, UTF_8), true);
}
private static class ErrorListener implements Runnable {

View File

@@ -202,6 +202,9 @@ public class Reindex extends SiteProgram {
if (result.success()) {
index.markReady(true);
}
System.out.format(
"Index %s in version %d is %sready\n",
def.getName(), index.getSchema().getVersion(), result.success() ? "" : "NOT ");
return result.success();
}
}

View File

@@ -239,7 +239,8 @@ public class AllChangesIndexer extends SiteIndexer<Change.Id, ChangeData, Change
try {
indexer.index(changeDataFactory.create(r.notes()));
done.update(1);
verboseWriter.println("Reindexed change " + r.id());
verboseWriter.format(
"Reindexed change %d (project: %s)\n", r.id().get(), r.notes().getProjectName().get());
} catch (RejectedExecutionException e) {
// Server shutdown, don't spam the logs.
failSilently();