Author: stefan2
Date: Fri May 23 23:40:19 2014
New Revision: 1597220
URL: http://svn.apache.org/r1597220
Log:
Sync'ing FSX with FSFS:
Merge revisions r1559748,1578112 from subversion/libsvn_fs_fs into
subversion/libsvn_fs_x and resolve a trivial tree conflict.
This ports the "compression level" option to FSX.
Modified:
subversion/trunk/subversion/libsvn_fs_x/ (props changed)
subversion/trunk/subversion/libsvn_fs_x/fs.h
subversion/trunk/subversion/libsvn_fs_x/fs_x.c
subversion/trunk/subversion/libsvn_fs_x/transaction.c
Propchange: subversion/trunk/subversion/libsvn_fs_x/
------------------------------------------------------------------------------
Merged /subversion/trunk/subversion/libsvn_fs_fs:r1559748,1578112
Modified: subversion/trunk/subversion/libsvn_fs_x/fs.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/fs.h?rev=1597220&r1=1597219&r2=1597220&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/fs.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/fs.h Fri May 23 23:40:19 2014
@@ -107,6 +107,7 @@ extern "C" {
#define CONFIG_SECTION_DELTIFICATION "deltification"
#define CONFIG_OPTION_MAX_DELTIFICATION_WALK "max-deltification-walk"
#define CONFIG_OPTION_MAX_LINEAR_DELTIFICATION "max-linear-deltification"
+#define CONFIG_OPTION_COMPRESSION_LEVEL "compression-level"
#define CONFIG_SECTION_PACKED_REVPROPS "packed-revprops"
#define CONFIG_OPTION_REVPROP_PACK_SIZE "revprop-pack-size"
#define CONFIG_OPTION_COMPRESS_PACKED_REVPROPS "compress-packed-revprops"
@@ -400,6 +401,9 @@ typedef struct fs_x_data_t
* deltification history after which skip deltas will be used. */
apr_int64_t max_linear_deltification;
+ /* Compression level to use with txdelta storage format in new revs. */
+ int delta_compression_level;
+
/* Pointer to svn_fs_open. */
svn_error_t *(*svn_fs_open_)(svn_fs_t **, const char *, apr_hash_t *,
apr_pool_t *);
Modified: subversion/trunk/subversion/libsvn_fs_x/fs_x.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/fs_x.c?rev=1597220&r1=1597219&r2=1597220&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/fs_x.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/fs_x.c Fri May 23 23:40:19 2014
@@ -28,6 +28,7 @@
#include "svn_props.h"
#include "svn_time.h"
#include "svn_dirent_uri.h"
+#include "svn_sorts.h"
#include "svn_version.h"
#include "cached_data.h"
@@ -211,6 +212,7 @@ read_config(fs_x_data_t *ffd,
apr_pool_t *scratch_pool)
{
svn_config_t *config;
+ apr_int64_t compression_level;
SVN_ERR(svn_config_read3(&config,
svn_dirent_join(fs_path, PATH_CONFIG, scratch_pool),
@@ -230,6 +232,13 @@ read_config(fs_x_data_t *ffd,
CONFIG_SECTION_DELTIFICATION,
CONFIG_OPTION_MAX_LINEAR_DELTIFICATION,
SVN_FS_X_MAX_LINEAR_DELTIFICATION));
+ SVN_ERR(svn_config_get_int64(config, &compression_level,
+ CONFIG_SECTION_DELTIFICATION,
+ CONFIG_OPTION_COMPRESSION_LEVEL,
+ SVN_DELTA_COMPRESSION_LEVEL_DEFAULT));
+ ffd->delta_compression_level
+ = (int)MIN(MAX(SVN_DELTA_COMPRESSION_LEVEL_NONE, compression_level),
+ SVN_DELTA_COMPRESSION_LEVEL_MAX);
/* Initialize revprop packing settings in ffd. */
SVN_ERR(svn_config_get_bool(config, &ffd->compress_packed_revprops,
@@ -361,6 +370,24 @@ write_config(svn_fs_t *fs,
"### exclusive use of skip-deltas." NL
"### For 1.8, the default value is 16." NL
"# " CONFIG_OPTION_MAX_LINEAR_DELTIFICATION " = 16" NL
+"###" NL
+"### After deltification, we compress the data through zlib to minimize on-" NL
+"### disk size. That can be an expensive and ineffective process. This" NL
+"### setting controls the usage of zlib in future revisions." NL
+"### Revisions with highly compressible data in them may shrink in size" NL
+"### if the setting is increased but may take much longer to commit. The" NL
+"### time taken to uncompress that data again is widely independent of the" NL
+"### compression level." NL
+"### Compression will be ineffective if the incoming content is already" NL
+"### highly compressed. In that case, disabling the compression entirely" NL
+"### will speed up commits as well as reading the data. Repositories with" NL
+"### many small compressible files (source code) but also a high percentage" NL
+"### of large incompressible ones (artwork) may benefit from compression" NL
+"### levels lowered to e.g. 1." NL
+"### Valid values are 0 to 9 with 9 providing the highest compression ratio" NL
+"### and 0 disabling it altogether." NL
+"### The default value is 5." NL
+"# " CONFIG_OPTION_COMPRESSION_LEVEL " = 5" NL
"" NL
"[" CONFIG_SECTION_PACKED_REVPROPS "]" NL
"### This parameter controls the size (in kBytes) of packed revprop files." NL
@@ -394,12 +421,12 @@ write_config(svn_fs_t *fs,
"###" NL
"### When a specific piece of information needs to be read from disk, a" NL
"### data block is being read at once and its contents are being cached." NL
-"### If the repository is being stored on a RAID, the block size should" NL
-"### be either 50% or 100% of RAID block size / granularity. Also, your" NL
-"### file system (clusters) should be properly aligned and sized. In that" NL
+"### If the repository is being stored on a RAID, the block size should be" NL
+"### either 50% or 100% of RAID block size / granularity. Also, your file" NL
+"### system blocks/clusters should be properly aligned and sized. In that" NL
"### setup, each access will hit only one disk (minimizes I/O load) but" NL
"### uses all the data provided by the disk in a single access." NL
-"### For SSD-based storage systems, slightly lower values around 16 kB" NL
+"### For SSD-based storage systems, slightly lower values around 16 kB" NL
"### may improve latency while still maximizing throughput." NL
"### Can be changed at any time but must be a power of 2." NL
"### block-size is 64 kBytes by default." NL
@@ -412,7 +439,7 @@ write_config(svn_fs_t *fs,
"### space." NL
"### Changing this parameter only affects larger revisions with thousands" NL
"### of changed paths. A smaller value means that more pages need to be" NL
-"### allocated for such revisions, increasing the size of the page table" NL
+"### allocated for such revisions, increasing the size of the page table" NL
"### meaning it takes longer to read that table (once). Access to each" NL
"### page is then faster because less data has to read. So, if you have" NL
"### several extremely large revisions (approaching 1 mio changes), think" NL
@@ -424,11 +451,11 @@ write_config(svn_fs_t *fs,
"###" NL
"### The phys-to-log index maps positions within the rev or pack file to" NL
"### to data items, i.e. describes what piece of information is being" NL
-"### stored at that particular offset. The index describes the rev file" NL
+"### stored at any particular offset. The index describes the rev file" NL
"### in chunks (pages) and keeps a global list of all those pages. Large" NL
"### pages mean a shorter page table but a larger per-page description of" NL
"### data items in it. The latency sweetspot depends on the change size" NL
-"### distribution but is relatively wide." NL
+"### distribution but covers a relatively wide range." NL
"### If the repository contains very large files, i.e. individual changes" NL
"### of tens of MB each, increasing the page size will shorten the index" NL
"### file at the expense of a slightly increased latency in sections with" NL
Modified: subversion/trunk/subversion/libsvn_fs_x/transaction.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/transaction.c?rev=1597220&r1=1597219&r2=1597220&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/transaction.c Fri May 23 23:40:19
2014
@@ -2112,6 +2112,7 @@ rep_write_get_baton(struct rep_write_bat
node_revision_t *noderev,
apr_pool_t *pool)
{
+ fs_x_data_t *ffd = fs->fsap_data;
struct rep_write_baton *b;
apr_file_t *file;
representation_t *base_rep;
@@ -2175,7 +2176,7 @@ rep_write_get_baton(struct rep_write_bat
&whb,
svn_stream_disown(b->rep_stream, b->pool),
diff_version,
- SVN_DELTA_COMPRESSION_LEVEL_DEFAULT,
+ ffd->delta_compression_level,
pool);
b->delta_stream = svn_txdelta_target_push(wh, whb, source, b->pool);
@@ -2596,6 +2597,7 @@ write_container_delta_rep(representation
svn_revnum_t final_revision,
apr_pool_t *pool)
{
+ fs_x_data_t *ffd = fs->fsap_data;
svn_txdelta_window_handler_t diff_wh;
void *diff_whb;
@@ -2647,7 +2649,7 @@ write_container_delta_rep(representation
&diff_whb,
svn_stream_disown(file_stream, pool),
diff_version,
- SVN_DELTA_COMPRESSION_LEVEL_DEFAULT,
+ ffd->delta_compression_level,
pool);
whb = apr_pcalloc(pool, sizeof(*whb));