Merge branch 'stable-2.16' into stable-3.0

* stable-2.16:
  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: I560c2c977d5f1b65e37cf213167ed50fef9af590
This commit is contained in:
David Pursehouse
2020-06-16 09:23:23 +09:00
7 changed files with 16 additions and 5 deletions

View File

@@ -2721,7 +2721,7 @@ by the JVM. If set to a negative value, defaults to a direct executor.
[[index.batchThreads]]index.batchThreads:: [[index.batchThreads]]index.batchThreads::
+ +
Number of threads to use for indexing in background operations, such as Number of threads to use for indexing in background operations, such as
online schema upgrades. online schema upgrades, and also for offline reindexing.
+ +
If not set or set to a zero, defaults to the number of logical CPUs as returned If not set or set to a zero, defaults to the number of logical CPUs as returned
by the JVM. If set to a negative value, defaults to a direct executor. by the JVM. If set to a negative value, defaults to a direct executor.

View File

@@ -109,6 +109,13 @@ Migration requires a heap size comparable to running a Gerrit server. If you
normally run `gerrit.war daemon` with an `-Xmx` flag, pass that to the migration normally run `gerrit.war daemon` with an `-Xmx` flag, pass that to the migration
tool as well. tool as well.
[NOTE]
Note that by appending `--reindex false` to the above command, you can skip the
lengthy, implicit reindexing step of the migration. This is useful if you plan
to perform further Gerrit upgrades while the server is offline and have to
reindex later anyway (E.g.: a follow-up upgrade to Gerrit 3.2 or newer, which
requires to reindex changes anyway).
*Advantages* *Advantages*
* Much faster than online; can use all available CPUs, since no live traffic * Much faster than online; can use all available CPUs, since no live traffic

View File

@@ -5985,7 +5985,7 @@ Number of the parent relative to which the cherry-pick should be considered.
Notify handling that defines to whom email notifications should be sent Notify handling that defines to whom email notifications should be sent
after the cherry-pick. + after the cherry-pick. +
Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
If not set, the default is `NONE`. If not set, the default is `ALL`.
|`notify_details` |optional| |`notify_details` |optional|
Additional information about whom to notify about the update as a map Additional information about whom to notify about the update as a map
of recipient type to link:#notify-info[NotifyInfo] entity. of recipient type to link:#notify-info[NotifyInfo] entity.

View File

@@ -24,7 +24,7 @@ public class CherryPickInput {
public String base; public String base;
public Integer parent; public Integer parent;
public NotifyHandling notify = NotifyHandling.NONE; public NotifyHandling notify = NotifyHandling.ALL;
public Map<RecipientType, NotifyInfo> notifyDetails; public Map<RecipientType, NotifyInfo> notifyDetails;
public boolean keepReviewers; 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) { 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 { private static class ErrorListener implements Runnable {

View File

@@ -203,6 +203,9 @@ public class Reindex extends SiteProgram {
if (result.success()) { if (result.success()) {
index.markReady(true); 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(); return result.success();
} }
} }

View File

@@ -236,7 +236,8 @@ public class AllChangesIndexer extends SiteIndexer<Change.Id, ChangeData, Change
try { try {
indexer.index(changeDataFactory.create(r.notes())); indexer.index(changeDataFactory.create(r.notes()));
done.update(1); 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) { } catch (RejectedExecutionException e) {
// Server shutdown, don't spam the logs. // Server shutdown, don't spam the logs.
failSilently(); failSilently();