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