blob: 795af04c5983381cc017293b3c8bf40bfdbc1082 [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]
11'ssh' -p <port> <host> 'gerrit flush-caches' \
12[\--all | \--list | \--cache <NAME> ...]
13
14DESCRIPTION
15-----------
16Clear an in-memory cache, forcing Gerrit to reconsult the ground
17truth when it needs the information again.
18
19Flushing a cache may be necessary if an administrator modifies
20database records directly in the database, rather than going through
21the Gerrit web interface.
22
23If no options are supplied, defaults to `--all`.
24
25ACCESS
26------
27Caller must be a member of the privileged 'Administrators' group.
28
29SCRIPTING
30---------
31This command is intended to be used in scripts.
32
33OPTIONS
34-------
35\--all::
Shawn O. Pearce388dd8f2009-08-17 07:37:03 -070036 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. Pearce4016a932009-05-28 15:12:40 -070043
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
52EXAMPLES
53--------
54List caches available for flushing:
55
56====
57 $ ssh -p 29418 review.example.com gerrit flush-caches --list
58 accounts
Shawn O. Pearce388dd8f2009-08-17 07:37:03 -070059 accounts_byemail
Shawn O. Pearce4016a932009-05-28 15:12:40 -070060 diff
61 groups
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -070062 ldap_groups
Shawn O. Pearce4016a932009-05-28 15:12:40 -070063 openid
64 projects
65 sshkeys
Shawn O. Pearce388dd8f2009-08-17 07:37:03 -070066 web_sessions
Shawn O. Pearce4016a932009-05-28 15:12:40 -070067====
68
69Flush 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
75or
76
77====
78 $ ssh -p 29418 review.example.com gerrit flush-caches
79====
80
Shawn O. Pearce388dd8f2009-08-17 07:37:03 -070081Flush only the "sshkeys" cache, after manually editing an SSH key
82for a user:
Shawn O. Pearce4016a932009-05-28 15:12:40 -070083
84====
85 $ ssh -p 29418 review.example.com gerrit flush-caches --cache sshkeys
86====
87
Shawn O. Pearce388dd8f2009-08-17 07:37:03 -070088Flush "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. Pearce4016a932009-05-28 15:12:40 -070094SEE ALSO
95--------
96
97* link:cmd-show-caches.html[gerrit show-caches]
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -070098* link:config-gerrit.html#cache[Cache Configuration]
Shawn O. Pearce4016a932009-05-28 15:12:40 -070099* link:config-gerrit.html#cache_names[Standard Caches]
Shawn O. Pearce5500e692009-05-28 15:55:01 -0700100
101GERRIT
102------
103Part of link:index.html[Gerrit Code Review]