blob: bc6fac54ef9760c4f0a6c8b3ffdbf9a5f74e0e81 [file] [log] [blame]
Shawn O. Pearce4016a932009-05-28 15:12:40 -07001gerrit flush-caches
2===================
3
4NAME
5----
6gerrit flush-caches - Flush some/all server caches from memory
7
8SYNOPSIS
9--------
10[verse]
Shawn O. Pearce47769242011-06-14 16:40:48 -070011'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. Pearce4016a932009-05-28 15:12:40 -070014
15DESCRIPTION
16-----------
17Clear an in-memory cache, forcing Gerrit to reconsult the ground
18truth when it needs the information again.
19
20Flushing a cache may be necessary if an administrator modifies
21database records directly in the database, rather than going through
22the Gerrit web interface.
23
24If no options are supplied, defaults to `--all`.
25
26ACCESS
27------
Shawn O. Pearce7f485142011-06-16 13:49:42 -070028Caller must be a member of the privileged 'Administrators' group,
Fredrik Luthander74ad0d02012-03-13 13:06:30 +010029or in a group that have been granted
30link:access-control.html#capability_flushCaches[the 'Flush Caches' global capability].
Shawn O. Pearce4016a932009-05-28 15:12:40 -070031
32SCRIPTING
33---------
34This command is intended to be used in scripts.
35
36OPTIONS
37-------
Shawn O. Pearce47769242011-06-14 16:40:48 -070038--all::
Shawn O. Pearce388dd8f2009-08-17 07:37:03 -070039 Flush all known caches. This is like applying a big hammer,
40 it will force everything out, potentially more than was
Shawn O. Pearce47769242011-06-14 16:40:48 -070041 necessary for the change made. This option automatically
Shawn O. Pearce388dd8f2009-08-17 07:37:03 -070042 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. Pearce47769242011-06-14 16:40:48 -070045 `--cache web_sessions`.
Shawn O. Pearce4016a932009-05-28 15:12:40 -070046
Shawn O. Pearce47769242011-06-14 16:40:48 -070047--list::
Shawn O. Pearce4016a932009-05-28 15:12:40 -070048 Show a list of the caches.
49
Shawn O. Pearce47769242011-06-14 16:40:48 -070050--cache <NAME>::
Shawn O. Pearce4016a932009-05-28 15:12:40 -070051 Flush only the cache called <NAME>. May be supplied more
52 than once to flush multiple caches in a single command
53 execution.
54
55EXAMPLES
56--------
57List caches available for flushing:
58
59====
60 $ ssh -p 29418 review.example.com gerrit flush-caches --list
61 accounts
Shawn O. Pearce388dd8f2009-08-17 07:37:03 -070062 accounts_byemail
Shawn O. Pearce4016a932009-05-28 15:12:40 -070063 diff
64 groups
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -070065 ldap_groups
Shawn O. Pearce4016a932009-05-28 15:12:40 -070066 openid
67 projects
68 sshkeys
Shawn O. Pearce388dd8f2009-08-17 07:37:03 -070069 web_sessions
Shawn O. Pearce4016a932009-05-28 15:12:40 -070070====
71
72Flush 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
78or
79
80====
81 $ ssh -p 29418 review.example.com gerrit flush-caches
82====
83
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
87====
88 $ ssh -p 29418 review.example.com gerrit flush-caches --cache sshkeys
89====
90
Shawn O. Pearce388dd8f2009-08-17 07:37:03 -070091Flush "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. Pearce4016a932009-05-28 15:12:40 -070097SEE ALSO
98--------
99
100* link:cmd-show-caches.html[gerrit show-caches]
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -0700101* link:config-gerrit.html#cache[Cache Configuration]
Shawn O. Pearce4016a932009-05-28 15:12:40 -0700102* link:config-gerrit.html#cache_names[Standard Caches]
Shawn O. Pearce5500e692009-05-28 15:55:01 -0700103
104GERRIT
105------
106Part of link:index.html[Gerrit Code Review]