Trac Ticket Queries
Table of Contents
In addition to reports, Trac provides support for custom ticket queries, used to display lists of tickets meeting a specified set of criteria.
To configure and execute a custom query, switch to the View Tickets module from the navigation bar, and select the Custom Query link.
Filters
When you first go to the query page the default filters will display all open tickets, or if you're logged in it will display open tickets assigned to you. Current filters can be removed by clicking the button to the right with the minus sign on the label. New filters are added from the pulldown list in the bottom-right corner of the filters box. Filters with either a text box or a pulldown menu of options can be added multiple times to perform an or of the criteria.
You can use the fields just below the filters box to group the results based on a field, or display the full description for each ticket.
Once you've edited your filters click the Update button to refresh your results.
Navigating Tickets
Clicking on one of the query results will take you to that ticket. You can navigate through the results by clicking the Next Ticket or Previous Ticket links just below the main menu bar, or click the Back to Query link to return to the query page.
You can safely edit any of the tickets and continue to navigate through the results using the Next/Previous/Back? to Query links after saving your results. When you return to the query any tickets which were edited will be displayed with italicized text. If one of the tickets was edited such that it no longer matches the query criteria the text will also be greyed. Lastly, if a new ticket matching the query criteria has been created, it will be shown in bold.
The query results can be refreshed and cleared of these status indicators by clicking the Update button again.
Saving Queries
While Trac does not yet allow saving a named query and somehow making it available in a navigable list, you can save references to queries in Wiki content, as described below.
Using TracLinks
You may want to save some queries so that you can come back to them later. You can do this by making a link to the query from any Wiki page.
[query:status=new|assigned|reopened&version=1.0 Active tickets against 1.0]
Which is displayed as:
This uses a very simple query language to specify the criteria (see Query Language).
Alternatively, you can copy the query string of a query and paste that into the Wiki link, including the leading ? character:
[query:?status=new&status=assigned&status=reopened&group=owner Assigned tickets by owner]
Which is displayed as:
Using the [[TicketQuery]] Macro
The TicketQuery macro lets you display lists of tickets matching certain criteria anywhere you can use WikiFormatting.
Example:
[[TicketQuery(version=0.6|0.7&resolution=duplicate)]]
This is displayed as:
No results
Just like the query: wiki links, the parameter of this macro expects a query string formatted according to the rules of the simple ticket query language.
A more compact representation without the ticket summaries is also available:
[[TicketQuery(version=0.6|0.7&resolution=duplicate, compact)]]
This is displayed as:
No results
Finally if you wish to receive only the number of defects that match the query using the count parameter.
[[TicketQuery(version=0.6|0.7&resolution=duplicate, count)]]
This is displayed as:
0
Customizing the table format
You can also customize the columns displayed in the table format (format=table) by using col=<field> - you can specify multiple fields and what order they are displayed by placing pipes (|) between the columns like below:
[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter)]]
This is displayed as:
Results (1 - 3 of 18)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #41 | fixed | pvfs2-server segfaults when num_dfiles larger than number of servers | ligon | mtmoore |
| #38 | fixed | Memory Leak in 2.8.4 server on rhel5.5 | mtmoore | Bart Taylor |
| #34 | fixed | Data corruption when FTP server writing data to client | mtmoore | mtmoore |
Full rows
In table format you can also have full rows by using rows=<field> like below:
[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter,rows=description)]]
This is displayed as:
Results (1 - 3 of 18)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #41 | fixed | pvfs2-server segfaults when num_dfiles larger than number of servers | ligon | mtmoore |
| description |
In a single server setup if the number of datafiles is set on a directory using the extended attribute user.pvfs2.num_dfiles to 2, the server segfaults when the copying a file into the file system (via pvfs2-cp). [E 08/16/2011 23:01:55] PVFS2 server: signal 6 [E 08/16/2011 23:01:55] [bt] /lib64/libc.so.6(gsignal+0x35) [0x3c2e830265] [E 08/16/2011 23:01:55] [bt] /lib64/libc.so.6(gsignal+0x35) [0x3c2e830265] [E 08/16/2011 23:01:55] [bt] /lib64/libc.so.6(abort+0x110) [0x3c2e831d10] [E 08/16/2011 23:01:55] [bt] /lib64/libc.so.6(assert_fail+0xf6) [0x3c2e8296e6] [E 08/16/2011 23:01:55] [bt] install/cvs-orange-head/sbin/pvfs2-server [0x424bac] [E 08/16/2011 23:01:55] [bt] /home/mtmoore/pvfs/install/cvs-orange-head/sbin/pvfs2-server(job_bmi_unexp_cancel+0x21) [0x420ef1] [E 08/16/2011 23:01:55] [bt] install/cvs-orange-head/sbin/pvfs2-server [0x414416] [E 08/16/2011 23:01:55] [bt] /lib64/libpthread.so.0 [0x3c2f40eb10] [E 08/16/2011 23:01:55] [bt] /lib64/libc.so.6(write+0x4b) [0x3c2e8c680b] [E 08/16/2011 23:01:55] [bt] /lib64/libc.so.6(_IO_file_write+0x43) [0x3c2e86bc03] [E 08/16/2011 23:01:55] [bt] /lib64/libc.so.6(_IO_do_write+0x76) [0x3c2e86bb16] [E 08/16/2011 23:01:55] [bt] /lib64/libc.so.6(_IO_file_sync+0xa7) [0x3c2e86c147] [E 08/16/2011 23:01:55] [bt] /lib64/libc.so.6(fflush+0x20) [0x3c2e8612f0] [E 08/16/2011 23:01:55] [bt] install/cvs-orange-head/sbin/pvfs2-server [0x44f675] [E 08/16/2011 23:01:55] [bt] install/cvs-orange-head/sbin/pvfs2-server(gossip_debug+0x85) [0x44fbf5] (gdb) l *(0x44f675) 0x44f675 is in tree_get_file_size_comp_fn (../../src/cvs-orange-head/pvfs2/./src/server/tree-communicate.sm:546). |
|||
| #38 | fixed | Memory Leak in 2.8.4 server on rhel5.5 | mtmoore | Bart Taylor |
| description |
After some recent testing, it looks like there is a server-side memory leak in the latest OrangeFS release. We have seen servers whose memory climbs without bound while the server daemon is running. I have a test case that is fairly simple. There is one RHEL5.5 64bit server and a single matching client both built from the 2.8.4 release tarball; the server config is attached. Create a simple file - mine is described below - and run the attached bash script (create-delete-loop.bash) against it. Memory is continuously leaked as seen by the chart I also attached. I tested this with the server's TroveMethod? set to directio and alt-aio, and it appears to leak memory at the same rate. The file my test is using was created by this command: for i in seq 1 65536; do echo -n "b" >> b.txt ; done Bart. |
|||
| #34 | fixed | Data corruption when FTP server writing data to client | mtmoore | mtmoore |
| description |
When FTPing a file to an FTP server that exposed an OrangeFS file system, I can consistently get data corruption when the ProFTPD server has a specific configuration. If I set the send and recv socket buffer size settings for ProFTPD (as configured in the attached config file), it will often corrupt the data. As far as I could determine, all these settings do is modify the socket options for the FTP sockets using SO_SNDBUF and SO_RCVBUF options set with setsockopt. Here is my environment configuration: FTP server: ProFTPD (I just built and installed the latest version available at proftpd.org). I've attached the configuration file. FTP client: The standard "ftp" command line utility present in RedHat? Linux FS Cluster: 4 Node OrangeFS Cluster using the attached config file. All nodes involved were running 64bit RHEL5.5 Here is the command line used for the pvfs2-client: /usr/sbin/pvfs2-client --logtype syslog -p /usr/sbin/pvfs2-client-core --logstamp datetime --acache-timeout=30000 --ncache-timeout=30000 --desc-size 8388608 --desc-count 5 The FTP client and server were on the same machine, so I simply FTP'd to localhost. We initially saw the corruption when copying a 110G file, but a 118G file copied just fine. I've been able to reliably reproduce the corruption with a 10G file and sometimes with a 1G file. I was never able to reproduce the corruption with a file smaller than 500M. The corruption itself seems to manifest itself by replacing good data with Nulls. The file size is always correct. Another observation is that it usually takes several attempts for a file transfer to cause corruption, but once it does, it is fairly consistent. Also, I attempted to reproduce the issue by using the "cp" command, "dd", and "rsync". None of these operations would reproduce the issue. Even using the "curl" command line utility to make the FTP transfer worked. The only cases that cause corruption are our custom FTP client and the command line ftp client. I'm assuming their access pattern triggers some edge case in OrangeFS. I also put debug statements in the proftpd code to write the data to a local file immediately before writing to the OrangeFS FS. The debug file would be correct (without corruption), while the file written out to OrangeFS would be corrupted, so this isn't an issue of the data being corrupted in-flight to the FTP server. Any help you can provide would be greatly appreciated. Thanks! -- Benjamin Severs |
|||
Query Language
query: TracLinks and the [[TicketQuery]] macro both use a mini “query language” for specifying query filters. Basically, the filters are separated by ampersands (&). Each filter then consists of the ticket field name, an operator, and one or more values. More than one value are separated by a pipe (|), meaning that the filter matches any of the values.
The available operators are:
| = | the field content exactly matches the one of the values |
| ~= | the field content contains one or more of the values |
| ^= | the field content starts with one of the values |
| $= | the field content ends with one of the values |
All of these operators can also be negated:
| != | the field content matches none of the values |
| !~= | the field content does not contain any of the values |
| !^= | the field content does not start with any of the values |
| !$= | the field content does not end with any of the values |
See also: TracTickets, TracReports, TracGuide
