summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'stable-3.2' into stable-3.3upstream/stable-3.3Alvaro Vilaplana Garcia2023-12-063-43/+9
|\ | | | | | | | | | | | | | | | | | | * stable-3.2: Make the indexing operation fail upon StorageException(s) ConsistencyCheckerIT: Delete calls to index broken changes that fail silently RefAdvertisementIT: Don't call reindex that would fail silently Release-Notes: skip Change-Id: Iecdf1e4ce450c8fab5244338ce46e6e4d95bf959
| * Make the indexing operation fail upon StorageException(s)upstream/stable-3.2Luca Milanesio2023-12-021-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change 270450 caused the blanking of the Lucene document upon reindexing if any field caused a StorageException. Whilst the overall intention was good, the implementation caused the Lucene index replace operation to continue with a Document without any fields instead of making the whole operation fail. StorageExceptions are thrown when the underlying storage, being a filesystem or anything else, returns some errors. Whether the failure is permanent or temporary (e.g. concurrent GCs, repacking or pruning may cause sporadic StorageException(s)) returning a blank Lucene document was incorrect because, instead of failing the operation, it was causing the change entry to be completely removed from the index. Let the StorageException fail the indexing operation, so that existing entries may continue to exist, allowing the caller to retry the operation. The previous implementation, returning an empty Document, did not allow any retry, because once the change entry was removed from the index, it could not be discovered and reindexed anymore for example by a `gerrit index changes <changenum>`. Tested manually, applying a randomic StorageException thrown during the fetching of the ChangeField extensions: public static Set<String> getExtensions(ChangeData cd) { if (new Random().nextBoolean()) { throw new StorageException("Simulated storage exception"); } return extensions(cd).collect(toSet()); } Before this change, every time one change indexing throws a StorageException, it disappears from the index. Eventually, all changes will be eliminated and only an off-line reindex or the reindex of all changes in the project would allow to recover them. After this change, some of the indexing operations are successful and other fails. However, retrying the reindexing operation would allow to reindex all of them. Even if the above test case looks strange at first sight, it simulates a real-life scenario where a low percentage of indexing operation (0.1%) may fail because of sporadic StorageExceptions. Before this change, some index entries were missing on a daily basis (5 to 10 changes per day), whilst after this change all indexing operation can be retried and do not result in any indexing entry loss. Bug: Issue 314113030 Release-Notes: Fail the change reindex operation upon StorageException(s) Change-Id: Ia121f47f7a68c290849a22dea657804743a26b0d
| * ConsistencyCheckerIT: Delete calls to index broken changes that fail silentlyPatrick Hiesel2023-12-021-3/+0
| | | | | | | | | | | | | | | | | | | | | | These calls used to fail silently and are of no further use. This change is part of a series that allows for the fake change index to run in integration tests. The fake index throws an exception in case reindexing fails, which made this test fail. Release-Notes: skip Change-Id: I9c9d3f7613bca057bf0963442077bb6c0b3dab51
| * RefAdvertisementIT: Don't call reindex that would fail silentlyPatrick Hiesel2023-12-021-31/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | receivePackOmitsMissingObject wants to test a scenario where we have a change ref, but the patch set ref / commit was deleted or is otherwise gone. It did that by adding a new patch set pointing to a non-existent SHA1 and triggered a reindex of that change. However, that reindex fails silently because we submit the reindex task to another executor and provide no feedback to the caller. This commit modifies the test and just deletes the patch set ref which makes for the same scenario but without the reindex trouble. This change is part of a series that allows for the fake change index to run in integration tests. The fake index throws an exception in case reindexing fails, which made this test fail. Release-Notes: skip Change-Id: Icf79795a343a6abca28c6504b279eb0a5c84fad2
* | Merge branch 'stable-3.2' into stable-3.3Diego Zambelli Sessona2023-10-251-10/+10
|\| | | | | | | | | | | | | | | * stable-3.2: Update Jetty to 9.4.53.v20231009 for security updates Release-Notes: skip Change-Id: If1d4dfc04d9407f0bab937a996d9321358a7b6a8
| * Update Jetty to 9.4.53.v20231009 for security updatesLuca Milanesio2023-10-241-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jetty 9.4.53.v20231009 includes the following two security fixes: - CVE-2023-36478 [1] - zero-days security issue discovered on the 10th of October, also known as "HTTP/2 Rapid Reset" - CVE-2023-44487 [2] - HTTP/2 Stream Cancellation Attack [1] https://nvd.nist.gov/vuln/detail/CVE-2023-36478 [2] https://nvd.nist.gov/vuln/detail/CVE-2023-44487 Release-Notes: Update Jetty to 9.4.53.v20231009 with critical security fixes Change-Id: Ie93fbcb8b35d9e4997dc0578893a8856b56b173c (cherry picked from commit c49057e05d35ff2ad1a7307aa9168b84ae7588db)
* | Merge branch 'stable-3.2' into stable-3.3Luca Milanesio2023-01-156-8/+435
|\| | | | | | | | | | | | | | | | | * stable-3.2: Introduce cache.threads option to enable a custom cache executor GitwebServlet: Fix project root computation Release-Notes: skip Change-Id: I342a210680ff43796f9fa4403f1b70f78e0ddb3e
| * Introduce cache.threads option to enable a custom cache executorLuca Milanesio2023-01-154-2/+302
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the introduction of Caffeine as alternative to Guava in Change 244612, the execution of the cache event listeners moved to a background thread, run by the ForkJoinPool's common pool [1]. The subtle difference has caused issues to the plugins that are registering listeners, like the high-availability and multi-site: the consequences have been quite serious because of the inability to understand if the eviction was caused by a forwarded cache eviction event or by an execution of Gerrit API or other internals that caused the removal of the entry. The use of the JVM common pool has several disadvantages and, under certain conditions [2], it may even lead to deadlocks or unexpected blockages. By introducing the cache.threads option, decouple the cache background threads execution and allow to configure an explicit separate thread pool which can be tuned and decoupled from the rest of the JVM common threads. Also, allow to restore the plugins' cache listeners legacy behaviour without losing the ability to leverage the performance of Caffeine cache vs. the traditional Guava. By default, this change is a NO-OP because it preserves the current behaviour of background execution tasks of the Caffeine cache. Introduce DefaultMemoryCacheFactoryTest class from stable-3.4 for avoiding further conflicts when merging upstream. References: [1] https://github.com/ben-manes/caffeine/wiki/Guava#asynchronous-notifications [2] https://dzone.com/articles/be-aware-of-forkjoinpoolcommonpool Release-Notes: introduce cache.threads option to allow custom executors for Caffeine caches Bug: Issue 16565 Change-Id: I204abd1bdbf2bbed5b3d982d14cbc5549ac96ace
| * GitwebServlet: Fix project root computationDavid Ostrovsky2022-12-162-6/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If9da362140 introduced regression in project root computation. Also add test coverage for Gitweb servlet so that a similar regresssion could be avoided in the future. Test Plan: bazel test javatests/com/google/gerrit/httpd/... Bug: Issue 16449 Release-Notes: Fix project root computation in Gitweb servlet Change-Id: Ia1a7bdea55db4deb55a3b82a292890e7febbe675
* | Merge branch 'stable-3.2' into stable-3.3Kaushik Lingarkar2022-11-234-13/+16
|\| | | | | | | | | | | | | | | * stable-3.2: Disable printing cache stats by default on Init/Reindex Release-Notes: skip Change-Id: Ia8356e393bd8cd8601e4805a0a7106b7a047b593
| * Disable printing cache stats by default on Init/ReindexKaushik Lingarkar2022-11-214-13/+16
| | | | | | | | | | | | | | | | | | Printing cache statistics can be slow, particularly when the caches are large. For example, when the caches are ~400G, printing cache stats takes over 30 mins. Release-Notes: Printing cache stats is disabled by default for Init and Reindex Change-Id: I848d6dfef0be9dee9ebac8a597dd7e617cbe30e4
* | Merge branch 'stable-3.2' into stable-3.3Luca Milanesio2022-11-180-0/+0
|\| | | | | | | | | | | | | | | | | * stable-3.2: Predicate: Add safety check against not(any()) Add an index-safe predicate that matches all changes Release-Notes: skip Change-Id: Ie1006ba75c63ef445771acea26dcd371eb750156
| * Merge branch 'stable-3.1' into stable-3.2Luca Milanesio2022-11-180-0/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.1: Predicate: Add safety check against not(any()) Add an index-safe predicate that matches all changes Release-Notes: skip Change-Id: I56708f2d9a3218f2981e65b867003d0ea714407a
| | * Merge branch 'stable-3.0' into stable-3.1upstream/stable-3.1Luca Milanesio2022-11-180-0/+0
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.0: Predicate: Add safety check against not(any()) Add an index-safe predicate that matches all changes Release-Notes: skip Change-Id: Id37339b406675721a4bac3411c6e2874986954bb
| | | * Merge branch 'stable-2.16' into stable-3.0upstream/stable-3.0Luca Milanesio2022-11-180-0/+0
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-2.16: Predicate: Add safety check against not(any()) Add an index-safe predicate that matches all changes Release-Notes: skip Change-Id: Ia64e074194cd561bc55a6f0e7976633aaa9bb2ff
| | | | * Predicate: Add safety check against not(any())Dave Borowitz2022-11-182-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's tempting to use as a way to say "match no results", but it's very unsafe. This simple check won't catch all misuses, but it would have prevented Iad564dd47 from causing production problems. Fix one obvious caller that now trips this check. This was a real problem: a bare [is:watched] query on a large site for a user with no project watches required iterating all changes to return an empty result. We have real instances of this causing extremely long requests in our server logs. Release-Notes: skip Change-Id: Ib43f7466db5db315bf87558a37f18a1832ec641f (cherry picked from commit 02bab2161cd7ce7f682a28dad496a4465cb40844)
| | | | * Add an index-safe predicate that matches all changesDave Borowitz2022-11-184-11/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Iad564dd47 was problematic in the error case because it returned Predicate.not(Predicate.any()). The "any" predicate is not an index predicate, which produces at least two problems: * When used in a with another non-index predicate, it might throw "no ChangeDataSource" from AndSource/OrSource. * More dangerously, when combined with an index predicate, it is used as a post-filtering predicate. A post-filtering predicate that matches no results means it gets applied to every change in the index before returning an empty set, which is bad. Instead, reuse a handy existing index predicate that is designed to return no results efficiently from the index: ChangeStatusPredicate.NONE. Expose this from a more general location, ChangeIndexPredicate#none(). Release-Notes: skip Change-Id: Ic9a7e277070cff7768ec91c1972cf8e9f6deacb1 (cherry picked from commit d9679cdb605b8a10977e1fc821f57dd5749b1dd5)
* | | | | Merge branch 'stable-3.2' into stable-3.3Luca Milanesio2022-10-281-6/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.2: Cache repository locations in LocalDiskRepositoryManager Release-Notes: skip Change-Id: I4052ceea68399279f23a0e180227b71643e9a579
| * | | | Merge branch 'stable-3.1' into stable-3.2Luca Milanesio2022-10-281-6/+15
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.1: Cache repository locations in LocalDiskRepositoryManager Release-Notes: skip Change-Id: I5443e5174552f2a8369f5d97162b9cb24cd2ae26
| | * | | Merge branch 'stable-3.0' into stable-3.1Luca Milanesio2022-10-281-6/+15
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.0: Cache repository locations in LocalDiskRepositoryManager Release-Notes: skip Change-Id: I5b6cd9e19c4a0b052da9705e0a8ddb0eced148c2
| | | * | Merge branch 'stable-2.16' into stable-3.0Luca Milanesio2022-10-281-6/+15
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-2.16: Cache repository locations in LocalDiskRepositoryManager Release-Notes: skip Change-Id: I39713079d081e7b80f59dc36e6181f4daa565c50
| | | | * Cache repository locations in LocalDiskRepositoryManagerKaushik Lingarkar2022-10-281-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Obtaining the actual location of a repository using base-path and project name can be slow as it involves some guessing to locate the repository. Cache the locations once they are obtained to avoid repeated work, thereby improving performance when opening repositories. For example, on a site with 20k repositories on NFS, ls-projects with this change takes ~60s and ~90s without. Also, a query which wraps a large (~2k) list of manifest[1] operators will take ~300ms with this change and ~2s without it. [1] https://gerrit.googlesource.com/plugins/manifest Release-Notes: skip Change-Id: I8eab3c813c4ac9433e93c7ace96d38efe332be27
* | | | | Merge branch 'stable-3.2' into stable-3.3Luca Milanesio2022-10-215-16/+92
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.2: Limit the number of changes that can be submitted together GitwebServlet: Retrieve git path from FileRepository Make delegate() method public Release-Notes: skip Change-Id: I56968d4a2cf9800e78e673042a1cc250879b3fd8
| * | | | Merge branch 'stable-3.1' into stable-3.2Luca Milanesio2022-10-213-6/+58
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.1: Limit the number of changes that can be submitted together Release-Notes: skip Change-Id: Iab4d9bbbb44cb4e5e3db084f4350e1079f0e7195
| | * | | Merge branch 'stable-3.0' into stable-3.1Luca Milanesio2022-10-213-6/+58
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.0: Limit the number of changes that can be submitted together Release-Notes: skip Change-Id: I63765e81c80fa3bfb661c11ada5b7013f93f93e1
| | | * | Merge branch 'stable-2.16' into stable-3.0Luca Milanesio2022-10-213-6/+58
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-2.16: Limit the number of changes that can be submitted together Release-Notes: skip Change-Id: I263d636ec38f043ad5f6f8157ea5a57e12e7b145
| | | | * Limit the number of changes that can be submitted togetherLuca Milanesio2022-10-183-6/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When chaining changes together, the sequence of commits to navigate was previously unbound, causing the potential explosion to millions of changes. The explosion could have also been accidental and caused by the push of a change with a non-existent branch, which would have resulted in the full scan of the repository for changes. Introduce a new Gerrit configuration change.maxSubmittableAtOnce with a safe default of 32767, which would allow any use case that would have also worked before this change. Navigating over 32767 changes up to potentially a huge number of commits would have generated a significant CPU and memory overload and still not resulted in a submittable chain of changes anyway. Release-Notes: Limit the number of changes that can be submitted at once Bug: Issue 16322 Change-Id: Id71aed2341f72708778395359bb6e4d4c270401c
| * | | | GitwebServlet: Retrieve git path from FileRepositoryLuca Milanesio2022-08-141-9/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of retrieving git base path from repository manager, open the repository and get it directly from its git directory path. Also, redirect the delegate repository wrapper to the underlying implementation, allowing to use GitWeb in combination with the multi-site plugin and the cached-refdb. The advantage of doing it: we don't need to cast GitRepositoryManager to the LocalDiskRepositoryManager, so that other implementations would also work. Release-Notes: allow using GitWeb with multi-site and cached-refdb Change-Id: If9da36214063d73953677473082cd16f8f95163a
| * | | | Make delegate() method publicFabio Ponciroli2022-08-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The delegate() method was initially introduced in I8a862ac852 to allow access to the underlying repository while running GC for sites using multi-site plugin. The method was initially package private since the callers where in the same package. Changing visibility of delegate() method to public to allow plugins to access it. Accessing the wrapped repository would otherwise require hacky workarounds like this Ia3fbdc7e96. Bug: Issue 15997 Release-Notes: Make DelegateRepository#delegate() method public Change-Id: I4c8b4f97f9995a7adeca5b6f763e7913c9e8a5e5
* | | | | Merge "Update jgit to c6b0ee04e49c96e0beec4154196c416abcf2bcc9" into stable-3.3Luca Milanesio2022-10-211-0/+0
|\ \ \ \ \
| * | | | | Update jgit to c6b0ee04e49c96e0beec4154196c416abcf2bcc9Matthias Sohn2022-10-211-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this update to current stable-5.9 contains the following changes: fed0ab9ba Use FileSnapshot without using configs for FileBasedConfig 7828ef349 Revert "RefDirectory.scanRef: Re-use file existence check done in snapshot creation" 994434a1c Add missing @since tags 2e5110eda Add missing @since tag 8924b14d3 Add missing @since tags f8f4357d6 Remove unused import in ApacheSshTest f1547eec0 Update maven plugins fe3071f0e Ignore missing javadoc in test bundles 38db89142 storage: file: De-duplicate File.exists()+File.isFile() f829f5f83 RefDirectory.scanRef: Re-use file existence check done in snapshot creation 5606a5315 FileSnapshot: Lazy load file store attributes cache 09c923073 Update eclipse-jarsigner-plugin to 1.3.2 c213a6628 Fix p2 repository URLs 122237439 FS: debug logging only if system config file cannot be found 6aa29d116 Better git system config finding 4f8d43462 Fix target platforms d160e8a93 Fix missing peel-part in lsRefsV2 for loose annotated tags 5f8c48413 reftable: drop code for truncated reads b4782d74f reftable: pass on invalid object ID in conversion 9c3190ce7 Update eclipse-jarsigner-plugin to 1.3.2 283c23012 Fix running benchmarks from bazel c70c0acb4 Update eclipse-jarsigner-plugin to 1.3.2 d160e8a93 should fix Issue 14861 Bug: Issue 14861 Release-Notes: Update jgit to c6b0ee04e49c96e0beec4154196c416abcf2bcc9 Change-Id: Ia221acf855dfc95816def73d77af212888d700a9
* | | | | | Merge branch 'stable-3.2' into stable-3.3David Ostrovsky2022-07-180-0/+0
|\ \ \ \ \ \ | | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.2: Detect DelegateRepository in GarbageCollection operation Allow reuse of DelegateRepository functionality Release-Notes: skip Change-Id: I1da2532d1d45b7bf3af0dddea821168eb897cd04
| * | | | | Detect DelegateRepository in GarbageCollection operationJacek Centkowski2022-07-183-1/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When GarbageCollectCommand performs GC it expects that instance of the repository that is passed to it is either FileRepository or DfsRepository and throws UnsupportedOperationException otherwise. Detect if DelegateRepository is passed as parameter and make sure that check is performed on a delegated repository instead. Bug: Issue 14945 Release-Notes: skip Change-Id: I8a862ac852f5f98c09662a41234d40c26e944804 (cherry picked from commit a02af610c8ec879c79259a5d4b7a185a22311cd1)
| * | | | | Allow reuse of DelegateRepository functionalityMarcin Czech2022-07-182-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By allowing plugins to reuse DelegateRepository functionality multi-site and high-availability plugins can avoid code duplication and significantly reduce the code complexity. Also, make the annotation @UsedAt repeatable for associating the DelegateRepository functionality with the usage from multiple plugins. Bug: Issue 13429 Release-Notes: skip Change-Id: I2b5f5b215395fc1ef2a8008a71f5c09278d1278b (cherry picked from commit ed54a267dafeed829722b340ccaee2bbbc7f94b3)
* | | | | | Merge branch 'stable-3.2' into stable-3.3David Ostrovsky2022-06-282-10/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.2: Allow async receive-commits to have a thread-local cache Fix RepoRefCache stale checks during NoteDb rebuild Lazy load change notes when submit by push Change-Id: Idd341667dcc1d6ba9ffe7423776d55b3de659eb5 Release-Notes: skip
| * | | | | Merge branch 'stable-3.1' into stable-3.2David Ostrovsky2022-06-282-10/+15
| |\ \ \ \ \ | | | |/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.1: Allow async receive-commits to have a thread-local cache Fix RepoRefCache stale checks during NoteDb rebuild Lazy load change notes when submit by push Change-Id: Idb781e53343f98c898ecd4cd1033160b4ce4dfae Release-Notes: skip
| | * | | | Merge branch 'stable-3.0' into stable-3.1David Ostrovsky2022-06-283-12/+19
| | |\ \ \ \ | | | | |/ / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.0: Allow async receive-commits to have a thread-local cache Fix RepoRefCache stale checks during NoteDb rebuild Lazy load change notes when submit by push Change-Id: Ie82487167fc84ec543083b018c3fde1b0a041e1d Release-Notes: skip
| | | * | | Merge branch 'stable-2.16' into stable-3.0David Ostrovsky2022-06-283-12/+18
| | | |\ \ \ | | | | | |/ | | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-2.16: Allow async receive-commits to have a thread-local cache Fix RepoRefCache stale checks during NoteDb rebuild Lazy load change notes when submit by push Change-Id: I52fd7c9320ce57488ab54f8b5b24a8eabb002ea5 Forward-Compatible: checked Release-Notes: skip
| | | | * | Allow async receive-commits to have a thread-local cacheLuca Milanesio2022-06-021-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git receive-commits are executed in a background thread of the ReceiveCommits pool. The thread-local cache allocated on the client caller thread isn't used in the execution of the command making multiple operations (e.g. ACL evaluation, events propagation) slower because of the missed caching activity. Release-Notes: Improve caching when merging changes through git push Change-Id: I34a6e1485294f3156c7f35261fedfc280af1ed43
| | | | * | Fix RepoRefCache stale checks during NoteDb rebuildLuca Milanesio2022-05-312-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When rebuilding NoteDb meta-data from ReviewDb we are actually mutating the /meta ref during a reindexing operation. This is an edge case that happens only once during the on-line NoteDb upgrade and the trial mode. Adapt the RepoRefCache use during NoteDb reindexing and manage the situation where a staleness check applies to a ref that has disappeared on disk. Bug: Issue 15961 Release-Notes: skip Change-Id: Iac642eb7a9b24882a0c77dbaee24853fb0b29827
| | | | * | Lazy load change notes when submit by pushLuca Milanesio2022-05-301-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lazy load the change notes associated with the change to merge when one or more changes are submitted by a git push of the change onto its target branch. When a single change is merged through git push, we need to find which one is the corresponding change meta to be checked and merged. However, the building of the entire set of open changes against the target branch, indexed by their change key was having the side-effect of loading eagerly changes notes from their /meta ref. Loading all changes notes can be very slow, O(mins), on repositories with a large number of refs on slow storage and, also, it is completely unneeded in this use case. Loading all the change notes for all open changes had increased the time to submit a change from a few seconds (via the GUI) to a few minutes (via git push). Release-Notes: Performance improvement of change submit via push Change-Id: I646bc7b13f3359816b6be6354e15ddb5412bfa38
* | | | | | Avoid creating an IdentifiedUser multiple times in a SSH queryKaushik Lingarkar2022-06-061-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In SSH scope, we are creating an IdentifiedUser each time we try to get the user. In I141e9bf2, it seems that the intention was to create the identified user only the first time it was asked for. Creating a new IdentifiedUser each time adds an overhead that degrades query performance. We do want the IdentifiedUser created via the RequestFactory so that request scoped fields are populated correctly which is why we don't directly return CurrentUser#asIdentifiedUser(). Release-Notes: SSH query performance is improved Change-Id: Ibca6c2320ed3abd7bfa6bf29daaacb5048d6a798
* | | | | | Cache ProjectControl instances in SSH queriesKaushik Lingarkar2022-06-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a PerThreadCache in SSH queries to cache ProjectControl instances inside DefaultPermissionBackend#ForProject so that its performance is comparable to REST where the aforementioned cache is already used. This cache helps improve performance of the change visibility check, which is done as a post-filter on the results obtained from an index query. Release-Notes: SSH query performance is improved Change-Id: Ia0b5d8c10db4f6631c59af5d2e6631d7ca4d1ea0
* | | | | | Fix SSH queries to not show commit-message unless --commit-message is providedKaushik Lingarkar2022-06-021-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Obtaining the commit message is a costly operation as the commit data has to be loaded. So, showing it even when --commit-message is not provided degrades the performance of SSH queries. Bug: Issue 15941 Release-Notes: SSH queries are fixed to show commit-message only when --commit-message is provided Change-Id: I45cb478364535f1b9670cf60e3892898c2a46089
* | | | | | Merge "Use sane value for QueryProcessor's effective limit on "--no-limit"" ↵Adithya Chakilam2022-05-268-9/+135
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | into stable-3.3
| * | | | | | Use sane value for QueryProcessor's effective limit on "--no-limit"Adithya Chakilam2022-05-258-9/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we set Integer.MAX_VAL as the effective limit for an index query processor when "--no-limit" option is specified. This throws following exceptions on ElasticSearch index backend: Result window is too large, from + size must be less than or equal to: [2147483647] but was [2147501664] Modify it make use of current index size + some extra buffer so that ES server-side memory use is appropriately sized. Also add the API in RepoSequence to return the last returned id. Change-Id: I521b55a7c14c3780d1a91eb102cd56b1122e2061 Release-Notes: Fixed ES 'Result window is too large' error with --no-limit query option
* | | | | | | Avoid loading change notes to obtain hashtags in ssh queriesKaushik Lingarkar2022-05-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hash tags are already available in ChangeData, use it, instead of unnecessarily loading change notes to obtain them. Bug: Issue 15942 Release-Notes: skip Change-Id: Iad00c43adfe303c8e10777ce4744cb0709d9be30
* | | | | | | Set version to 3.3.12-SNAPSHOTLuca Milanesio2022-05-215-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Release-Notes: skip Change-Id: Id5f1ac35ed4f3f50b556bc3b3ec3712e2930ff94
* | | | | | | 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