~akopytov/percona-xtrabackup/bug1166888-2.0

« back to all changes in this revision

Viewing changes to src/libarchive/README

  • Committer: Alexey Kopytov
  • Date: 2012-02-10 20:05:56 UTC
  • mto: This revision was merged to the branch mainline in revision 390.
  • Revision ID: akopytov@gmail.com-20120210200556-6kx41z8wwrqfucro
Rebase of the parallel compression patch on new trunk + post-review
fixes.

Implementation of parallel compression and streaming for XtraBackup.

This revision implements the following changes:

* InnoDB files are now streamed by the xtrabackup binary rather than
innobackupex. As a result, integrity is now verified by xtrabackup and
thus tar4ibd is no longer needed, so it was removed.

* xtrabackup binary now accepts the new '--stream' option which has
exactly the same semantics as the '--stream' option in
innobackupex: it tells xtrabackup to stream all files to the standard
output in the specified format rather than storing them locally.

* The xtrabackup binary can now do parallel compression using the
quicklz library. Two new options were added to xtrabackup to support
this feature:

- '--compress' tells xtrabackup to compress all output data, including
the transaction log file and meta data files, using the specified
compression algorithm. The only currently supported algorithm is
'quicklz'. The resulting files have the qpress archive format,
i.e. every *.qp file produced by xtrabackup is essentially a one-file
qpress archive and can be extracted and uncompressed by the qpress
file archiver (http://www.quicklz.com/).

- '--compress-threads' specifies the number of worker threads used by
xtrabackup for parallel data compression. This option defaults to 1.

Parallel compression ('--compress-threads') can be used together with
parallel file copying ('--parallel'). For example, '--parallel=4
--compress --compress-threads=2' will create 4 IO threads that will
read the data and pipe it to 2 compression threads.

* To support simultaneous compression and streaming, a new custom
streaming format called 'xbstream' was introduced to XtraBackup in
addition to the 'tar' format. That was required to overcome some
limitations of traditional archive formats such as 'tar', 'cpio' and
others that do not allow streaming dynamically generated files, for
example dynamically compressed files.  Other advantages of xbstream over
traditional streaming/archive formats include ability to stream multiple
files concurrently (so it is possible to use streaming in the xbstream
format together with the --parallel option) and more compact data
storage.

* To allow streaming and extracting files to/from the xbstream format
produced by xtrabackup, a new utility aptly called 'xbstream' was
added to the XtraBackup distribution. This utility has a tar-like
interface:

- with the '-x' option it extracts files from the stream read from its
standard input to the current directory unless specified otherwise
with the '-C' option.

- with the '-c' option it streams files specified on the command line
to its standard output.

The utility also tries to minimize its impact on the OS page cache by
using the appropriate posix_fadvise() calls when available.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
README for libarchive bundle.
 
2
 
 
3
Questions?  Issues?
 
4
   * http://libarchive.googlecode.com/ is the home for ongoing
 
5
     libarchive development, including issue tracker, additional
 
6
     documentation, and links to the libarchive mailing lists.
 
7
 
 
8
This distribution bundle includes the following components:
 
9
   * libarchive: a library for reading and writing streaming archives
 
10
   * tar: the 'bsdtar' program is a full-featured 'tar'
 
11
          replacement built on libarchive
 
12
   * cpio: the 'bsdcpio' program is a different interface to
 
13
          essentially the same functionality
 
14
   * examples: Some small example programs that you may find useful.
 
15
   * examples/minitar: a compact sample demonstrating use of libarchive.
 
16
          I use this for testing link pollution; it should produce a very
 
17
          small executable file on most systems.
 
18
   * contrib:  Various items sent to me by third parties;
 
19
          please contact the authors with any questions.
 
20
 
 
21
The top-level directory contains the following information files:
 
22
   * NEWS - highlights of recent changes
 
23
   * COPYING - what you can do with this
 
24
   * INSTALL - installation instructions
 
25
   * README - this file
 
26
   * configure - configuration script, see INSTALL for details.
 
27
   * CMakeLists.txt - input for "cmake" build tool, see INSTALL
 
28
 
 
29
The following files in the top-level directory are used by the
 
30
'configure' script:
 
31
   * Makefile.am, aclocal.m4, configure.ac
 
32
       - used to build this distribution, only needed by maintainers
 
33
   * Makefile.in, config.h.in
 
34
        - templates used by configure script
 
35
 
 
36
Guide to Documentation installed by this system:
 
37
 * bsdtar.1 explains the use of the bsdtar program
 
38
 * bsdcpio.1 explains the use of the bsdcpio program
 
39
 * libarchive.3 gives an overview of the library as a whole
 
40
 * archive_read.3, archive_write.3, archive_write_disk.3, and
 
41
   archive_read_disk.3 provide detailed calling sequences for the read
 
42
   and write APIs
 
43
 * archive_entry.3 details the "struct archive_entry" utility class
 
44
 * archive_internals.3 provides some insight into libarchive's
 
45
   internal structure and operation.
 
46
 * libarchive-formats.5 documents the file formats supported by the library
 
47
 * cpio.5, mtree.5, and tar.5 provide detailed information about these
 
48
   popular archive formats, including hard-to-find details about
 
49
   modern cpio and tar variants.
 
50
The manual pages above are provided in the 'doc' directory in
 
51
a number of different formats.
 
52
 
 
53
You should also read the copious comments in "archive.h" and the
 
54
source code for the sample programs for more details.  Please let me
 
55
know about any errors or omissions you find.
 
56
 
 
57
Currently, the library automatically detects and reads the following:
 
58
  * gzip compression
 
59
  * bzip2 compression
 
60
  * compress/LZW compression
 
61
  * lzma and xz compression
 
62
  * GNU tar format (including GNU long filenames, long link names, and
 
63
    sparse files)
 
64
  * Solaris 9 extended tar format (including ACLs)
 
65
  * Old V7 tar archives
 
66
  * POSIX ustar
 
67
  * POSIX pax interchange format
 
68
  * POSIX octet-oriented cpio
 
69
  * SVR4 ASCII cpio
 
70
  * POSIX octet-oriented cpio
 
71
  * Binary cpio (big-endian or little-endian)
 
72
  * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions)
 
73
  * ZIP archives (with uncompressed or "deflate" compressed entries)
 
74
  * GNU and BSD 'ar' archives
 
75
  * 'mtree' format
 
76
 
 
77
The library can write:
 
78
  * gzip compression
 
79
  * bzip2 compression
 
80
  * compress/LZW compression
 
81
  * lzma and xz compression
 
82
  * POSIX ustar
 
83
  * POSIX pax interchange format
 
84
  * "restricted" pax format, which will create ustar archives except for
 
85
    entries that require pax extensions (for long filenames, ACLs, etc).
 
86
  * POSIX octet-oriented cpio
 
87
  * SVR4 "newc" cpio
 
88
  * shar archives
 
89
  * ZIP archives (with uncompressed or "deflate" compressed entries)
 
90
  * GNU and BSD 'ar' archives
 
91
  * 'mtree' format
 
92
 
 
93
Notes about the library architecture:
 
94
 
 
95
 * This is a heavily stream-oriented system.  There is no direct
 
96
   support for in-place modification or random access.
 
97
 
 
98
 * The library is designed to be extended with new compression and
 
99
   archive formats.  The only requirement is that the format be
 
100
   readable or writable as a stream and that each archive entry be
 
101
   independent.  There are articles on the libarchive Wiki explaining
 
102
   how to extend libarchive.
 
103
 
 
104
 * On read, compression and format are always detected automatically.
 
105
 
 
106
 * I've attempted to minimize static link pollution.  If you don't
 
107
   explicitly invoke a particular feature (such as support for a
 
108
   particular compression or format), it won't get pulled in.
 
109
   In particular, if you don't explicitly enable a particular
 
110
   compression or decompression support, you won't need to link
 
111
   against the corresponding compression or decompression libraries.
 
112
   This also reduces the size of statically-linked binaries in
 
113
   environments where that matters.
 
114
 
 
115
 * On read, the library accepts whatever blocks you hand it.
 
116
   Your read callback is free to pass the library a byte at a time
 
117
   or mmap the entire archive and give it to the library at once.
 
118
   On write, the library always produces correctly-blocked output.
 
119
 
 
120
 * The object-style approach allows you to have multiple archive streams
 
121
   open at once.  bsdtar uses this in its "@archive" extension.
 
122
 
 
123
 * The archive itself is read/written using callback functions.
 
124
   You can read an archive directly from an in-memory buffer or
 
125
   write it to a socket, if you wish.  There are some utility
 
126
   functions to provide easy-to-use "open file," etc, capabilities.
 
127
 
 
128
 * The read/write APIs are designed to allow individual entries
 
129
   to be read or written to any data source:  You can create
 
130
   a block of data in memory and add it to a tar archive without
 
131
   first writing a temporary file.  You can also read an entry from
 
132
   an archive and write the data directly to a socket.  If you want
 
133
   to read/write entries to disk, there are convenience functions to
 
134
   make this especially easy.
 
135
 
 
136
 * Note: "pax interchange format" is really an extended tar format,
 
137
   despite what the name says.