blob: 5a84b9d7d99c9507e71932debae49bbe96c7c124 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= gerrit flush-caches
Shawn O. Pearce4016a932009-05-28 15:12:40 -07002
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003== NAME
David Shevitz3a389662018-09-24 10:24:29 -07004gerrit flush-caches - Flush some/all server caches from memory.
Shawn O. Pearce4016a932009-05-28 15:12:40 -07005
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006== SYNOPSIS
Michael Ochmanne2d76a12016-06-23 17:07:37 +02007[verse]
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08008--
Michael Ochmanne2d76a12016-06-23 17:07:37 +02009_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' Wangd85b6872013-11-15 11:47:46 -080012--
Shawn O. Pearce4016a932009-05-28 15:12:40 -070013
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080014== DESCRIPTION
Shawn O. Pearce4016a932009-05-28 15:12:40 -070015Clear an in-memory cache, forcing Gerrit to reconsult the ground
16truth when it needs the information again.
17
18Flushing a cache may be necessary if an administrator modifies
Dave Borowitzada289c2018-12-18 13:24:14 -080019NoteDb metadata directly in a repository, rather than going through
Shawn O. Pearce4016a932009-05-28 15:12:40 -070020the Gerrit web interface.
21
22If no options are supplied, defaults to `--all`.
23
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080024== ACCESS
Dave Borowitz664d0402015-06-11 15:35:48 -040025
26The caller must be a member of a group that is granted one of the
27following 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. Pearce4016a932009-05-28 15:12:40 -070035
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080036== SCRIPTING
Shawn O. Pearce4016a932009-05-28 15:12:40 -070037This command is intended to be used in scripts.
38
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080039== OPTIONS
Shawn O. Pearce47769242011-06-14 16:40:48 -070040--all::
Shawn O. Pearce388dd8f2009-08-17 07:37:03 -070041 Flush all known caches. This is like applying a big hammer,
42 it will force everything out, potentially more than was
Shawn O. Pearce47769242011-06-14 16:40:48 -070043 necessary for the change made. This option automatically
Shawn O. Pearce388dd8f2009-08-17 07:37:03 -070044 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. Pearce47769242011-06-14 16:40:48 -070047 `--cache web_sessions`.
Shawn O. Pearce4016a932009-05-28 15:12:40 -070048
Shawn O. Pearce47769242011-06-14 16:40:48 -070049--list::
Shawn O. Pearce4016a932009-05-28 15:12:40 -070050 Show a list of the caches.
51
Shawn O. Pearce47769242011-06-14 16:40:48 -070052--cache <NAME>::
Shawn O. Pearce4016a932009-05-28 15:12:40 -070053 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' Wang61698b12013-12-20 12:55:51 -080057== EXAMPLES
Shawn O. Pearce4016a932009-05-28 15:12:40 -070058List caches available for flushing:
59
Michael Ochmannb99feab2016-07-06 14:10:22 +020060----
David Shevitz3a389662018-09-24 10:24:29 -070061$ ssh -p 29418 review.example.com gerrit flush-caches --list
62accounts
63diff
64groups
65ldap_groups
66openid
67projects
68sshkeys
69web_sessions
Michael Ochmannb99feab2016-07-06 14:10:22 +020070----
Shawn O. Pearce4016a932009-05-28 15:12:40 -070071
72Flush all caches known to the server, forcing them to recompute:
73
Michael Ochmannb99feab2016-07-06 14:10:22 +020074----
David Shevitz3a389662018-09-24 10:24:29 -070075$ ssh -p 29418 review.example.com gerrit flush-caches --all
Michael Ochmannb99feab2016-07-06 14:10:22 +020076----
Shawn O. Pearce4016a932009-05-28 15:12:40 -070077
78or
79
Michael Ochmannb99feab2016-07-06 14:10:22 +020080----
David Shevitz3a389662018-09-24 10:24:29 -070081$ ssh -p 29418 review.example.com gerrit flush-caches
Michael Ochmannb99feab2016-07-06 14:10:22 +020082----
Shawn O. Pearce4016a932009-05-28 15:12:40 -070083
Shawn O. Pearce388dd8f2009-08-17 07:37:03 -070084Flush only the "sshkeys" cache, after manually editing an SSH key
85for a user:
Shawn O. Pearce4016a932009-05-28 15:12:40 -070086
Michael Ochmannb99feab2016-07-06 14:10:22 +020087----
David Shevitz3a389662018-09-24 10:24:29 -070088$ ssh -p 29418 review.example.com gerrit flush-caches --cache sshkeys
Michael Ochmannb99feab2016-07-06 14:10:22 +020089----
Shawn O. Pearce4016a932009-05-28 15:12:40 -070090
Shawn O. Pearce388dd8f2009-08-17 07:37:03 -070091Flush "web_sessions", forcing all users to sign-in again:
92
Michael Ochmannb99feab2016-07-06 14:10:22 +020093----
David Shevitz3a389662018-09-24 10:24:29 -070094$ ssh -p 29418 review.example.com gerrit flush-caches --cache web_sessions
Michael Ochmannb99feab2016-07-06 14:10:22 +020095----
Shawn O. Pearce388dd8f2009-08-17 07:37:03 -070096
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080097== SEE ALSO
Shawn O. Pearce4016a932009-05-28 15:12:40 -070098
99* link:cmd-show-caches.html[gerrit show-caches]
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -0700100* link:config-gerrit.html#cache[Cache Configuration]
Shawn O. Pearce4016a932009-05-28 15:12:40 -0700101* link:config-gerrit.html#cache_names[Standard Caches]
Shawn O. Pearce5500e692009-05-28 15:55:01 -0700102
103GERRIT
104------
105Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -0700106
107SEARCHBOX
108---------