Commit graph

143 commits

Author SHA1 Message Date
Aaron Schulz
58b5193ef5 [LockManager] Renamed getBucketFromKey() -> getBucketFromPath().
Change-Id: I825dcd255f0b85f81bf925abf46bc46b1fe42e9f
2013-02-01 10:55:12 -08:00
Aaron Schulz
a4f27a198f [LockManager] Generallized wiki field to a domain field.
* In some cases (like certain qualified file backends), a domain
  may be desired that is not simple a wiki ID.
* Also added a LockManangerGroup::config() function to export
  the configuration of a lock manager.

Change-Id: I5a75c55be3cc9017ed8a717d6d30e466fd00340f
2013-02-01 10:40:45 -08:00
jenkins-bot
b1980dfaae Merge "[FileBackend] Added more documentation." 2013-02-01 18:11:05 +00:00
jenkins-bot
5111115ef1 Merge "[LockManager] Updated DBLockManager for cross-wiki support." 2013-02-01 18:06:04 +00:00
Aaron Schulz
7224c402ca [LockManager] Split QuorumLockManager into its own file.
Change-Id: Ib487a39b04ac9de3449695ac388c95ae45933469
2013-01-31 22:29:44 -08:00
Aaron Schulz
2cec654eea [FileBackend] Added more documentation.
Change-Id: I6a0f0dc253fbe82a58345d4179248071062286ff
2013-01-31 22:06:57 -08:00
Aaron Schulz
2693fa5d1b [LockManager] Updated DBLockManager for cross-wiki support.
Change-Id: If02274a3173463ce66037221f494a1ee68ffa51d
2013-01-31 18:26:24 -08:00
MarkAHershberger
e4ff0c7567 Bug 44157 - The return value of realpath should be tested
Change-Id: Id178ee2fa5e294e858ee2af188e02c67f3205da9
2013-01-31 04:53:22 +00:00
Aaron Schulz
5b67e492ff [LockManager] Refactoring to allow proper cross-wiki support.
Change-Id: I331d011a6fa4edd434f0fb547d325ad60901119d
2013-01-28 11:03:33 -08:00
Aaron Schulz
ab0aaa6eba [FileBackend] Added duplicate backend check.
* Not sure when this disappeared from before.

Change-Id: I69a8ce06b2f3bae0e65fb65b63440eb0a2e1128c
2013-01-27 22:36:28 -08:00
Aaron Schulz
1063008826 [FileBackend] Fixed bug where "false" could be included in getDirectoryList().
Change-Id: Ib14192d4f5c5143b07af2191b62ea3919483445a
2013-01-23 12:50:21 -08:00
Aaron Schulz
297a110e6d Align comment whitespace a bit.
Change-Id: I0e52a610586aab95021424eac28175b1a3b6d861
2013-01-18 12:31:04 -08:00
Aaron Schulz
4304146501 Moved $function definition up to make IDE happy.
Change-Id: Ie42ba484c8c2f65a2ae233f0176a286578555cb2
2013-01-17 16:32:19 -08:00
Aaron Schulz
f4c25df570 [FileBackend] Added work-around for lack of temp url support in rgw.
* The S3 side of rgw can be configured for use with just temp URLs.
  This works around http://tracker.newdream.net/issues/3454.

Change-Id: Id0ee68da10b38e1d0a0ba7ebba26fccc8d32e2d4
2013-01-17 23:51:59 +00:00
Aaron Schulz
7c73d36c40 Fixed empty return values in MemcLockManager.
Change-Id: I50489620f08c577095934ff85cf6dcad4c99ae8d
2013-01-14 11:33:50 -08:00
Demon
05c5231538 Merge "[FileBackend] Suppress most file warnings but log them to an FSFileBackend log." 2013-01-09 22:33:50 +00:00
IAlex
1256724550 Merge "[FileBackend] Improved some header related docs." 2013-01-02 22:02:42 +00:00
Aaron Schulz
81d0f396b5 [FileBackend] Suppress most file warnings but log them to an FSFileBackend log.
* Also removed a few returns that are not really useful.

Change-Id: I329ff4ffd52675f6a36e48a95d103d850a61fe7a
2012-12-31 11:17:28 -08:00
Reedy
bfbabaab02 Suppress warnings around copy call
Attempt to shut some noise in production logs

Change-Id: I4bac4027d82e4194b6ec46658d52f49038db573c
Warning:  copy(/mnt/thumbs2/wikipedia/commons/thumb/8/8c/Map_of_USA_AK_full.png/120px-Map_of_USA_AK_full.png) [<a href='function.copy'>function.copy</a>]: failed to open stream: No such file or directory in /usr/local/apache/common-local/php-1.21wmf6/includes/filebackend/FSFileBackend.php on line 254
2012-12-22 18:25:34 +00:00
Aaron Schulz
c1067b5c3a [FileBackend] Improved some header related docs.
Change-Id: I823af49b39afedda51f8192cd6a1a7467a8b78a7
2012-12-20 11:50:35 -08:00
Reedy
faf7d6b7d9 Suppress warnings around unlink call
Attempt to shut a lot of noise in production logs

e.g.
1 Warning:  unlink(/mnt/thumbs2/wikipedia/commons/thumb/f/f2/Members_only_jacket.jpg/800px-Members_only_jacket.jpg) [<a href='function.unlink'>function.unlink</a>]: No such file or directory in /usr/lo
cal/apache/common-local/php-1.21wmf6/includes/filebackend/FSFileBackend.php on line 422

Change-Id: I9e1407c4b11301f468f8e291105955ade9a731d0
2012-12-17 20:27:05 +00:00
Aaron Schulz
a29ee00f1a [LockManager] Moved ScopedLock to its own file.
Change-Id: I7430604d3a23a25e8b82036b022336a73cbbc996
2012-12-14 13:08:05 -08:00
IAlex
3b0f9bfe28 Merge "Tidy up some unbalanced returns in methods" 2012-12-09 09:48:40 +00:00
Reedy
d537d96868 Add numerous missing @throws to method documentation
Change-Id: Iba868e82a75fef7c7d011bc5be192bf059d037c0
2012-12-09 03:09:48 +00:00
Reedy
d0a242abb4 Tidy up some unbalanced returns in methods
Leave a TODO

Change-Id: Ic49ac8630650b341aafb3c17abd22f3a07805d27
2012-12-09 02:59:04 +00:00
Brion VIBBER
252f9438bd Merge "[FileBackend] Removed obsolete "allowStale" parameter." 2012-12-07 00:08:20 +00:00
Aaron Schulz
22bc6df81c [FileBackend] Actually unset the "conn" field in closeConnection().
* This means that handleException() will actually trigger a new auth
  attempt for the next operation if there was an unexpected error.

Change-Id: I8c651cc57d0967549ec67257078c8e126674235d
2012-11-27 14:52:11 -08:00
Aaron Schulz
69b24f9a63 [FileBackend] Removed obsolete "allowStale" parameter.
* This was obsoleted by doQuickOperations().

Change-Id: I9e1d9c1e1c910e4ce6de4317299424305b31469c
2012-11-27 13:55:58 -08:00
Demon
bbbea49f3f Merge "[LockManager] Use proper hmac function for LSLockManager." 2012-11-26 14:09:58 +00:00
Aaron Schulz
ac56107ba3 Merge "Revert "[FileBackend] Added optional callback parameter to concatenate()."" 2012-11-25 01:05:56 +00:00
Aaron Schulz
65612b4290 Revert "[FileBackend] Added optional callback parameter to concatenate()."
This gives updates for the faster part (local FS file changes) and not
the slow GETs that really need this. This should be re-done to use a
byte based read progress callback (that handles the parallel GETs).

This reverts commit 6c9f13b547

Change-Id: Id8d739e1d5048e7f38c68eda4f9a008682707cba
2012-11-24 17:01:12 -08:00
Aaron Schulz
1ba6a84e43 [LockManager] Use proper hmac function for LSLockManager.
Change-Id: If4a3d25a61bcc7cf26beb32abf3d4cc655ca4c55
2012-11-22 19:35:15 -08:00
ASchulz
ef1bb48307 [FileBackend] Improved getFileProps() docs a bit.
Change-Id: I37dfc6c90829aa63511570c4576666e41764b6df
2012-11-21 15:30:54 -08:00
Aaron Schulz
ab0a45cc06 [FileBackend] More stat caching improvements.
* Extended negative caching to handle the "latest" parameter.
* Added a new "dstExists" parameter to some write functions to avoid
  salting the cache when a file is created at an unused path. The ability
  to do this was already mentioned in the setFileCache() doc comments.

Change-Id: Ib64e4c128e16f4d284033fff70b88686fa0593ab
2012-11-21 11:24:38 -08:00
Demon
d0997617b2 Merge "[FileBackend] Added optional callback parameter to concatenate()." 2012-11-21 13:01:49 +00:00
Aaron Schulz
2e0e6a0013 [FileBackend] Added back ability to delete file HTTP headers.
* This partially reverts b80bd6159b.
* Clarified 'headers' parameter documentation a bit.
* Added the "describe" function wrappers that the other ops have.

Change-Id: I7142fd4d973f5f3407d244a4cae793934083bc26
2012-11-21 05:30:27 +00:00
Aaron Schulz
611ae607a0 Fixed metadata-loss bug from b80bd6159b.
* Contrary to Swift docs, doing a POST seems to kill all the old metadata
  headers. I noticed this in testing due to addMissingMetadata() notices.

Change-Id: I988d7a8d38569823c9d66605b02705ee15a8bbe7
2012-11-20 18:17:19 -08:00
Jan Gerber
b80bd6159b [FileBackend] Added support for changing headers on existing objects.
* Added a 'describe' file operation type to doOperations()/doQuickOperations().
  This can be used by scripts to fill in headers like X-Content-Duration for
  files that already exists.
* Removed wrong comments about removing headers (they don't get removed with null).
* Added some quick unit tests.

Change-Id: I43c5907b59421beaa9487eefac0cdbf8bc6c6d85
2012-11-20 16:07:28 -08:00
Tim Starling
1a39cc604b Merge "[FileBackend] Clear the stat cache in doQuickOperations() for sanity." 2012-11-20 22:49:16 +00:00
Aaron Schulz
81ebc15b05 [FileRepo] [FileBackend] Added support for custom file headers.
* For backends that support it, custom HTTP headers can be set on files.
* Added a getStreamHeaders() function to MediaHandler to let subclasses
  recommend header name/value pairs to be used for responses to GET/HEAD
  requests. For example, an OGG handler could set "X-Content-Duration".
* Made LocalFile use this function to set HTTP headers of new uploads.

Change-Id: I1b017e1342513f0097fe6d142aae18e819403293
2012-11-20 14:07:02 -08:00
Aaron Schulz
6c9f13b547 [FileBackend] Added optional callback parameter to concatenate().
* This lets callers update the cache/db with the operation progress so that
  APIs can be made to use this and expose this information to client polling.

Change-Id: I9a86c1c5ffccf029be5a150e5998c3ce4740ec62
2012-11-18 14:02:45 -08:00
Aaron Schulz
da44bd1b5d [FileBackend] Clear the stat cache in doQuickOperations() for sanity.
Change-Id: Id3fcc9b0bbb881947734edaa6799d71d9adb9881
2012-11-17 10:47:49 -08:00
umherirrender
9e504dd8e6 Unset DirectoryIterator in the FileBackend
This is necessory to close all handlers on the directory and than it is
possible to rmdir the directory without a 'permission denied' on a
windows machine.

Corresponding unit test failure:
1) FileBackendTest::testRecursiveClean
Dir mwstore://localtesting/unittest-cont1/e/a no longer exists
(FSFileBackend).
Failed asserting that true matches expected false.

Change-Id: Ide58c6d0ec101bf0ddcd6b7414c51075fc28825b
2012-11-16 12:55:22 -08:00
Aaron Schulz
ae63b9ae10 [FileBackend] Stat caching improvements.
Callers often tend to end up calling getFileStat(), at least indirectly,
or in various successive function on the same path. This created RTTs
when the file didn't exist since negatives were not cached. This change
does the following:

* Cache definitive negatives (404s) in the process cache.
  Nothing is cached on failure (like network problems).
* Ignore process cache entries after a brief time period
  so long running scripts do not have overly stale entries.

Change-Id: I356bd9f48281e3c7e7a273778b2aca59c521a0c7
2012-11-16 12:14:20 -08:00
Aaron Schulz
3e2bb97cc7 Moved "create" function definitions before "store" for consistency.
Change-Id: Ic44470d7a178cb8dcd8f6a9343f961c26fb92988
2012-11-15 09:22:43 +00:00
Aaron Schulz
9dc6ffe9f9 [FileJournal] Randomly prune old log entries.
Change-Id: I667bfdaf167f2154d833b06de7115b4b292a0d2b
2012-11-09 00:28:30 +00:00
Aaron Schulz
9f95bddda7 [FileBackend] Added getFileHttpUrl() function.
* This can speed up certain video file operations for scripts that support
  specifying source files via URLs and support HTTP Range headers.
* Updated unit tests.

Change-Id: I60cb95c2e3dd9f7df1f740e9182be7c79af69d6e
2012-11-08 23:01:19 +00:00
Aaron Schulz
84f94fdfd2 [FileBackend] Avoid some stat calls in various operations.
* copy() and rename() will overwrite any destination, including on Windows.
  Tested with Windows 7, and even rename() does this. The /Y flag is also
  set for Windows cmd commands now.
* Set the "binary mode" /B flag for Windows cmd commands.

Change-Id: Id11f31b020f786d5b66b0c57298ecc2b9d6170fb
2012-11-08 06:35:05 +00:00
Aaron Schulz
9c7018e4fd [FileBackend] Check if paths are writable for delete ops too.
* Also clarified the docs around isPathUsableInternal().

Change-Id: I3fc10fce43e040f45045d6da69f0211e9ab4155d
2012-10-31 23:36:49 -07:00
Aaron Schulz
24a6e8eab6 [FileBackend] Support "ignoreMissingSource" for copy and move operations.
* This lets callers use "copy if exist" semantics more easily and avoids extra stat
  queries to the backend (since the cache is cleared before doOperations()).
* Tweaked FileOp::fileSha1() to reduce backend stat requests as 404s are not cached.

Change-Id: Icb5ca14b3316f273d53593f48979d14e113990e1
2012-10-31 04:24:05 +00:00