ruby-mogilefs-client.git
4 years agoRuby mogilefs-client 3.12.2masterv3.12.2
Eric Wong [Thu, 6 Feb 2020 08:59:07 +0000 (6 08:59 +0000)]
Ruby mogilefs-client 3.12.2

Only one documentation change to update URLs.

bogomips.org is expiring and with the price of the .org TLD
inevitably going up, I won't be able to afford to pay
extortionists at ICANN/Ethos/PIR.

4 years agos/bogomips.org/yhbt.net/
Eric Wong [Sat, 1 Feb 2020 21:20:20 +0000 (1 21:20 +0000)]
s/bogomips.org/yhbt.net/

bogomips.org is expiring and with the price of the .org TLD
inevitably going up, I won't be able to afford to pay
extortionists

4 years agoRuby mogilefs-client 3.12.1v3.12.1
Eric Wong [Mon, 11 Nov 2019 22:07:48 +0000 (11 22:07 +0000)]
Ruby mogilefs-client 3.12.1

Minor cleanups, mainly to fix annoying warnings in Ruby 2.7.0dev.

4 changes since v3.12.0 (2019-01-02):

      pkg.mk: use dark216 olddoc theme for Earth Day 2019
      mogilefs: actually use kwarg for Net::HTTP::Persistent.new
      fix more indentation warnings
      test_client: quiet warnings about redefining accessors

4 years agotest_client: quiet warnings about redefining accessors
Eric Wong [Tue, 29 Oct 2019 08:01:08 +0000 (29 08:01 +0000)]
test_client: quiet warnings about redefining accessors

lasterr and lasterrstr are already readers, so we only need
to expose them as writers, not as both.

4 years agofix more indentation warnings
Eric Wong [Mon, 28 Oct 2019 20:28:57 +0000 (28 20:28 +0000)]
fix more indentation warnings

Not sure how or why I missed these with commit 4e0f8155a62711ae
("fix indentation warnings with ruby trunk"), but this cleans
them up.

4 years agomogilefs: actually use kwarg for Net::HTTP::Persistent.new
Eric Wong [Mon, 28 Oct 2019 20:28:19 +0000 (28 20:28 +0000)]
mogilefs: actually use kwarg for Net::HTTP::Persistent.new

Ruby 2.7.0dev will warn about hashes uses as kwargs *sigh*

4 years agopkg.mk: use dark216 olddoc theme for Earth Day 2019
Eric Wong [Mon, 28 Oct 2019 20:27:10 +0000 (28 20:27 +0000)]
pkg.mk: use dark216 olddoc theme for Earth Day 2019

I forgot to commit this change months ago.

5 years agoRuby mogilefs-client 3.12.0v3.12.0
Eric Wong [Wed, 2 Jan 2019 22:48:14 +0000 (2 22:48 +0000)]
Ruby mogilefs-client 3.12.0

Minor cleanups, mainly to fix indentation warnings in Ruby 2.6+

7 changes since v3.11.1 (2017-03-23):

      pool: simplify empty class definition
      new_file/stream: remove unused variable
      mog: add updateclass command
      socket/pure_ruby: favor String#clear if available
      fix indentation warnings with ruby trunk
      doc: https:// URLs instead of git://
      update URLs to point to wiki

5 years agoupdate URLs to point to wiki
Eric Wong [Wed, 2 Jan 2019 22:46:25 +0000 (2 22:46 +0000)]
update URLs to point to wiki

The old homepage redirect is dead and expired

5 years agodoc: https:// URLs instead of git://
Eric Wong [Tue, 3 Jul 2018 13:26:45 +0000 (3 13:26 +0000)]
doc: https:// URLs instead of git://

Dogfooding some Ruby code...

5 years agofix indentation warnings with ruby trunk
Eric Wong [Tue, 19 Jun 2018 03:57:15 +0000 (19 03:57 +0000)]
fix indentation warnings with ruby trunk

Ruby trunk started warning about more mismatched indentations
starting around r62836.

5 years agosocket/pure_ruby: favor String#clear if available
Eric Wong [Tue, 19 Jun 2018 03:57:14 +0000 (19 03:57 +0000)]
socket/pure_ruby: favor String#clear if available

String#replace keeps garbage around a bit longer,
so it's not always the better option.

cf. http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/86983
    https://public-inbox.org/ruby-core/20180511033641.GA4459@dcvr/

5 years agomog: add updateclass command
Eric Wong [Tue, 19 Jun 2018 03:57:13 +0000 (19 03:57 +0000)]
mog: add updateclass command

This is to change classes of existing files (not change classes
themselves as in "mogadm class update"

6 years agonew_file/stream: remove unused variable
Eric Wong [Wed, 20 Dec 2017 08:30:47 +0000 (20 08:30 +0000)]
new_file/stream: remove unused variable

oops :x

6 years agopool: simplify empty class definition
Eric Wong [Mon, 26 Jun 2017 02:31:57 +0000 (26 02:31 +0000)]
pool: simplify empty class definition

This should compile to smaller bytecode with YARV

7 years agomogilefs-client 3.11.1v3.11.1
Eric Wong [Thu, 23 Mar 2017 02:01:09 +0000 (23 02:01 +0000)]
mogilefs-client 3.11.1

This release updates the IO#write garbage workaround to be
enabled for Ruby 2.0 and 2.1 users; but avoids it on the
just-released Ruby 2.4.1; as that includes the backported bugfix
for https://bugs.ruby-lang.org/issues/13085

There's also some trivial doc and code aesthetics fixes.

6 changes since 3.11.0:

      .olddoc.yml: add trailing slash on URL
      socket_common: expand IO#write garbage workaround to 2.0 and 2.1
      socket_common: limit garbage workaround to Ruby <= 2.4.1
      socket_common: remove needless 'o' modifier for Regexp
      socket_common: improve readability of case statement
      GNUmakefile: fix incorrect comment

7 years agoGNUmakefile: fix incorrect comment
Eric Wong [Thu, 23 Mar 2017 02:00:45 +0000 (23 02:00 +0000)]
GNUmakefile: fix incorrect comment

"touch -r" is actually in POSIX.

7 years agosocket_common: improve readability of case statement
Eric Wong [Thu, 23 Mar 2017 00:52:36 +0000 (23 00:52 +0000)]
socket_common: improve readability of case statement

Due to the release of Ruby 2.4.1 with the necessary fix,
it seems likely that future releases (if any) of the 2.2
and 2.3 series will avoid garbage on IO#write, too.

7 years agosocket_common: remove needless 'o' modifier for Regexp
Eric Wong [Thu, 23 Mar 2017 00:34:34 +0000 (23 00:34 +0000)]
socket_common: remove needless 'o' modifier for Regexp

There's no variable interpolation for the regexp.

7 years agosocket_common: limit garbage workaround to Ruby <= 2.4.1
Eric Wong [Mon, 13 Mar 2017 19:27:07 +0000 (13 19:27 +0000)]
socket_common: limit garbage workaround to Ruby <= 2.4.1

It looks like Ruby 2.4.1 will have the regression fixed
backported to it:

https://bugs.ruby-lang.org/issues/13299#change-63503

The next releases of Ruby 2.3 and 2.2 may, too; at the
branch maintainer's decision.

7 years agosocket_common: expand IO#write garbage workaround to 2.0 and 2.1
Eric Wong [Fri, 3 Feb 2017 22:56:06 +0000 (3 22:56 +0000)]
socket_common: expand IO#write garbage workaround to 2.0 and 2.1

On reading more carefully, it seems this change is from
r34847 which landed in Ruby 2.0.  So we still need to support
Ruby 2.0 and 2.1 users.

7 years ago.olddoc.yml: add trailing slash on URL
Eric Wong [Tue, 31 Jan 2017 18:39:31 +0000 (31 18:39 +0000)]
.olddoc.yml: add trailing slash on URL

Oops, olddoc screws up the Atom XML feed otherwise...

7 years agoRuby mogilefs-client 3.11.0v3.11.0
Eric Wong [Tue, 31 Jan 2017 18:22:59 +0000 (31 18:22 +0000)]
Ruby mogilefs-client 3.11.0

This release provides compatibility with net-http-persistent 3.x
while retaining support for the (API-incompatible) 2.x series.

Users of mainline Ruby 2.2+ get a workaround for excessive
garbage for uploading files.  This excessive garbage on IO#write
should be fixed when Ruby 2.5 gets released on Dec 25, 2017:
https://bugs.ruby-lang.org/issues/13085

There's also a few minor garbage reductions of small strings,
relying on the maintained cmogstored for Content-Range PUT
testing, and some minor build system and documentation updates.

12 changes since 3.10.0 (Aug 2016):

      avoid pointless capture in regexp
      use opt_str_freeze to avoid allocations in a few places
      new_file/common: simplify empty class declarations
      support net-http-persistent 3.x
      test: switch to cmogstored for testing Content-Range PUTs
      avoid excessive garbage on uploads with Ruby 2.2+
      socket_common: limit IO#write garbage workaround to <= 2.4
      freeze string literals in a few more places
      update URLS to HTTPS
      README: explain removal of NFS support
      doc: remove private email address linkage
      gemspec: remove olddoc development dependency

7 years agogemspec: remove olddoc development dependency
Eric Wong [Tue, 31 Jan 2017 18:10:10 +0000 (31 18:10 +0000)]
gemspec: remove olddoc development dependency

At least it should not be needed for rebuilding the gem,
anymore.  This will hopefully make it easier to package
and hack.

7 years agodoc: remove private email address linkage
Eric Wong [Tue, 31 Jan 2017 18:05:57 +0000 (31 18:05 +0000)]
doc: remove private email address linkage

Instead, promote anonymous remailers and put users in
charge of their own anonymity.

7 years agoREADME: explain removal of NFS support
Eric Wong [Tue, 31 Jan 2017 18:04:31 +0000 (31 18:04 +0000)]
README: explain removal of NFS support

Hopefully nobody complains about us dropping the feature, then.

7 years agoupdate URLS to HTTPS
Eric Wong [Tue, 31 Jan 2017 18:03:01 +0000 (31 18:03 +0000)]
update URLS to HTTPS

This helps somewhat with user privacy; since reading about
distributed systems can get people tagged as anti-authoritarian :P

7 years agofreeze string literals in a few more places
Eric Wong [Tue, 31 Jan 2017 01:56:36 +0000 (31 01:56 +0000)]
freeze string literals in a few more places

This should reduce the amount of garbage we produce and
keep the process leaner and meaner.

7 years agosocket_common: limit IO#write garbage workaround to <= 2.4
Eric Wong [Mon, 30 Jan 2017 20:17:29 +0000 (30 20:17 +0000)]
socket_common: limit IO#write garbage workaround to <= 2.4

It looks like this regression will be fixed in time for
Ruby 2.5.

7 years agoavoid excessive garbage on uploads with Ruby 2.2+
Eric Wong [Fri, 27 Jan 2017 02:53:41 +0000 (27 02:53 +0000)]
avoid excessive garbage on uploads with Ruby 2.2+

This is a workaround for <https://bugs.ruby-lang.org/issues/13085>
since we use non-blocking sockets anyways.

7 years agotest: switch to cmogstored for testing Content-Range PUTs
Eric Wong [Thu, 26 Jan 2017 23:24:20 +0000 (26 23:24 +0000)]
test: switch to cmogstored for testing Content-Range PUTs

mogstored_rack is long abandoned since I decided to work on
cmogstored (in C, not Ruby :) instead.
We still need this test since the original Perl mogstored
does not yet support Content-Range: in PUT requests.

7 years agosupport net-http-persistent 3.x
Eric Wong [Thu, 26 Jan 2017 21:42:54 +0000 (26 21:42 +0000)]
support net-http-persistent 3.x

The optional net-http-persistent RubyGem we use has a major
incompatible change from the 2.x versions.  Support them both.

7 years agonew_file/common: simplify empty class declarations
Eric Wong [Thu, 29 Dec 2016 07:39:48 +0000 (29 07:39 +0000)]
new_file/common: simplify empty class declarations

This compiles to smaller bytecode on YARV (MRI)

7 years agouse opt_str_freeze to avoid allocations in a few places
Eric Wong [Thu, 29 Dec 2016 07:31:40 +0000 (29 07:31 +0000)]
use opt_str_freeze to avoid allocations in a few places

None of these are too performance critical, but err on
the safe side and avoid allocations whenever possible.

7 years agoavoid pointless capture in regexp
Eric Wong [Thu, 29 Dec 2016 06:43:49 +0000 (29 06:43 +0000)]
avoid pointless capture in regexp

We do not emit any sort of message on successful 2XX responses,
so there's no need to save the actual response after writing.

7 years agoRuby mogilefs-client 3.10.0v3.10.0
Eric Wong [Wed, 31 Aug 2016 07:11:32 +0000 (31 07:11 +0000)]
Ruby mogilefs-client 3.10.0

A bunch of minor tweaks to reduce garbage and exceptions.

In addition to the existing :timeout and :fail_timeout options,
there is a new :connect_timeout directive for all connection
classes which only controls the time spent waiting for a TCP
connection.  This defaults to the same value as the existing
:timeout option (3 seconds); but users are advised to lower
it to match ideal network conditions.

For users of Ruby 2.3+, this release takes advantage of
exception-less Socket#connect_nonblock using "exception: false".
Users of Ruby 2.1+ will also benefit from "exception: false"
usage for read_nonblock and write_nonblock calls.
kgio is no longer be useful with this release with Ruby 2.3+

This release also fixes a Ruby 1.8.7 compatibility bug for
non-kgio users.  However, this may be the last 1.8.7-compatible
release.  Fwiw, I wanted to remove Ruby 1.8 support around 5
years ago but several users were against it.   Maybe nobody will
complain, this time...

18 changes since 3.9.0:

      doc: avoid inadvertantly documenting the Process class
      admin: simplify utilization conversion
      more idiomatic comparisons with constants
      bigfile/filter: only update MD5 if non-nil
      bigfile: lazily require bigfile/filter
      backend: simplify regexp
      .olddoc.yml: add NNTP and mailing list archive URL
      minor garbage reductions for newer Rubies
      socket/pure_ruby: fix Ruby 1.8 compatibility
      socket/pure_ruby: use `:exception=>false' on Ruby 2.1+
      test_fresh: do not delete non-existent domain
      admin: map unset reject_bad_md5 field to nil
      socket/pure_ruby: connect with "exception:false" on Ruby 2.3+
      implement :connect_timeout option
      add .gitattributes for Ruby method detection
      README: stop mentioning cgit
      connect_timeout: match :timeout if unset
      pkg.mk: use --local option for gem installation

7 years agopkg.mk: use --local option for gem installation
Eric Wong [Wed, 31 Aug 2016 07:30:39 +0000 (31 07:30 +0000)]
pkg.mk: use --local option for gem installation

We should never attempt to use the network to install a
locally-built gem.

7 years agoconnect_timeout: match :timeout if unset
Eric Wong [Wed, 31 Aug 2016 07:06:55 +0000 (31 07:06 +0000)]
connect_timeout: match :timeout if unset

And add some weak tests while we're at it.
Actually simulating a connection timeout on localhost
will be difficult.

7 years agoREADME: stop mentioning cgit
Eric Wong [Wed, 31 Aug 2016 02:41:13 +0000 (31 02:41 +0000)]
README: stop mentioning cgit

It is unlikely I will be using cgit in the future since
it has CSS and lacks mailing list integration.

7 years agoadd .gitattributes for Ruby method detection
Eric Wong [Wed, 31 Aug 2016 02:16:44 +0000 (31 02:16 +0000)]
add .gitattributes for Ruby method detection

The "diff" function detection for C does not map well to
Ruby files, take advantage of gitattributes(5) to improve
method name detection in generated patches as well as
making "git diff -W" output more useful.

7 years agoimplement :connect_timeout option
Eric Wong [Fri, 26 Aug 2016 21:38:54 +0000 (26 21:38 +0000)]
implement :connect_timeout option

This can be useful for specifying a different timeout for
establishing a connection.  Some requests could be expensive and
want a higher :timeout measured in seconds, while the time to
establish a TCP connection on a healthy LAN could be less than
a millisecond.

This defaults to 3s to match the existing :timeout, but only
affects the amount of time the client will wait for establishing
a TCP connection to a tracker.

7 years agosocket/pure_ruby: connect with "exception:false" on Ruby 2.3+
Eric Wong [Wed, 31 Aug 2016 02:39:11 +0000 (31 02:39 +0000)]
socket/pure_ruby: connect with "exception:false" on Ruby 2.3+

Exceptions are expensive for common errors, so avoid raising
them under Ruby 2.3+ which allows connect_nonblock to be
called with "exception: false" kwarg.

7 years agoadmin: map unset reject_bad_md5 field to nil
Eric Wong [Wed, 31 Aug 2016 02:21:04 +0000 (31 02:21 +0000)]
admin: map unset reject_bad_md5 field to nil

The 'reject_bad_md5' field may be of an unknown value
before the monitor is ready, so prepare for it and map
it to 'nil' instead of an empty string.  This hopefully
makes the Ruby API more Ruby-ish.

7 years agotest_fresh: do not delete non-existent domain
Eric Wong [Wed, 31 Aug 2016 02:19:00 +0000 (31 02:19 +0000)]
test_fresh: do not delete non-existent domain

This test bug was exposed due to using an old
MogileFS-Server without
commit d0ee2a27253ade4b50ef5b91471f4f520a67bf8c
("Work with DBD::SQLite's latest lock errors")

8 years agosocket/pure_ruby: use `:exception=>false' on Ruby 2.1+
Eric Wong [Wed, 4 Nov 2015 21:41:22 +0000 (4 21:41 +0000)]
socket/pure_ruby: use `:exception=>false' on Ruby 2.1+

This feature allows us to avoid expensive exceptions when doing
non-blocking I/O without relying on horrible hacks like kgio.

8 years agosocket/pure_ruby: fix Ruby 1.8 compatibility
Eric Wong [Thu, 22 Oct 2015 22:26:23 +0000 (22 22:26 +0000)]
socket/pure_ruby: fix Ruby 1.8 compatibility

For non-kgio users, IO#wait_readable did not appear until Ruby 2.0.
Additionally, optimistically perform reads before waiting because
EOF handling behavior differs in current revisions of Ruby 2.3.0dev.

8 years agominor garbage reductions for newer Rubies
Eric Wong [Thu, 22 Oct 2015 21:14:45 +0000 (22 21:14 +0000)]
minor garbage reductions for newer Rubies

opt_str_freeze and String#split is optimized for single-byte splits.
Use bang methods for escaping, avoiding much garbage in tight
loops.

8 years ago.olddoc.yml: add NNTP and mailing list archive URL
Eric Wong [Thu, 22 Oct 2015 21:13:50 +0000 (22 21:13 +0000)]
.olddoc.yml: add NNTP and mailing list archive URL

8 years agobackend: simplify regexp
Eric Wong [Mon, 14 Sep 2015 10:08:31 +0000 (14 10:08 +0000)]
backend: simplify regexp

We don't care if there's a \r before \n if we anchor on \z.

8 years agobigfile: lazily require bigfile/filter
Eric Wong [Mon, 14 Sep 2015 09:44:10 +0000 (14 09:44 +0000)]
bigfile: lazily require bigfile/filter

None of the bigfile stuff is in common use, so avoid bloating
user apps with more of it.

8 years agobigfile/filter: only update MD5 if non-nil
Eric Wong [Mon, 14 Sep 2015 09:37:20 +0000 (14 09:37 +0000)]
bigfile/filter: only update MD5 if non-nil

It is possible to disable MD5 verification, so we cannot risk
updating a nil object.

Also, favor explicitly calling "update" instead of using "<<" which
YARV will attempt to optimize for Array/String receivers at the cost
of other objects (such as Digest::MD5)

8 years agomore idiomatic comparisons with constants
Eric Wong [Mon, 14 Sep 2015 09:35:40 +0000 (14 09:35 +0000)]
more idiomatic comparisons with constants

These generates smaller bytecode than explicitly
comparing to a constant value.

8 years agoadmin: simplify utilization conversion
Eric Wong [Mon, 14 Sep 2015 09:31:49 +0000 (14 09:31 +0000)]
admin: simplify utilization conversion

The tracker won't send a utilization field until it has
that data.

8 years agodoc: avoid inadvertantly documenting the Process class
Eric Wong [Thu, 25 Jun 2015 11:17:11 +0000 (25 11:17 +0000)]
doc: avoid inadvertantly documenting the Process class

rdoc seems to think we implement something for Process, we do not.

8 years agoRuby mogilefs-client 3.9.0v3.9.0
Eric Wong [Thu, 25 Jun 2015 11:08:20 +0000 (25 11:08 +0000)]
Ruby mogilefs-client 3.9.0

shortlog of changes since v3.8.0:

* test/test_fresh.rb: fix breakage from Ruby-trunk r50118
* use monotonic clock if possible on Ruby 2.1+
* avoid defineclass instructions for empty classes
* HACKING: minor documentation updates
* mogilefs/socket/pure_ruby: use IO#wait_*able

8 years agomogilefs/socket/pure_ruby: use IO#wait_*able
Eric Wong [Wed, 24 Jun 2015 01:24:39 +0000 (24 01:24 +0000)]
mogilefs/socket/pure_ruby: use IO#wait_*able

IO#wait_*able methods may use the more efficient ppoll syscall under
Linux to avoid performance penalties with high-numbered FDs.  Use
them if available.  IO#wait_readable has been around since the 1.8
days at least, and IO#wait_writable was added in Ruby 2.0.0

8 years agoHACKING: minor documentation updates
Eric Wong [Wed, 24 Jun 2015 01:13:10 +0000 (24 01:13 +0000)]
HACKING: minor documentation updates

Remove old, out-of-date references and clarify that we use
email.

8 years agoavoid defineclass instructions for empty classes
Eric Wong [Thu, 28 May 2015 19:01:35 +0000 (28 19:01 +0000)]
avoid defineclass instructions for empty classes

This needlessly wastes bytecode and saves around 2K memory
on 64-bit platforms.

8 years agouse monotonic clock if possible on Ruby 2.1+
Eric Wong [Wed, 27 May 2015 21:59:31 +0000 (27 21:59 +0000)]
use monotonic clock if possible on Ruby 2.1+

The monotonic clock is immune to discontinuous time jumps while
still taking into account clock imperfections, making it appropriate
for calculating time differences and timeouts.

8 years agotest/test_fresh.rb: fix breakage from Ruby-trunk r50118
Eric Wong [Wed, 27 May 2015 21:33:03 +0000 (27 21:33 +0000)]
test/test_fresh.rb: fix breakage from Ruby-trunk r50118

IO.copy_stream behaves slightly differently when operating on
non-IO-subclassed objects nowadays.

Ref:
> * io.c (copy_stream_body): use the arguments without conversion if
>   having read, readpartial, and write methods, than conversion by
>   to_path method.  [ruby-core:68676] [Bug #11015]

9 years agoRuby mogilefs-client 3.8.0v3.8.0
Eric Wong [Tue, 10 Feb 2015 00:30:07 +0000 (10 00:30 +0000)]
Ruby mogilefs-client 3.8.0

Mostly documentation updates and test cleanups.  Nothing interesting
for the regular client, but the admin client now shows the
checksum-related fields in get_devices.

Most notably, there's a public-inbox for those who don't want
to subscribe to the MogileFS list:

mogilefs-client-public@bogomips.org

Archives are at: http://bogomips.org/mogilefs-client-public/

There is no new mailing list subscription, it is only a
public-inbox.  Cc-ing the MogileFS list at mogile@googlegroups.com
is encouraged if you do have a subscription.

shortlog since 3.7.1:

      add mog-sync example script
      admin (doc, get_hosts): display integers in results doc
      update documentation and packaging
      GNUmakefile: publish examples on the site, too
      examples: add usage_fetcher example
      TODO: remove Cool.io and EventMachine references
      admin: flesh out get_devices
      admin: reduce bytecode overhead of get_stats
      tests: create fresh intances for all integration tests
      include mogilefs/version.rb in the distro
      test: fixup object lifetimes and teardown
      new public-inbox: mogilefs-client-public@bogomips.org

9 years agonew public-inbox: mogilefs-client-public@bogomips.org
Eric Wong [Tue, 10 Feb 2015 00:16:17 +0000 (10 00:16 +0000)]
new public-inbox: mogilefs-client-public@bogomips.org

Probably not worth being a full-blown mailing list since
mogile@googlegroups.com exists, but it's nice to have a public place
where people can post without subscribing to anything.

9 years agotest: fixup object lifetimes and teardown
Eric Wong [Thu, 22 Jan 2015 04:08:34 +0000 (22 04:08 +0000)]
test: fixup object lifetimes and teardown

This should prevent stray processes from being leftover
after tests are run as well as cleaning up tmpdirs
more thoroughly.

9 years agoinclude mogilefs/version.rb in the distro
Eric Wong [Thu, 15 Jan 2015 01:10:51 +0000 (15 01:10 +0000)]
include mogilefs/version.rb in the distro

9 years agotests: create fresh intances for all integration tests
Eric Wong [Fri, 16 Jan 2015 03:09:09 +0000 (16 03:09 +0000)]
tests: create fresh intances for all integration tests

This should make it easier to fully test on machines without
access to an existing MogileFS instance.  You'll still
need mogilefsd and mogstored available, however, but these
tests are skipped on machines without them.

9 years agoadmin: reduce bytecode overhead of get_stats
Eric Wong [Fri, 16 Jan 2015 00:20:27 +0000 (16 00:20 +0000)]
admin: reduce bytecode overhead of get_stats

This is a deprecated call anyways and no longer supported
by modern versions of the server, so avoid wasting RAM with it.

We will remove this in 4.x

9 years agoadmin: flesh out get_devices
Eric Wong [Thu, 15 Jan 2015 23:54:16 +0000 (15 23:54 +0000)]
admin: flesh out get_devices

This adds the reject_bad_md5 and utilization fields.
While we're at it, be more explicit with mapping and
avoid creating an unnecessary hash.

9 years agoTODO: remove Cool.io and EventMachine references
Eric Wong [Wed, 14 Jan 2015 22:40:11 +0000 (14 22:40 +0000)]
TODO: remove Cool.io and EventMachine references

Cool.io is unmaintained and EM seems to be, too.

9 years agoexamples: add usage_fetcher example
Eric Wong [Wed, 14 Jan 2015 22:38:42 +0000 (14 22:38 +0000)]
examples: add usage_fetcher example

This was written a while ago for a large cluster, so I
figured I might as well include it here.

9 years agoGNUmakefile: publish examples on the site, too
Eric Wong [Wed, 14 Jan 2015 22:32:23 +0000 (14 22:32 +0000)]
GNUmakefile: publish examples on the site, too

9 years agoupdate documentation and packaging
Eric Wong [Wed, 14 Jan 2015 22:16:44 +0000 (14 22:16 +0000)]
update documentation and packaging

The documentation (and website) uses olddoc, now,
allowing faster load times and more consistent
user experience across different browsers, particularly
text-only ones.

The packaging is also updated to be consistent with
the rest of the projects I deal with.

9 years agoadmin (doc, get_hosts): display integers in results doc
Eric Wong [Wed, 16 Oct 2013 18:34:28 +0000 (16 18:34 +0000)]
admin (doc, get_hosts): display integers in results doc

Our code integerizes certain results nowadays, so update
the documentation to match.

9 years agoadd mog-sync example script
Eric Wong [Wed, 22 Oct 2014 06:08:07 +0000 (22 06:08 +0000)]
add mog-sync example script

This allows verbatim copying between two domains on different
(or the same) MogileFS instance.

It is idempotent and may be used like "rsync -a" for periodic
syncing.

It is also multi-threaded with configurable concurrency for
metadata vs file transfer checks.

Usage: mog-sync.rb SRC_TRACKER_LIST/SRC_DOMAIN DST_TRACKER_LIST/DST_DOMAIN

    -j, --metadata-jobs JOBS         Number of metadata jobs to run in parallel
    -J, --copy-jobs JOBS             Number of copy jobs to run in parallel
    -h, --help                       Show this help message.
        --get-file-data-timeout SECONDS
        --new-file-max-time SECONDS
        --fail-timeout SECONDS
        --timeout SECONDS
    -v, --verbose
    -d, --delete
    -n, --dry-run
    -p, --prefix STRING
        --src-class STRING
        --dst-class STRING
        --after STRING
        --max-size STRING
    -F, --clobber-missing-checksum

10 years agoRuby mogilefs-client 3.7.1v3.7.1
Eric Wong [Tue, 10 Sep 2013 23:28:48 +0000 (10 23:28 +0000)]
Ruby mogilefs-client 3.7.1

Only one bugfix:
  new_file/stream: correct declare errors array correctly

This only triggered on rare syscall errors
(Errno::EMFILE/Errno::ENFILE)

10 years agonew_file/stream: correct declare errors array correctly
Eric Wong [Tue, 10 Sep 2013 01:10:55 +0000 (10 01:10 +0000)]
new_file/stream: correct declare errors array correctly

This caused NameError failures when we ran out of file descriptors.

10 years agoRuby mogilefs-client 3.7.0v3.7.0
Eric Wong [Thu, 18 Jul 2013 06:37:51 +0000 (18 06:37 +0000)]
Ruby mogilefs-client 3.7.0

MogileFS::MogileFS#each_key now accepts optional :after and :limit args

This allows easy iteration while respecting :after and :limit,
giving each_key an interface consistent with each_file_info.

10 years agoclient: each_key: accept optional :after and :limit args
Eric Wong [Tue, 9 Jul 2013 22:48:43 +0000 (9 22:48 +0000)]
client: each_key: accept optional :after and :limit args

This allows easy iteration while respecting :after and :limit.
This gives each_key an interface consistent with each_file_info.

11 years agoRuby mogilefs-client 3.6.0v3.6.0
Eric Wong [Thu, 21 Feb 2013 20:07:11 +0000 (21 20:07 +0000)]
Ruby mogilefs-client 3.6.0

We no longer send an empty zone= parameter in create_open
calls.  Additionally, if we detect send() failure on a socket,
assume a tracker has been restarted and restart the request.
There are also some minor code cleanups.

11 years agomysql: remove warning for assigned but unused variable
Eric Wong [Thu, 21 Feb 2013 20:11:54 +0000 (21 20:11 +0000)]
mysql: remove warning for assigned but unused variable

Note: this mysql component is still largely unmaintained.

11 years agobackend: fix variable shadow warning
Eric Wong [Thu, 21 Feb 2013 20:10:43 +0000 (21 20:10 +0000)]
backend: fix variable shadow warning

This bug was only introduced in
commit 3c73f6b434a4c226c09e31c6ba3b034cb314b3fb

11 years agobackend: retry all trackers on send failure
Eric Wong [Tue, 5 Feb 2013 21:57:59 +0000 (5 21:57 +0000)]
backend: retry all trackers on send failure

In single tracker configurations, a restarted tracker may cause
send()/write() failure on the TCP socket.  Retry immediately in
this case, since there's no danger even for non-idempotent
tracker requests.

11 years agocreate_open: do not set empty zone= parameter
Eric Wong [Thu, 17 Jan 2013 03:55:23 +0000 (17 03:55 +0000)]
create_open: do not set empty zone= parameter

It's a small waste and adds to visual noise.

11 years agotest for size mismatch errors with IO.copy_stream
Eric Wong [Mon, 24 Dec 2012 20:20:00 +0000 (24 20:20 +0000)]
test for size mismatch errors with IO.copy_stream

IO.copy_stream does not raise EOFError when specified
copy length is less than input size.  Thus we must rely
on the MogileFS tracker to validate the input size.

11 years agomogilefs-client 3.5.0v3.5.0
Eric Wong [Tue, 4 Dec 2012 11:08:03 +0000 (4 11:08 +0000)]
mogilefs-client 3.5.0

client changes:

* new_file gains :create_open_args and :create_close_args which
  allows custom arguments to be passed to plugins.
  (this matches the Perl client behavior)

* new_file also gains :info hash which can be populated with
  information normally retrieved with file_info

* users with net-http-persistent installed will see a small speed
  boost and reduction of TIME_WAIT sockets when dealing with
  small data (useful for testing DB-intensive parts of MogileFS).

No changes for admin.

11 years agonew_file: don't pass private field to create_open
Eric Wong [Thu, 8 Nov 2012 02:43:38 +0000 (8 02:43 +0000)]
new_file: don't pass private field to create_open

Avoid needless encoding and data transfer to the tracker.

11 years agomogilefs-client 3.5.0-rc1v3.5.0-rc1
Eric Wong [Wed, 31 Oct 2012 19:49:47 +0000 (31 19:49 +0000)]
mogilefs-client 3.5.0-rc1

client changes:

* new_file gains :create_open_args and :create_close_args which
  allows custom arguments to be passed to plugins.

* new_file also gains :info hash which can be populated with
  information normally retrieved with file_info

* users with net-http-persistent installed will see a small speed
  boost and reduction of TIME_WAIT sockets when dealing with
  small data (useful for testing DB-intensive parts of MogileFS).

No changes for admin.

11 years agonet-http-persistent usage respects timeouts
Eric Wong [Wed, 31 Oct 2012 19:38:09 +0000 (31 19:38 +0000)]
net-http-persistent usage respects timeouts

We now have separate Net::HTTP::Persistent instances
between clients that may have different timeouts and
also between GET and PUT requests.  This hurts our
ability to reuse sockets, but correctness is probably
more important.

11 years agotest: fix some warnings found with "ruby -w -c"
Eric Wong [Wed, 31 Oct 2012 19:20:53 +0000 (31 19:20 +0000)]
test: fix some warnings found with "ruby -w -c"

Less noise should be better.

11 years agoavoid documenting internal constant (NHP)
Eric Wong [Wed, 31 Oct 2012 00:28:39 +0000 (31 00:28 +0000)]
avoid documenting internal constant (NHP)

Implementation details should remain private.

11 years agonew_file: support create_open_args and create_close_args
Eric Wong [Tue, 30 Oct 2012 23:12:10 +0000 (30 23:12 +0000)]
new_file: support create_open_args and create_close_args

This lets us send unsupported/new arguments to plugins
and matches the functionality of the Perl client library.

11 years agohttp_reader: improve robustness of header reading
Eric Wong [Tue, 30 Oct 2012 21:41:01 +0000 (30 21:41 +0000)]
http_reader: improve robustness of header reading

It's possible for networks and servers to break up
even small HTTP headers.  We also better enforce the
timeout if we too too long to write the request.

11 years agotest: remove assert_nothing_raised checks
Eric Wong [Wed, 24 Oct 2012 08:18:21 +0000 (24 08:18 +0000)]
test: remove assert_nothing_raised checks

Tests fail anyways on uncaught exceptions, so
assert_nothing_raised only makes it harder to debug the problem
by swallowing the backtrace.

11 years agonew_file: delay keepalive sockopts until read
Eric Wong [Wed, 24 Oct 2012 08:13:13 +0000 (24 08:13 +0000)]
new_file: delay keepalive sockopts until read

We don't need to set socket keepalive until we've successfully
written the request out and are awaiting a response.

11 years agooptionally use net-http-persistent for StringIO
Eric Wong [Wed, 24 Oct 2012 07:27:18 +0000 (24 07:27 +0000)]
optionally use net-http-persistent for StringIO

Given StringIO objects are already in memory, NHP can make
small uploads which fit into memory faster.  Large uploads
(using big_io or :largefile => :stream still go through
 IO.copy_stream for now)

11 years agonew_file allows optional :info hash to be populated
Eric Wong [Mon, 22 Oct 2012 20:18:06 +0000 (22 20:18 +0000)]
new_file allows optional :info hash to be populated

This allows clients to avoid calling #file_info or #get_uris
immediate after uploading a file to MogileFS.  This can speed
things up for cache-using clients with write-through caching.

11 years agoRuby mogilefs-client 3.4.0v3.4.0
Eric Wong [Tue, 9 Oct 2012 02:41:05 +0000 (9 02:41 +0000)]
Ruby mogilefs-client 3.4.0

Admin speedups for get_domains, get_hosts, and get_devices.
Previous versions were completely unusable for parsing a list of
3000+ domains.  Installations with thousands of hosts or devices
should see noticeable performance improvements.

The client interface gains the each_file_info iterator method.
This behaves like each_key, but gives access to the entire
response the file_info returns, including: checksum, devcount,
file size, class, and domain.

11 years agoclient: small speedup for list_keys_verbose
Eric Wong [Tue, 9 Oct 2012 00:24:43 +0000 (9 00:24 +0000)]
client: small speedup for list_keys_verbose

Array#pop is faster than Array#shift in most Ruby versions
as the latter may require memmove() of all elements.
Additionally, ensure ordering is correct if a backend
chokes up (for each_file_info, too).

11 years agoclient: add each_file_info iterator
Eric Wong [Mon, 8 Oct 2012 22:44:03 +0000 (8 22:44 +0000)]
client: add each_file_info iterator

This allows fast listing of keys and metadata (length,
checksum, devcount, class).

11 years agoadmin: get_devices returns observed_state again
Eric Wong [Mon, 8 Oct 2012 22:10:29 +0000 (8 15:10 -0700)]
admin: get_devices returns observed_state again

Blank observed_state (for dead devices) are mapped to nil.

11 years agoadmin: minor speedups for get_hosts, get_devices, list_fids
Eric Wong [Mon, 8 Oct 2012 20:11:47 +0000 (8 13:11 -0700)]
admin: minor speedups for get_hosts, get_devices, list_fids

By avoiding #grep, installations with thousands of hosts/devices
should be sped up considerably.  list_fids should be roughly
twice as fast.

This is a followup to commit a309f22f835afe0e6be0e4e2f1a13eaead7434f2