Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1 | = gerrit flush-caches |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 2 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3 | == NAME |
David Shevitz | 3a38966 | 2018-09-24 10:24:29 -0700 | [diff] [blame] | 4 | gerrit flush-caches - Flush some/all server caches from memory. |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 5 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6 | == SYNOPSIS |
Michael Ochmann | e2d76a1 | 2016-06-23 17:07:37 +0200 | [diff] [blame] | 7 | [verse] |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 8 | -- |
Michael Ochmann | e2d76a1 | 2016-06-23 17:07:37 +0200 | [diff] [blame] | 9 | _ssh_ -p <port> <host> _gerrit flush-caches_ --all |
| 10 | _ssh_ -p <port> <host> _gerrit flush-caches_ --list |
| 11 | _ssh_ -p <port> <host> _gerrit flush-caches_ --cache <NAME> ... |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 12 | -- |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 13 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 14 | == DESCRIPTION |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 15 | Clear an in-memory cache, forcing Gerrit to reconsult the ground |
| 16 | truth when it needs the information again. |
| 17 | |
| 18 | Flushing a cache may be necessary if an administrator modifies |
Dave Borowitz | ada289c | 2018-12-18 13:24:14 -0800 | [diff] [blame] | 19 | NoteDb metadata directly in a repository, rather than going through |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 20 | the Gerrit web interface. |
| 21 | |
| 22 | If no options are supplied, defaults to `--all`. |
| 23 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 24 | == ACCESS |
Dave Borowitz | 664d040 | 2015-06-11 15:35:48 -0400 | [diff] [blame] | 25 | |
| 26 | The caller must be a member of a group that is granted one of the |
| 27 | following capabilities: |
| 28 | |
| 29 | * link:access-control.html#capability_flushCaches[Flush Caches] (any cache |
| 30 | except "web_sessions") |
| 31 | * link:access-control.html#capability_maintainServer[Maintain Server] (any cache |
| 32 | including "web_sessions") |
| 33 | * link:access-control.html#capability_administrateServer[Administrate Server] |
| 34 | (any cache including "web_sessions") |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 35 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 36 | == SCRIPTING |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 37 | This command is intended to be used in scripts. |
| 38 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 39 | == OPTIONS |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 40 | --all:: |
Shawn O. Pearce | 388dd8f | 2009-08-17 07:37:03 -0700 | [diff] [blame] | 41 | Flush all known caches. This is like applying a big hammer, |
| 42 | it will force everything out, potentially more than was |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 43 | necessary for the change made. This option automatically |
Shawn O. Pearce | 388dd8f | 2009-08-17 07:37:03 -0700 | [diff] [blame] | 44 | skips flushing potentially dangerous caches such as |
| 45 | "web_sessions". To flush one of these caches, the caller |
| 46 | must specifically name them on the command line, e.g. pass |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 47 | `--cache web_sessions`. |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 48 | |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 49 | --list:: |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 50 | Show a list of the caches. |
| 51 | |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 52 | --cache <NAME>:: |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 53 | Flush only the cache called <NAME>. May be supplied more |
| 54 | than once to flush multiple caches in a single command |
| 55 | execution. |
| 56 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 57 | == EXAMPLES |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 58 | List caches available for flushing: |
| 59 | |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 60 | ---- |
David Shevitz | 3a38966 | 2018-09-24 10:24:29 -0700 | [diff] [blame] | 61 | $ ssh -p 29418 review.example.com gerrit flush-caches --list |
| 62 | accounts |
| 63 | diff |
| 64 | groups |
| 65 | ldap_groups |
| 66 | openid |
| 67 | projects |
| 68 | sshkeys |
| 69 | web_sessions |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 70 | ---- |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 71 | |
| 72 | Flush all caches known to the server, forcing them to recompute: |
| 73 | |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 74 | ---- |
David Shevitz | 3a38966 | 2018-09-24 10:24:29 -0700 | [diff] [blame] | 75 | $ ssh -p 29418 review.example.com gerrit flush-caches --all |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 76 | ---- |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 77 | |
| 78 | or |
| 79 | |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 80 | ---- |
David Shevitz | 3a38966 | 2018-09-24 10:24:29 -0700 | [diff] [blame] | 81 | $ ssh -p 29418 review.example.com gerrit flush-caches |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 82 | ---- |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 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 | |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 87 | ---- |
David Shevitz | 3a38966 | 2018-09-24 10:24:29 -0700 | [diff] [blame] | 88 | $ ssh -p 29418 review.example.com gerrit flush-caches --cache sshkeys |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 89 | ---- |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 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 | |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 93 | ---- |
David Shevitz | 3a38966 | 2018-09-24 10:24:29 -0700 | [diff] [blame] | 94 | $ ssh -p 29418 review.example.com gerrit flush-caches --cache web_sessions |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 95 | ---- |
Shawn O. Pearce | 388dd8f | 2009-08-17 07:37:03 -0700 | [diff] [blame] | 96 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 97 | == SEE ALSO |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 98 | |
| 99 | * link:cmd-show-caches.html[gerrit show-caches] |
Shawn O. Pearce | 8efb2a7 | 2009-08-18 19:45:33 -0700 | [diff] [blame] | 100 | * link:config-gerrit.html#cache[Cache Configuration] |
Shawn O. Pearce | 4016a93 | 2009-05-28 15:12:40 -0700 | [diff] [blame] | 101 | * link:config-gerrit.html#cache_names[Standard Caches] |
Shawn O. Pearce | 5500e69 | 2009-05-28 15:55:01 -0700 | [diff] [blame] | 102 | |
| 103 | GERRIT |
| 104 | ------ |
| 105 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 106 | |
| 107 | SEARCHBOX |
| 108 | --------- |