summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Set version to 3.3.11v3.3.11Luca Milanesio2022-05-215-5/+5
| | | | | Release-Notes: skip Change-Id: I1e4c75316601de11c9dc7512643b3a4801fb2035
* Merge branch 'stable-3.2' into stable-3.3Luca Milanesio2022-05-208-87/+311
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.2: Set PerThreadCache as readonly after creating a new patch-set Set PerThreadCache as readonly when formatting change e-mails Set PerThreadCache as readonly when formatting change JSON Set PerThreadCache as readonly after deleting a change Set PerThreadCache as readonly after abandoning a change Set PerThreadCache as readonly after merging a change Set PerThreadCache as readonly after posting review comments Introduce unloaders on PerThreadCache entries RepoRefCache: Hold a reference to the refDatabase with ref counting Remove use of RefCache in ChangeNotes Revert "Cache change /meta ref SHA1 for each REST API request" Cache change /meta ref SHA1 for each change indexing task Release-Notes: skip Change-Id: Ic3981c1fad0a1f8c232a72d858b8521d2407c0ff
| * Merge branch 'stable-3.1' into stable-3.2Luca Milanesio2022-05-204-1/+300
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.1: Set PerThreadCache as readonly after creating a new patch-set Set PerThreadCache as readonly when formatting change e-mails Set PerThreadCache as readonly when formatting change JSON Set PerThreadCache as readonly after deleting a change Set PerThreadCache as readonly after abandoning a change Set PerThreadCache as readonly after merging a change Set PerThreadCache as readonly after posting review comments Introduce unloaders on PerThreadCache entries [I] RepoRefCache: Hold a reference to the refDatabase with ref counting Remove use of RefCache in ChangeNotes Cache change /meta ref SHA1 for each change indexing task Only the commit prefixed by [I] is included, all the others are reverted in the merge because they are not needed to be merged upstream from stable-3.2 onwards. Since stable-3.2 we have more general solution to the problem with modules/cached-refdb [1] which provides a pluggable cached refdatabase without the need to fiddle with the thread-local caching. [1] https://gerrit-review.googlesource.com/admin/repos/modules/cached-refdb,branches Release-Notes: skip Change-Id: Ibc0485dfb37e6d4c7c46e34959f9ab6513838ecb
| | * Merge branch 'stable-3.0' into stable-3.1Luca Milanesio2022-05-2021-245/+1148
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.0: Set PerThreadCache as readonly after creating a new patch-set Set PerThreadCache as readonly when formatting change e-mails Set PerThreadCache as readonly when formatting change JSON Set PerThreadCache as readonly after deleting a change Set PerThreadCache as readonly after abandoning a change Set PerThreadCache as readonly after merging a change Set PerThreadCache as readonly after posting review comments Introduce unloaders on PerThreadCache entries RepoRefCache: Hold a reference to the refDatabase with ref counting Remove use of RefCache in ChangeNotes Cache change /meta ref SHA1 for each change indexing task Also adapt TestRepositoryWithRefCounting by overriding the getIdentifier() method to adapt to the new Repository interface definition in JGit. Release-Notes: skip Change-Id: Ic7a9772f1624513607ed9a255591466763851490
| | | * Merge branch 'stable-2.16' into stable-3.0Luca Milanesio2022-05-2021-244/+1142
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-2.16: Set PerThreadCache as readonly after creating a new patch-set Set PerThreadCache as readonly when formatting change e-mails Set PerThreadCache as readonly when formatting change JSON Set PerThreadCache as readonly after deleting a change Set PerThreadCache as readonly after abandoning a change Set PerThreadCache as readonly after merging a change Set PerThreadCache as readonly after posting review comments Introduce unloaders on PerThreadCache entries RepoRefCache: Hold a reference to the refDatabase with ref counting Remove use of RefCache in ChangeNotes Cache change /meta ref SHA1 for each change indexing task Also fix formatting of: java/com/google/gerrit/acceptance/GerritServer.java java/com/google/gerrit/server/mail/send/OutgoingEmail.java Release-Notes: skip Change-Id: I7fab22d2bfae52294b0f7d237a0d26b9fafa54d6
| | | | * Set PerThreadCache as readonly after creating a new patch-setLuca Milanesio2022-04-292-14/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply the same optimisation made for Change-Id: I1b71bfcf to the production of events after creating a new patch-set and for returning the merged change JSON response. The same considerations of performance improvement and reduction of /meta refs lookup are valid in this use-case. Release-Notes: enable the read-only cache of /meta refs for new patch-sets Change-Id: I58abd12f3779e0a57c1f8cda618905c9c0bb9b7e
| | | | * Set PerThreadCache as readonly when formatting change e-mailsLuca Milanesio2022-04-293-118/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply the same optimisation made for Change-Id: I1b71bfcf to the formatting the change e-mails body, which is done synchronously to the incoming REST API and thus impacts the latency perceived by the end user. The composition of the e-mail is using multiple information coming from multiple fields from NoteDb and calls the /meta refs lookups multiple times for the same change. The same considerations of performance improvement and reduction of /meta refs lookup are valid in this use-case. Release-Notes: enable the read-only cache of /meta when producing JSON Change-Id: I993d4ddc37cf27b66ea9d7323963e761564603fa
| | | | * Set PerThreadCache as readonly when formatting change JSONLuca Milanesio2022-04-291-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply the same optimisation made for Change-Id: I1b71bfcf to the formatting of change JSON output as return value for REST APIs. The ChangeJson class needs to read multiple fields from NoteDb and calls the /meta refs lookups multiple times for the same change JSON output (e.g. formatting the output JSON of an abandoned change generates 23 refs lookups calls for a single change). The same considerations of performance improvement and reduction of /meta refs lookup are valid in this use-case. Release-Notes: enable the read-only cache of /meta when producing JSON Change-Id: Ic0e747352dcd8a0c2c1348a9878a5a4165777abd
| | | | * Set PerThreadCache as readonly after deleting a changeLuca Milanesio2022-04-292-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply the same optimisation made for Change-Id: I1b71bfcf to the production of events after deleting a change. The same considerations of performance improvement and reduction of /meta refs lookup are valid in this use-case. Release-Notes: enable the read-only cache of /meta refs for deleted changes Change-Id: Ic04e9257b7801bd331390679e00e1f980a9d1d19
| | | | * Set PerThreadCache as readonly after abandoning a changeLuca Milanesio2022-04-292-15/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply the same optimisation made for Change-Id: I1b71bfcf to the production of events after abandoning a change. The same considerations of performance improvement and reduction of /meta refs lookup are valid in this use-case. Release-Notes: enable the read-only cache of /meta refs for abandoned changes Change-Id: Iab71eca5ead78f6462fd3aaf41eb9590fce4684e
| | | | * Set PerThreadCache as readonly after merging a changeLuca Milanesio2022-04-293-15/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply the same optimisation made for Change-Id: I1b71bfcf to the production of events after merging a change and for returning the merged change JSON response. The same considerations of performance improvement and reduction of /meta refs lookup are valid in this use-case. Release-Notes: enable the read-only cache of /meta refs for merged changes Change-Id: I34e147d644dfcdb5a6b1baa32cd4347805e506fc
| | | | * Set PerThreadCache as readonly after posting review commentsLuca Milanesio2022-04-298-41/+468
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once the review comments mutations have been completed, it is safe to cache the results of the /meta refs lookups, avoiding the slowdown of the repeated refs lookups performed during the creation of the event with the added review and the dispatching of the stream event associated. The refs lookups could be as slow as 400 ms per lookup for a 500k refs repository on a shared NFS volume: using a thread-local cache for /meta ref lookup has a significant improvement (50% less refs lookups) on the overall user-experience. Introduce also the safety-net of checking for stale cached refs against the underlying repository, so that errors can arise during testing. The staleness checker can be enabled via system property. NOTE: The execution of the listeners logic associated with the review is left outside the read-only request window because of the risk of a plugin or hook updating the underlying /meta ref and causing a stale read. Also rename the current hasReadonlyRequest method to isReadonlyRequest, which is consistent with the new setter introduced in the PerThreadCache class. P.S. DO REVERT this change from stable-3.2 onwards because the refs lookups have been optimised already with the introduction of the cached-refdb libModule [1] which is enough to cover all use-cases introduced in the PerThreadCache for refs lookups. [1] https://gerrit.googlesource.com/modules/cached-refdb/ Bug: Issue 15798 Release-Notes: enable the read-only cache of /meta refs after review Change-Id: I1b71bfcff081e66eed897d41539d2be675f34af4
| | | | * Introduce unloaders on PerThreadCache entriesLuca Milanesio2022-04-293-22/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RepoRefCache holds reference to a Repository object which would need once the cache entry is removed. Add the logic to cleanup the entry resource when the cache is closed and therefore entries need to be cleaned up before being removed from cache. Release-Notes: skip Change-Id: Id201d4a93792b27d2e1ab8214aa6377387eb567f
| | | | * RepoRefCache: Hold a reference to the refDatabase with ref countingLuca Milanesio2022-04-285-4/+320
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RepoRefCache was holding a reference to a refDatabase associated to a Repository object that was created externally and could have been already closed once the RepoRefCache.get was called. Increment and decrement the reference counting for the Repository object held in the RepoRefCache, making sure that all accesses to the get() and other methods are always using an active and open repository. The problem existed for years but it was never noticed because of JGit being very flexible on using repositories even when their reference counting is zero and they are effectively closed. However, using a closed repository is inconsistent with its interface and may lead to further issues in the past, because of JGit not being aware of the repository is actually used by an in-memory cache holding a reference to it. Add one extra relevant tests associated with this corner case for showing the issue, using a TestRepositoryWithRefCounting wrapper that fails when accessing a refDatabase of a closed repository. Release-Notes: skip Change-Id: I4b2c43ea430a0506c73101bc4f6bc62926d5a094
| | | | * Remove use of RefCache in ChangeNotesLuca Milanesio2022-04-253-19/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RefCache instance stored in the ChangeNotes refs field was passed as a nullable parameter but, effectively, always passed as null value in all invocations form the code-base. The refs field was also final, which means that it wasn't possible to memoize or cache any RefCache instance on it anyway. Remove the field and its use across the code-base, so that the code becomes easier to read and maintain. The cache was initially introduced in ChangeNotes with I5e02032d6 and used by the ChangeRebuilderImpl; however the implementation on how changes are rebuilt was changed with Icc942dba25 which did not require anymore the use of a RepoRefCache in ChangeNotes. However, Dave forgot to remove the refs from ChangeNotes which was left unused since then. Release-Notes: skip Change-Id: I729ad8738fd4ceebe72e61f086631f2d109a817a
| | | | * Cache change /meta ref SHA1 for each change indexing taskLuca Milanesio2022-04-113-22/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Interactive indexing tasks of changes are executed synchronously with the incoming API: multiple lookups of change /meta ref name to SHA1 during the reindexing can compromise the performance of the API. The refs lookups could be as slow as 400 ms per lookup for a 500k refs repository on a shared NFS volume. Leverage the existing RepoRefCache associated with the PerThreadCache by creating a read-only cache during the execution of the indexing task. NOTE: The indexing task may be part of a mutable API (e.g. review a change); however, the operation itself is readonly because it is executed once the mutation has already happened and no further modifications to the change are done during the reindexing. Bug: Issue 15798 Release-Notes: cache the resolution of change /meta ref upon interactive indexing Change-Id: If137693293e3a6a5aa51babb5576690878d827d3
| * | | | Revert "Cache change /meta ref SHA1 for each REST API request"Luca Milanesio2022-04-235-86/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 23db8a546b800b2c91629d80b6f5117ff635238a. Reason: refs caching on stable-3.2 can be achieve using [1]. [1] https://gerrit.googlesource.com/modules/cached-refdb/ Release-Notes: skip Change-Id: I44ad6fbe165bed57c3d639a6a0878f704139b7b3
* | | | | Merge "Bump bazel version to 4.2.2" into stable-3.3Orgad Shaneh2022-05-171-1/+1
|\ \ \ \ \
| * | | | | Bump bazel version to 4.2.2Orgad Shaneh2022-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Release-Notes: skip Change-Id: I6a326853221c34d4e20b12e283a19c3bf7a039b9
* | | | | | Update git submodulesSaša Živkov2022-05-121-0/+0
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update plugins/replication from branch 'stable-3.3' to fb4854b57300f1060690b59722eae8c3a18cdab5 - Allow to cancel waiting tasks for non-existing repos without scheduling them A waiting task for a non-existing repository can come into existence when the repository gets deleted before a waiting task gets scheduled, and thus becomes a running task. A waiting task for a non-existing repository cannot be (re)scheduled because there is a check for repository existence in that code-path. However, such a task would remain in the waiting queue and rescheduling would be tried again and again without a chance to get finished as the only way for a task to get finished was to run it. This change allows to finish a waiting task when its repository doesn't exist. The ReplicationTasksStorage now tries to delete task file(s) from both running and waiting directories. Change-Id: Ibbdd5023e2a008484215da02403c9935d21fbf13
* | | | | Fix bazel build on Mac M1 (aarch64)Matthias Sohn2022-04-251-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running the bazel build on Mac M1 yields the following error: Configurable attribute "actual" doesn't match this configuration: Could not find a JDK for host execution environment, please explicitly provide one using `--host_javabase.` Follow hints in [1] and fix this by loading bazel platforms 0.0.5 which contains a fix [2] making aarch64 an alias of arm64. [1] https://github.com/bazelbuild/bazel/issues/13573 [2] https://github.com/bazelbuild/platforms/pull/22 Release-Notes: Fix bazel build on Mac M1 (aarch64) Change-Id: I5a4ebcd50012a53e5ff92a12e4fa8ba766aed0a7
* | | | | Use original servlet-api 3.1.0 artefact instead of tomcat's copyMatthias Sohn2022-04-112-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gerrit uses tomcat's copy org.apache.tomcat:tomcat-servlet-api:8.5.23 of javax.servlet:javax.servlet-api:3.1.0. Earlier we used Jetty's copy of the servlet-api which was replaced by Tomcat's copy in change Ica04d0c19306da9afcadf3919581632f7df93483 This hurts us since Whitesource scans raise Tomcat 8.5.23 vulnerabilities for this dependency since it's not smart enough to recognize that we only use the Tomcat servlet-api artefact which has no vulnerability. Use the original servlet-api instead of Tomcat's copy to get rid of this issue. Change-Id: I800d8429f08894f29eb66a0627f50ed2e55e0d54 Release-Notes: Use original javax.servlet-api instead of tomcat's copy
* | | | | Merge branch 'stable-3.2' into stable-3.3Luca Milanesio2022-04-086-11/+90
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.2: Cache change /meta ref SHA1 for each REST API request Release-Notes: skip Change-Id: I98184b81a00eec5b3b7d9fed44c6701532a3bf6b
| * | | | Merge branch 'stable-3.1' into stable-3.2Luca Milanesio2022-04-086-11/+90
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.1: Cache change /meta ref SHA1 for each REST API request Release-Notes: skip Change-Id: I858522129b67f1e14720728f5d00b0f7c75f933e
| | * | | Merge branch 'stable-3.0' into stable-3.1Luca Milanesio2022-04-086-11/+90
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.0: Cache change /meta ref SHA1 for each REST API request Release-Notes: skip Change-Id: Ifaca2a4a00f9b7a3c9bb72f9a2b0d95c8c039009
| | | * | Merge branch 'stable-2.16' into stable-3.0Luca Milanesio2022-04-086-11/+90
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-2.16: Cache change /meta ref SHA1 for each REST API request Release-Notes: skip Change-Id: I00882cba94ae51998ad0b34ab17b0fa4e2f4ecf5
| | | | * Cache change /meta ref SHA1 for each REST API requestLuca Milanesio2022-04-086-12/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some Gerrit REST APIs may cause multiple lookups of change /meta ref name to SHA1 during the same request, which could be as slow as 400 ms per lookup for a 500k refs repository on a shared NFS volume. Make sure that a lookup of a /meta ref happens only once per GET/HEAD API request by caching the result in a PerThreadCache scoped to the execution of the RestApiServlet. The measured improvement for a change reindex API (repo with 500k refs stored on an external NFS volume with trustfolderstat=false) is from 5s down to 500ms (10 times faster). For other APIs or local storage with trustfolderstat=true, the benefits are much more limited. NOTE: The improvement on all other APIs (PUT, POST, DELETE, PATCH) is outside the scope of this change, because it would imply a more complex eviction mechanism due to the mutation of the /meta ref during the potential NoteDb manipulation performed. Bug: Issue 15798 Release-Notes: cache the resolution of change /meta ref on REST API Change-Id: If41377b78cb0bbbde0fb22489a47f7634248e6f6
* | | | | Merge changes from topic "fix-build-on-M1-mac" into stable-3.3Saša Živkov2022-04-0813-56/+207
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: Bazel: Bump rules_nodejs version to 5.1.0 Bump rules_nodejs to version 3.0.0
| * | | | | Bazel: Bump rules_nodejs version to 5.1.0David Ostrovsky2022-03-1711-51/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See [1] and [2] for some background documentation. The new dependency on @bazel/concatjs is unfortunate, but that is where ts_library has moved. And we have spent 2 hours trying to get ts_project to work instead, and failed. So I guess we have to live with this for now. Without `symlink_node_modules` in `yarn_install` the `node_modules` directory would not appear anymore next to the package.json file. It would only appear in Bazel's out directories. That breaks all sorts of things, `server.go` for example cannot cope at all without `node_modules` being present. [1] https://github.com/bazelbuild/rules_nodejs/releases/tag/5.0.0 [2] https://github.com/bazelbuild/rules_nodejs/wiki/Migrating-to-5.0 Release-Notes: Update rules_nodejs version to 5.1.0 Bug: Issue 15771 Change-Id: Iba20c21e9a6ec83fb3c1c2fdd28f2908cdf249cb
| * | | | | Bump rules_nodejs to version 3.0.0David Ostrovsky2022-03-177-32/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Version 3.0.0 fixed some bugs and added new features: [1]. yarn_install and npm_install will now fail if the lockfile is out-of-date, rather than update it. This assumes that the tooling to manually update the lockfile is used. yarn_install now passes --frozen_lockfile by default, but it can use yarn_install(frozen_lockfile = False) to go back to the old behavior. New @bazel/typescript module is stricter now and added third party strictness checks to the typescript compiler. The new check is flagging this code as invalid: tools/node_tools/node_modules_licenses/installed-node-modules-map.ts:75:25 - error TS21231: [tsetse] type assert `JSON.parse() as SomeExplicitType` for type & optimization safety. See http://tsetse.info/must-type-assert-json-parse. const version = JSON.parse(fs.readFileSync(packageJsonFile, {encoding: 'utf-8'}))["version"]; Disable this check: must-type-assert-json-parse, as fixing it is outside of the scope of this change. [1] https://github.com/bazelbuild/rules_nodejs/releases/tag/3.0.0 Release-Notes: skip Bug: Issue 15771 Change-Id: I6835e29a00080ca90b649663361e261ad6ef0f8b
* | | | | | Validation on Invalid Filter Expression in User-Set NotificationsWendy Wang2022-04-053-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if a user sets a notification with an invalid query as the filter, gerrit accepts the filter and fails on each query parse attempt, resulting in many error messages to the error_log. With this change, the user instead receives a 400 'invalid query' message when they attempt to save the notification setting, and the invalid query is not saved. Change-Id: I74ea902902956d4b039e67e54930c35eb413d568 Release-Notes: Invalid filter expressions for notifications are rejected
* | | | | | Update git submodulesSaša Živkov2022-04-031-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update plugins/replication from branch 'stable-3.3' to 6e04fc32f87780e949c4213a6f028cc0d6a0c575 - Do not retry replication when local repository not found When many repositories get created and deleted in a quick succession it may happen that a repository gets deleted before its replication task starts. Such replication task will keep retrying, possibly indefinitely, but has no chance to succeed. Another scenario where this issue can occur is when a repository gets created but a replica is not reachable for some time. If the repository gets deleted before the replica gets reachable again, the replication task will keep retrying but the local repository will not exist. When handling the RepositoryNotFoundException in PushOne, set the retrying flag to false. This ensures that this replication task is not retried and gets finished. Bug: Issue 15804 Change-Id: Ia55c5ec1c961f4c2aec9ecee8056f22b436e9fda
* | | | | | Merge "Update existing change on cherry-pick with CommitApi" into stable-3.3Edwin Kempin2022-04-016-57/+320
|\ \ \ \ \ \
| * | | | | | Update existing change on cherry-pick with CommitApiMarija Savtchouk2022-03-306-57/+320
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CommitAPI: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#cherry-pick-commit When the user tries to cherry pick a change onto an already existing change in a different branch with CommitAPI (Change-ID is provided in the commit message, and the change with this Change-ID exists in the destination branch), it results in NPE. Instead, this operation should just create a new patch set on the existing change. When using CommitAPI, the source commit is not associated with the change, but the existing destination change might have cherryPickOf already set. Reset cherryPickOf in NoteDb for this case. Bug: Issue 14109 Release-Notes: Fix NPE with cherry pick CommitAPI onto an existing change in a different branch Change-Id: I11beb7de9be4aa60a3c5e6a045b46156d9b310da (cherry picked from commit b9608bef91cd7418117f2fbaf0889601ed09e124)
* | | | | | | Merge changes I05e0522d,Id6c87778 into stable-3.3Sven Selberg2022-04-011-4/+2
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: dev-release: Correct link to public-keys.md Doc: Remove reference to "extra" keyserver keyserver.ubuntu.com
| * | | | | | dev-release: Correct link to public-keys.mdSven Selberg2022-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I05e0522d39eb60d788c826ec7a5a553612db6188 Release-Notes: skip
| * | | | | | Doc: Remove reference to "extra" keyserver keyserver.ubuntu.comSven Selberg2022-04-011-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The guide [1] is currently recommending keyserver.ubuntu.com after sks keyserver (https://sks-keyservers.net/) was retired. [1] http://central.sonatype.org/pages/working-with-pgp-signatures.html Change-Id: Id6c87778d9787062ed0300d29d41ffe02e2d0f48 Release-Notes: skip
* | | | | | | Merge branch 'stable-3.2' into stable-3.3Martin Fick2022-03-174-17/+26
|\ \ \ \ \ \ \ | | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.2: Revert "CmdLineParser: Remove unused prefix argument" Log the exception that caused the user's deactivation to fail Avoid re-reading refs in schema 161 Run background GC in Schema 144 and update GCs done in Schema 146 Trigger All-Users GC in background in schema 123 Improve comment describing ExternalId#SCHEME_GERRIT Change-Id: Id94e24a6f5c95b74b02f0cfba5a7d9a74af77de2 Release-Notes: skip
| * | | | | | Merge branch 'stable-3.1' into stable-3.2Martin Fick2022-03-173-15/+22
| |\ \ \ \ \ \ | | | |_|/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.1: Revert "CmdLineParser: Remove unused prefix argument" Log the exception that caused the user's deactivation to fail Avoid re-reading refs in schema 161 Run background GC in Schema 144 and update GCs done in Schema 146 Trigger All-Users GC in background in schema 123 Release-Notes: skip Change-Id: I616eb660df12ab0bdcaa22c1a290a023a95cc0a1
| | * | | | | Merge branch 'stable-3.0' into stable-3.1Martin Fick2022-03-173-15/+22
| | |\ \ \ \ \ | | | | |_|/ / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.0: Revert "CmdLineParser: Remove unused prefix argument" Log the exception that caused the user's deactivation to fail Avoid re-reading refs in schema 161 Run background GC in Schema 144 and update GCs done in Schema 146 Trigger All-Users GC in background in schema 123 Release-Notes: skip Change-Id: Iaa7eb5873436e6368035eda4d33a7207f0964219
| | | * | | | Merge branch 'stable-2.16' into stable-3.0Martin Fick2022-03-173-15/+21
| | | |\ \ \ \ | | | | | |_|/ | | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-2.16: Revert "CmdLineParser: Remove unused prefix argument" Log the exception that caused the user's deactivation to fail Avoid re-reading refs in schema 161 Run background GC in Schema 144 and update GCs done in Schema 146 Trigger All-Users GC in background in schema 123 Release-Notes: skip Change-Id: I45dd6f9a2466881a3d7d9ebb0a6db5deb4b2eebe
| | | | * | | Revert "CmdLineParser: Remove unused prefix argument"Martin Fick2022-03-171-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8c380ffca36399fec35a84f13677efc751650a9a. Reason for revert: While the prefix argument defaults to "", it is needed to make use of the Options(prefix=) annotation. Release-Notes: skip Change-Id: I8941a127be47911dec6f7b99b7115489570058e1
| | | | * | | Merge "Avoid re-reading refs in schema 161" into stable-2.16Nasser Grainawi2022-01-052-12/+17
| | | | |\ \ \
| | | | | * | | Avoid re-reading refs in schema 161Kaushik Lingarkar2021-12-202-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A ref lookup using its name can be slow, especially in an unrepacked NFS based repository. Instead, use a Ref object which is already available to read labels. Change-Id: I31bafad54b7f69059235cc466d4a3d732ba44d97
| | | | * | | | Log the exception that caused the user's deactivation to failLuca Milanesio2021-12-231-1/+1
| | | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When failing to deactivate an account because of a resource conflict, the additional details of the exception helps the Gerrit admin to understand where the problem is coming from. The ResourceConflictException is typically triggered by the account being already inactive; however, it is also thrown in other points of the code and having the exception with the stack-trace helps troubleshooting deactivation issues. Change-Id: Idcb75f6c5b8fc63f6afb1f48bfe2f51a0c25188a
| | | | * | | Run background GC in Schema 144 and update GCs done in Schema 146Kaushik Lingarkar2021-12-163-44/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial preparatory GC in schema 146 can be skipped for two reasons: 1) Several updates were done to keep All-Users in good state in preceding schemas by not writing loose objects. 2) Schema 144 now triggers a GC in the background. Schema 144 belongs to the same Gerrit release as 146, so users will never run an older version of 144(w/o the background GC) and a newer version of 146 (w/o the preparatory in-line GC). The inline GC in schema 146 which runs every 50 packs has been converted to a background GC. The intent of this inline GC was to keep All-Users from getting worse when there are a large number of user refs that need to be rewritten. Running a background GC also achieves that goal and has the added advantage of not holding up a data migration thread to run GC, thereby not slowing down the schema and allowing other schemas to proceed without waiting for the GC to complete. Change-Id: I16b048cf75671c40edc38e54d339735a93c1ebc9
| | | | * | | Trigger All-Users GC in background in schema 123Kaushik Lingarkar2021-12-163-36/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New refs created under starred-changes using an atomic BatchRefUpdate operation leaves behind empty dirs in 'refs/starred-changes'. This can cause performance issues for subsequent schemas accessing these starred refs. A GC will clean up such empty ref dirs. Doing the GC inline will be a performance hit as the cleanup can be time-taking on NFS. Instead, run the GC in background at the end of this schema, which allows others schemas to then proceed without waiting for the GC to complete. Note that, the request to run GC in background will be ignored if another GC for that project is already queued. This change allows us to either remove the GCs done in Schema 146 or at the least run them in background. Change-Id: I1c9cb7cccfd87db7ffce57512562372af2fadff6
| * | | | | | Merge "Improve comment describing ExternalId#SCHEME_GERRIT" into stable-3.2Matthias Sohn2022-01-281-2/+4
| |\ \ \ \ \ \
| | * | | | | | Improve comment describing ExternalId#SCHEME_GERRITThomas Draebing2021-09-031-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I4ba6ee692bf477c9b7117d68d55edab2f6888e2a
* | | | | | | | Set version to 3.3.11-SNAPSHOTLuca Milanesio2022-03-175-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Release-Notes: skip Change-Id: Iffa172335f1347e466349d54ef1ede871aaa7dfb