Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 1 | gerrit flush-caches |
| 2 | =================== |
| 3 | |
| 4 | NAME |
| 5 | ---- |
| 6 | gerrit flush-caches - Flush some/all server caches from memory |
| 7 | |
| 8 | SYNOPSIS |
| 9 | -------- |
| 10 | [verse] |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 11 | 'ssh' -p <port> <host> 'gerrit flush-caches' --all |
| 12 | 'ssh' -p <port> <host> 'gerrit flush-caches' --list |
| 13 | 'ssh' -p <port> <host> 'gerrit flush-caches' --cache <NAME> ... |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 14 | |
| 15 | DESCRIPTION |
| 16 | ----------- |
| 17 | Clear an in-memory cache, forcing Gerrit to reconsult the ground |
| 18 | truth when it needs the information again. |
| 19 | |
| 20 | Flushing a cache may be necessary if an administrator modifies |
| 21 | database records directly in the database, rather than going through |
| 22 | the Gerrit web interface. |
| 23 | |
| 24 | If no options are supplied, defaults to `--all`. |
| 25 | |
| 26 | ACCESS |
| 27 | ------ |
Shawn O. Pearce | 7f48514 | 2011-06-16 13:49:42 -0700 | [diff] [blame] | 28 | Caller must be a member of the privileged 'Administrators' group, |
Fredrik Luthander | 74ad0d0 | 2012-03-13 13:06:30 +0100 | [diff] [blame] | 29 | or in a group that have been granted |
| 30 | link:access-control.html#capability_flushCaches[the 'Flush Caches' global capability]. |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 31 | |
| 32 | SCRIPTING |
| 33 | --------- |
| 34 | This command is intended to be used in scripts. |
| 35 | |
| 36 | OPTIONS |
| 37 | ------- |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 38 | --all:: |
Shawn O. Pearce | 388dd8f | 2009-08-17 07:37:03 -0700 | [diff] [blame] | 39 | Flush all known caches. This is like applying a big hammer, |
| 40 | it will force everything out, potentially more than was |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 41 | necessary for the change made. This option automatically |
Shawn O. Pearce | 388dd8f | 2009-08-17 07:37:03 -0700 | [diff] [blame] | 42 | skips flushing potentially dangerous caches such as |
| 43 | "web_sessions". To flush one of these caches, the caller |
| 44 | must specifically name them on the command line, e.g. pass |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 45 | `--cache web_sessions`. |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 46 | |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 47 | --list:: |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 48 | Show a list of the caches. |
| 49 | |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 50 | --cache <NAME>:: |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 51 | Flush only the cache called <NAME>. May be supplied more |
| 52 | than once to flush multiple caches in a single command |
| 53 | execution. |
| 54 | |
| 55 | EXAMPLES |
| 56 | -------- |
| 57 | List caches available for flushing: |
| 58 | |
| 59 | ==== |
| 60 | $ ssh -p 29418 review.example.com gerrit flush-caches --list |
| 61 | accounts |
Shawn O. Pearce | 388dd8f | 2009-08-17 07:37:03 -0700 | [diff] [blame] | 62 | accounts_byemail |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 63 | diff |
| 64 | groups |
Shawn O. Pearce | 302a7dd | 2009-08-18 19:33:15 -0700 | [diff] [blame] | 65 | ldap_groups |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 66 | openid |
| 67 | projects |
| 68 | sshkeys |
Shawn O. Pearce | 388dd8f | 2009-08-17 07:37:03 -0700 | [diff] [blame] | 69 | web_sessions |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 70 | ==== |
| 71 | |
| 72 | Flush all caches known to the server, forcing them to recompute: |
| 73 | |
| 74 | ==== |
| 75 | $ ssh -p 29418 review.example.com gerrit flush-caches --all |
| 76 | ==== |
| 77 | |
| 78 | or |
| 79 | |
| 80 | ==== |
| 81 | $ ssh -p 29418 review.example.com gerrit flush-caches |
| 82 | ==== |
| 83 | |
Shawn O. Pearce | 388dd8f | 2009-08-17 07:37:03 -0700 | [diff] [blame] | 84 | Flush only the "sshkeys" cache, after manually editing an SSH key |
| 85 | for a user: |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 86 | |
| 87 | ==== |
| 88 | $ ssh -p 29418 review.example.com gerrit flush-caches --cache sshkeys |
| 89 | ==== |
| 90 | |
Shawn O. Pearce | 388dd8f | 2009-08-17 07:37:03 -0700 | [diff] [blame] | 91 | Flush "web_sessions", forcing all users to sign-in again: |
| 92 | |
| 93 | ==== |
| 94 | $ ssh -p 29418 review.example.com gerrit flush-caches --cache web_sessions |
| 95 | ==== |
| 96 | |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 97 | SEE ALSO |
| 98 | -------- |
| 99 | |
| 100 | * link:cmd-show-caches.html[gerrit show-caches] |
Shawn O. Pearce | 8efb2a7 | 2009-08-18 19:45:33 -0700 | [diff] [blame] | 101 | * link:config-gerrit.html#cache[Cache Configuration] |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 102 | * link:config-gerrit.html#cache_names[Standard Caches] |
Shawn O. Pearce | 5500e69 | 2009-05-28 15:55:01 -0700 | [diff] [blame] | 103 | |
| 104 | GERRIT |
| 105 | ------ |
| 106 | Part of link:index.html[Gerrit Code Review] |