support multiple storage backends, including amazon s3 #999
Labels
No labels
c/code
c/code-dirnodes
c/code-encoding
c/code-frontend
c/code-frontend-cli
c/code-frontend-ftp-sftp
c/code-frontend-magic-folder
c/code-frontend-web
c/code-mutable
c/code-network
c/code-nodeadmin
c/code-peerselection
c/code-storage
c/contrib
c/dev-infrastructure
c/docs
c/operational
c/packaging
c/unknown
c/website
kw:2pc
kw:410
kw:9p
kw:ActivePerl
kw:AttributeError
kw:DataUnavailable
kw:DeadReferenceError
kw:DoS
kw:FileZilla
kw:GetLastError
kw:IFinishableConsumer
kw:K
kw:LeastAuthority
kw:Makefile
kw:RIStorageServer
kw:StringIO
kw:UncoordinatedWriteError
kw:about
kw:access
kw:access-control
kw:accessibility
kw:accounting
kw:accounting-crawler
kw:add-only
kw:aes
kw:aesthetics
kw:alias
kw:aliases
kw:aliens
kw:allmydata
kw:amazon
kw:ambient
kw:annotations
kw:anonymity
kw:anonymous
kw:anti-censorship
kw:api_auth_token
kw:appearance
kw:appname
kw:apport
kw:archive
kw:archlinux
kw:argparse
kw:arm
kw:assertion
kw:attachment
kw:auth
kw:authentication
kw:automation
kw:avahi
kw:availability
kw:aws
kw:azure
kw:backend
kw:backoff
kw:backup
kw:backupdb
kw:backward-compatibility
kw:bandwidth
kw:basedir
kw:bayes
kw:bbfreeze
kw:beta
kw:binaries
kw:binutils
kw:bitcoin
kw:bitrot
kw:blacklist
kw:blocker
kw:blocks-cloud-deployment
kw:blocks-cloud-merge
kw:blocks-magic-folder-merge
kw:blocks-merge
kw:blocks-raic
kw:blocks-release
kw:blog
kw:bom
kw:bonjour
kw:branch
kw:branding
kw:breadcrumbs
kw:brians-opinion-needed
kw:browser
kw:bsd
kw:build
kw:build-helpers
kw:buildbot
kw:builders
kw:buildslave
kw:buildslaves
kw:cache
kw:cap
kw:capleak
kw:captcha
kw:cast
kw:centos
kw:cffi
kw:chacha
kw:charset
kw:check
kw:checker
kw:chroot
kw:ci
kw:clean
kw:cleanup
kw:cli
kw:cloud
kw:cloud-backend
kw:cmdline
kw:code
kw:code-checks
kw:coding-standards
kw:coding-tools
kw:coding_tools
kw:collection
kw:compatibility
kw:completion
kw:compression
kw:confidentiality
kw:config
kw:configuration
kw:configuration.txt
kw:conflict
kw:connection
kw:connectivity
kw:consistency
kw:content
kw:control
kw:control.furl
kw:convergence
kw:coordination
kw:copyright
kw:corruption
kw:cors
kw:cost
kw:coverage
kw:coveralls
kw:coveralls.io
kw:cpu-watcher
kw:cpyext
kw:crash
kw:crawler
kw:crawlers
kw:create-container
kw:cruft
kw:crypto
kw:cryptography
kw:cryptography-lib
kw:cryptopp
kw:csp
kw:curl
kw:cutoff-date
kw:cycle
kw:cygwin
kw:d3
kw:daemon
kw:darcs
kw:darcsver
kw:database
kw:dataloss
kw:db
kw:dead-code
kw:deb
kw:debian
kw:debug
kw:deep-check
kw:defaults
kw:deferred
kw:delete
kw:deletion
kw:denial-of-service
kw:dependency
kw:deployment
kw:deprecation
kw:desert-island
kw:desert-island-build
kw:design
kw:design-review-needed
kw:detection
kw:dev-infrastructure
kw:devpay
kw:directory
kw:directory-page
kw:dirnode
kw:dirnodes
kw:disconnect
kw:discovery
kw:disk
kw:disk-backend
kw:distribute
kw:distutils
kw:dns
kw:do_http
kw:doc-needed
kw:docker
kw:docs
kw:docs-needed
kw:dokan
kw:dos
kw:download
kw:downloader
kw:dragonfly
kw:drop-upload
kw:duplicity
kw:dusty
kw:earth-dragon
kw:easy
kw:ec2
kw:ecdsa
kw:ed25519
kw:egg-needed
kw:eggs
kw:eliot
kw:email
kw:empty
kw:encoding
kw:endpoint
kw:enterprise
kw:enum34
kw:environment
kw:erasure
kw:erasure-coding
kw:error
kw:escaping
kw:etag
kw:etch
kw:evangelism
kw:eventual
kw:example
kw:excess-authority
kw:exec
kw:exocet
kw:expiration
kw:extensibility
kw:extension
kw:failure
kw:fedora
kw:ffp
kw:fhs
kw:figleaf
kw:file
kw:file-descriptor
kw:filename
kw:filesystem
kw:fileutil
kw:fips
kw:firewall
kw:first
kw:floatingpoint
kw:flog
kw:foolscap
kw:forward-compatibility
kw:forward-secrecy
kw:forwarding
kw:free
kw:freebsd
kw:frontend
kw:fsevents
kw:ftp
kw:ftpd
kw:full
kw:furl
kw:fuse
kw:garbage
kw:garbage-collection
kw:gateway
kw:gatherer
kw:gc
kw:gcc
kw:gentoo
kw:get
kw:git
kw:git-annex
kw:github
kw:glacier
kw:globalcaps
kw:glossary
kw:google-cloud-storage
kw:google-drive-backend
kw:gossip
kw:governance
kw:grid
kw:grid-manager
kw:gridid
kw:gridsync
kw:grsec
kw:gsoc
kw:gvfs
kw:hackfest
kw:hacktahoe
kw:hang
kw:hardlink
kw:heartbleed
kw:heisenbug
kw:help
kw:helper
kw:hint
kw:hooks
kw:how
kw:how-to
kw:howto
kw:hp
kw:hp-cloud
kw:html
kw:http
kw:https
kw:i18n
kw:i2p
kw:i2p-collab
kw:illustration
kw:image
kw:immutable
kw:impressions
kw:incentives
kw:incident
kw:init
kw:inlineCallbacks
kw:inotify
kw:install
kw:installer
kw:integration
kw:integration-test
kw:integrity
kw:interactive
kw:interface
kw:interfaces
kw:interoperability
kw:interstellar-exploration
kw:introducer
kw:introduction
kw:iphone
kw:ipkg
kw:iputil
kw:ipv6
kw:irc
kw:jail
kw:javascript
kw:joke
kw:jquery
kw:json
kw:jsui
kw:junk
kw:key-value-store
kw:kfreebsd
kw:known-issue
kw:konqueror
kw:kpreid
kw:kvm
kw:l10n
kw:lae
kw:large
kw:latency
kw:leak
kw:leasedb
kw:leases
kw:libgmp
kw:license
kw:licenss
kw:linecount
kw:link
kw:linux
kw:lit
kw:localhost
kw:location
kw:locking
kw:logging
kw:logo
kw:loopback
kw:lucid
kw:mac
kw:macintosh
kw:magic-folder
kw:manhole
kw:manifest
kw:manual-test-needed
kw:map
kw:mapupdate
kw:max_space
kw:mdmf
kw:memcheck
kw:memory
kw:memory-leak
kw:mesh
kw:metadata
kw:meter
kw:migration
kw:mime
kw:mingw
kw:minimal
kw:misc
kw:miscapture
kw:mlp
kw:mock
kw:more-info-needed
kw:mountain-lion
kw:move
kw:multi-users
kw:multiple
kw:multiuser-gateway
kw:munin
kw:music
kw:mutability
kw:mutable
kw:mystery
kw:names
kw:naming
kw:nas
kw:navigation
kw:needs-review
kw:needs-spawn
kw:netbsd
kw:network
kw:nevow
kw:new-user
kw:newcaps
kw:news
kw:news-done
kw:news-needed
kw:newsletter
kw:newurls
kw:nfc
kw:nginx
kw:nixos
kw:no-clobber
kw:node
kw:node-url
kw:notification
kw:notifyOnDisconnect
kw:nsa310
kw:nsa320
kw:nsa325
kw:numpy
kw:objects
kw:old
kw:openbsd
kw:openitp-packaging
kw:openssl
kw:openstack
kw:opensuse
kw:operation-helpers
kw:operational
kw:operations
kw:ophandle
kw:ophandles
kw:ops
kw:optimization
kw:optional
kw:options
kw:organization
kw:os
kw:os.abort
kw:ostrom
kw:osx
kw:osxfuse
kw:otf-magic-folder-objective1
kw:otf-magic-folder-objective2
kw:otf-magic-folder-objective3
kw:otf-magic-folder-objective4
kw:otf-magic-folder-objective5
kw:otf-magic-folder-objective6
kw:p2p
kw:packaging
kw:partial
kw:password
kw:path
kw:paths
kw:pause
kw:peer-selection
kw:performance
kw:permalink
kw:permissions
kw:persistence
kw:phone
kw:pickle
kw:pip
kw:pipermail
kw:pkg_resources
kw:placement
kw:planning
kw:policy
kw:port
kw:portability
kw:portal
kw:posthook
kw:pratchett
kw:preformance
kw:preservation
kw:privacy
kw:process
kw:profile
kw:profiling
kw:progress
kw:proxy
kw:publish
kw:pyOpenSSL
kw:pyasn1
kw:pycparser
kw:pycrypto
kw:pycrypto-lib
kw:pycryptopp
kw:pyfilesystem
kw:pyflakes
kw:pylint
kw:pypi
kw:pypy
kw:pysqlite
kw:python
kw:python3
kw:pythonpath
kw:pyutil
kw:pywin32
kw:quickstart
kw:quiet
kw:quotas
kw:quoting
kw:raic
kw:rainhill
kw:random
kw:random-access
kw:range
kw:raspberry-pi
kw:reactor
kw:readonly
kw:rebalancing
kw:recovery
kw:recursive
kw:redhat
kw:redirect
kw:redressing
kw:refactor
kw:referer
kw:referrer
kw:regression
kw:rekey
kw:relay
kw:release
kw:release-blocker
kw:reliability
kw:relnotes
kw:remote
kw:removable
kw:removable-disk
kw:rename
kw:renew
kw:repair
kw:replace
kw:report
kw:repository
kw:research
kw:reserved_space
kw:response-needed
kw:response-time
kw:restore
kw:retrieve
kw:retry
kw:review
kw:review-needed
kw:reviewed
kw:revocation
kw:roadmap
kw:rollback
kw:rpm
kw:rsa
kw:rss
kw:rst
kw:rsync
kw:rusty
kw:s3
kw:s3-backend
kw:s3-frontend
kw:s4
kw:same-origin
kw:sandbox
kw:scalability
kw:scaling
kw:scheduling
kw:schema
kw:scheme
kw:scp
kw:scripts
kw:sdist
kw:sdmf
kw:security
kw:self-contained
kw:server
kw:servermap
kw:servers-of-happiness
kw:service
kw:setup
kw:setup.py
kw:setup_requires
kw:setuptools
kw:setuptools_darcs
kw:sftp
kw:shared
kw:shareset
kw:shell
kw:signals
kw:simultaneous
kw:six
kw:size
kw:slackware
kw:slashes
kw:smb
kw:sneakernet
kw:snowleopard
kw:socket
kw:solaris
kw:space
kw:space-efficiency
kw:spam
kw:spec
kw:speed
kw:sqlite
kw:ssh
kw:ssh-keygen
kw:sshfs
kw:ssl
kw:stability
kw:standards
kw:start
kw:startup
kw:static
kw:static-analysis
kw:statistics
kw:stats
kw:stats_gatherer
kw:status
kw:stdeb
kw:storage
kw:streaming
kw:strports
kw:style
kw:stylesheet
kw:subprocess
kw:sumo
kw:survey
kw:svg
kw:symlink
kw:synchronous
kw:tac
kw:tahoe-*
kw:tahoe-add-alias
kw:tahoe-admin
kw:tahoe-archive
kw:tahoe-backup
kw:tahoe-check
kw:tahoe-cp
kw:tahoe-create-alias
kw:tahoe-create-introducer
kw:tahoe-debug
kw:tahoe-deep-check
kw:tahoe-deepcheck
kw:tahoe-lafs-trac-stream
kw:tahoe-list-aliases
kw:tahoe-ls
kw:tahoe-magic-folder
kw:tahoe-manifest
kw:tahoe-mkdir
kw:tahoe-mount
kw:tahoe-mv
kw:tahoe-put
kw:tahoe-restart
kw:tahoe-rm
kw:tahoe-run
kw:tahoe-start
kw:tahoe-stats
kw:tahoe-unlink
kw:tahoe-webopen
kw:tahoe.css
kw:tahoe_files
kw:tahoewapi
kw:tarball
kw:tarballs
kw:tempfile
kw:templates
kw:terminology
kw:test
kw:test-and-set
kw:test-from-egg
kw:test-needed
kw:testgrid
kw:testing
kw:tests
kw:throttling
kw:ticket999-s3-backend
kw:tiddly
kw:time
kw:timeout
kw:timing
kw:to
kw:to-be-closed-on-2011-08-01
kw:tor
kw:tor-protocol
kw:torsocks
kw:tox
kw:trac
kw:transparency
kw:travis
kw:travis-ci
kw:trial
kw:trickle
kw:trivial
kw:truckee
kw:tub
kw:tub.location
kw:twine
kw:twistd
kw:twistd.log
kw:twisted
kw:twisted-14
kw:twisted-trial
kw:twitter
kw:twn
kw:txaws
kw:type
kw:typeerror
kw:ubuntu
kw:ucwe
kw:ueb
kw:ui
kw:unclean
kw:uncoordinated-writes
kw:undeletable
kw:unfinished-business
kw:unhandled-error
kw:unhappy
kw:unicode
kw:unit
kw:unix
kw:unlink
kw:update
kw:upgrade
kw:upload
kw:upload-helper
kw:uri
kw:url
kw:usability
kw:use-case
kw:utf-8
kw:util
kw:uwsgi
kw:ux
kw:validation
kw:variables
kw:vdrive
kw:verify
kw:verlib
kw:version
kw:versioning
kw:versions
kw:video
kw:virtualbox
kw:virtualenv
kw:vista
kw:visualization
kw:visualizer
kw:vm
kw:volunteergrid2
kw:volunteers
kw:vpn
kw:wapi
kw:warners-opinion-needed
kw:warning
kw:weapi
kw:web
kw:web.port
kw:webapi
kw:webdav
kw:webdrive
kw:webport
kw:websec
kw:website
kw:websocket
kw:welcome
kw:welcome-page
kw:welcomepage
kw:wiki
kw:win32
kw:win64
kw:windows
kw:windows-related
kw:winscp
kw:workaround
kw:world-domination
kw:wrapper
kw:write-enabler
kw:wui
kw:x86
kw:x86-64
kw:xhtml
kw:xml
kw:xss
kw:zbase32
kw:zetuptoolz
kw:zfec
kw:zookos-opinion-needed
kw:zope
kw:zope.interface
p/blocker
p/critical
p/major
p/minor
p/normal
p/supercritical
p/trivial
r/cannot reproduce
r/duplicate
r/fixed
r/invalid
r/somebody else's problem
r/was already fixed
r/wontfix
r/worksforme
t/defect
t/enhancement
t/task
v/0.2.0
v/0.3.0
v/0.4.0
v/0.5.0
v/0.5.1
v/0.6.0
v/0.6.1
v/0.7.0
v/0.8.0
v/0.9.0
v/1.0.0
v/1.1.0
v/1.10.0
v/1.10.1
v/1.10.2
v/1.10a2
v/1.11.0
v/1.12.0
v/1.12.1
v/1.13.0
v/1.14.0
v/1.15.0
v/1.15.1
v/1.2.0
v/1.3.0
v/1.4.1
v/1.5.0
v/1.6.0
v/1.6.1
v/1.7.0
v/1.7.1
v/1.7β
v/1.8.0
v/1.8.1
v/1.8.2
v/1.8.3
v/1.8β
v/1.9.0
v/1.9.0-s3branch
v/1.9.0a1
v/1.9.0a2
v/1.9.0b1
v/1.9.1
v/1.9.2
v/1.9.2a1
v/cloud-branch
v/unknown
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: tahoe-lafs/trac#999
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The focus of this ticket is (now) adapting the existing codebase to use multiple backends, rather than supporting any particular backend.
We already have one backend -- the filesystem backend -- which I think should be a plugin in the same sense that the others will be plugins (i.e.: other code in tahoe-lafs can interact with a filesystem plugin without caring very much about how or where it is storing its files -- otherwise it doesn't seem very extensible). If you accept this, then we'd need to figure out what a backend plugin should look like.
There is backend-independent logic in the current server implementation that we wouldn't want to duplicate in every other backend implementation. To address this, we could start by refactoring the existing code that reads or writes shares on disk, to use a local backend implementation supporting an IStorageProvider interface (probably a fairly simplistic filesystem-ish API).
(This involves changing the code in source:src/allmydata/storage/server.py that reads from local disk in its [_iter_share_files()]source:src/allmydata/storage/server.py@4164#L359 method, and also changing [storage/shares.py]source:src/allmydata/storage/shares.py@3762, [storage/immutable.py]source:src/allmydata/storage/immutable.py@3871#L39, and [storage/mutable.py]source:src/allmydata/storage/mutable.py@3815#L34 that write shares to local disk.)
At this point all the existing tests should still pass, since we haven't actually changed the behaviour.
Then we have to add the ability to configure new storage providers. This involves figuring out how to map user configuration choices to what actually happens when a node is started, and how the credentials needed to log into a particular storage backend should be specified. The skeletal RIStorageServer would instantiate its IStorageProvider based on what the user configured, and use it to write/read data, get statistics, and so on.
Naturally, all of this would require a decent amount of documentation and testing, too.
Once we have all of this worked out, the rest of this project (probably to be handled in other tickets) would be identifying what other backends we'd want in tahoe-lafs, then documenting, implementing, and testing them. We already have Amazon S3 and Rackspace as targets -- users of tahoe-lafs will probably have their own suggestions, and more backends will come up with more research.
See the RAIC diagram.
(this is an email I sent to zooko a while ago with my thoughts on how this should be implemented:)
First, I'll summarize, to make sure that I understand what you had in
mind. Please correct me if you disagree with any of this.
The "redundant array of inexpensive clouds" idea means extending the
current storage server in tahoe-lafs to support storage backends that
aren't what we have now (writing shares to the local filesystem). Well
actually, the redundant array of inexpensive clouds idea means doing
that, then implementing plugins for popular existing cloud storage
services -- Amazon S3 and Rackspace are two that you've mentioned, but
there are probably others (if we end up going through with this, I'll
probably email tahoe-dev so I can get an idea of what else is out
there/what else people want to see supported, in addition to my own
research).
The benefit (or at least the benefit that seems clear to me from your
explanation -- perhaps there are others that are more obvious if you run
a big tahoe-lafs installation like allmydata.com, or if you're more
familiar with tahoe-lafs than I am) is decoupling the ability of a
tahoe-lafs node to store files from its physical filesystem. So if, say,
allmydata.com were to start running tahoe-lafs nodes using S3 as a
backend, and their grid was filled, they could create more space on the
grid by buying more S3 buckets, rather than upgrading physical servers
or adding new servers (I've never used S3, but I would bet that it is
easier to buy more S3 buckets than to upgrade servers). Or, if you
wanted to create a grid without purchasing a bunch of servers, you could
run a bunch of nodes on one machine (I was thinking vmware images, but
then I started wondering whether it was even necessary to have that
level of separation between tahoe-lafs nodes -- is it? but that's not
really on topic), each mapping to a different S3 bucket or buckets.
Am I missing anything (aside from more examples)?
It seems like -- at least for S3 -- you could already sort of do this.
There are projects like s3fs, which provide a FUSE interface to an
S3 bucket (though the last file for it is more than a year old. it
seems like there should be other projects like that, though) (edit: this is actually wrong -- I just hadn't found the Google code project, which is at http://code.google.com/p/s3fs/). Using
that, you could mount your S3 bucket somewhere in the filesystem of your
server, then kajigger the basedir of the tahoe-lafs node so that it
rests in that area of the filesystem, or otherwise configure the
tahoe-lafs node to save files there. This requires more work than what
we'd eventually want with "redundant array of inexpensive clouds", of
course, and (depending on how well FUSE or other S3 interfaces play) may
only work on tahoe-lafs nodes running one unix or other, but if an
operator got it working, it seems like they'd have most of the benefit
outlined above without any further work on my/our part.
(not that I mind working on this, of course, but I figured it would be
worthwhile to mention that)
In any case, I think implementing this would come down to two basic parts.
The first part would be adapting the existing codebase to use multiple
backends.
We already have one backend -- the filesystem backend -- which I think
should be a plugin in the same sense that the others will be plugins
(i.e.: other code in tahoe-lafs can interact with a filesystem plugin
without caring very much about how or where it is storing its files --
otherwise it doesn't seem very extensible). If you accept this, then
we'd need to figure out what a backend plugin should look like. Maybe we
can make each plugin implement RIStorageServer, and leave it at that.
Then we might not need to do very much work on the existing server to
make it work with the rest of the (new) system. However, it's possible
that there is backend-independent logic in the current server
implementation that we wouldn't want to duplicate in every other backend
implementation. To address this, we could instead make a sort of
backend-agnostic storage server that implements RIStorageServer, then
make another interface for backends to implement, say IStorageProvider.
The skeletal RIStorageServer would instantiate its IStorageProvider
based on what the user configured, and use it to write/read data, get
statistics, and so on. Then IStorageProvider would be a fairly
simplistic filesystem-ish API.
The other part of preparation would be figuring out how to map user
configuration choices to what actually happens when a node is started.
Also, we'd want to figure out how (if?) we need to do anything special
with the credentials that users might need to log in to their storage
backend. I'll have a better idea of how I'd implement this once I look
at the way it works for other things that users configure.
Naturally, all of this would require a decent amount of documentation
and testing, too.
(I'm open to other ideas, of course -- these are just what came to my mind)
Once we have all of this worked out, the rest of this project would be
identifying what other backends we'd want in tahoe-lafs, then
documenting, implementing, and testing those. We already have Amazon S3
and Rackspace as targets -- users of tahoe-lafs will probably have their
own suggestions, and more backends will come up with more research.
Generalizing this to include support for multiple backends (since I don't think we want to do it in a way that would only support S3 and local disk).
amazon s3 backendto support multiple storage backends, including amazon s3fix typo
Update description to reflect kevan's suggested approach.
Attachment storagemocktest01.darcs.patch (6013 bytes) added
Attachment sservertests.darcs.patch (9054 bytes) added
Here is an incomplete patch for others (arc) to look at or improve.
Attachment for-arctic.darcs.patch (28992 bytes) added
Attachment for-arctic-2.darcs.patch (630265 bytes) added
Attachment workingonbackend01.darcs.patch (46623 bytes) added
Implements tests of read and write for the nullbackend
Attachment snapshotofbackendimplementation.darcs.patch (96411 bytes) added
just so I don't lose it all...
Attachment checkpoint3.darcs.patch (99326 bytes) added
another checkpoint
Attachment checkpoint4.darcs.patch (111935 bytes) added
Attachment checkpoint5.darcs.patch (124608 bytes) added
more precise tests in TestServerFSBackend
Attachment checkpoint6.darcs.patch (130227 bytes) added
backing myself up, some comments cleaned in interfaces, new tests in test_backends
Attachment checkpoint7.darcs.patch (130662 bytes) added
tiny change, now tests that allocated returns correct value
Attachment checkpoint8.darcs.patch (132043 bytes) added
The null backend test is useful for testing what happens when there's no effective limit on the backend
Attachment checkpoint9.darcs.patch (140783 bytes) added
checkpoint 9
Attachment checkpoint10.darcs.patch (144949 bytes) added
Completed coverage of remote_allocate_buckets
Attachment checkpoint11.darcs.patch (152965 bytes) added
(JACP) Just Another CheckPoint
Attachment consistentifysi.darcs.patch (161829 bytes) added
all storage_index (word tokens) to storageindex in storage/server.py
Attachment checkpoint12.darcs.patch (170830 bytes) added
no longer trying to mock FS in TestServerFSBackend
Attachment jacp13.darcs.patch (192631 bytes) added
Attachment jacp14.darcs.patch (205520 bytes) added
Attachment jacp15.darcs.patch (210813 bytes) added
I'll review this.
Attachment work-in-progress-on-tests-from-pair-programming-with-Zancas.darcs.patch (227416 bytes) added
Attachment work-in-progress-2011-07-14_21_23.darcs.patch (235017 bytes) added
Attachment work-in-progress-2011-07-15_19_15.darcs.patch (255454 bytes) added
Attachment work-in-progress-2011-07-20_06_05Z.darcs.patch (283324 bytes) added
Before going much further in relying on
twisted.python.filepath.FilePath
, can we think about the Unicode issue raised in ticket:1437#comment:377287? Currently, storage directories with Unicode paths are intended to be supported on Windows.Replying to davidsarah:
Replying to [arch_o_median]comment:13:
http://twistedmatrix.com/trac/ticket/2366
Replying to [arch_o_median]comment:14:
(Is replying to myself bad form?) OK so I can't tell how 2366 is (or is not resolved) should I get a twisted login so I can ask about it on that ticket... I await direction.
I did some investigation about non-ASCII filename handling in filepath and in Tahoe-LAFS and posted my notes on Twisted #5203.
Attachment jacp16Zancas20110722.darcs.patch (301848 bytes) added
Attachment jacp17Zancas20110723.darcs.patch (309840 bytes) added
Attachment jacp18Zancas20110723.darcs.patch (321159 bytes) added
After some chatting with zooko and warner in IRC, I've tentatively decided to use composition to inform the base Crawler object about the backend it is associated with. I'm not sure, but I think passing the whole Core object might be appropriate.
Attachment jacp19Zancas20110727.darcs.patch (347272 bytes) added
Attachment jacp20Zancas20110728.darcs.patch (358454 bytes) added
I'm confused about leases. When I look at the constructor for an immutable share file in a 'pristine' repository, (or in my latest version for that matter) I see that in the "create" clause of the constructor a python string representation of a big endian '0' is used for the number of leases.
http://tahoe-lafs.org/trac/tahoe-lafs/browser/trunk/src/allmydata/storage/immutable.py#L63
This is confusing because in my test vector data (created some time ago) I have '1' as the initial number of leases. My guess is that I somehow got a bum test-vector value, but it'd be nice to hear from an architect that immutable share files really should start life with '0' leases!
Attachment FinishFPWRTest_Zancas20110728.darcs.patch (375575 bytes) added
Patch passes allmydata.test.test_backends.TestServerAndFSBackend.test_write_and_read_share
Cool! Will review.
Attachment readoldshpasses_Zancas20110729.darcs.patch (380678 bytes) added
TestServerAndFSBackend.test_read_old_share passes
Attachment TestServerandFSBackPasses_Zancas20110729.darcs.patch (392691 bytes) added
TestServerAndFSBackend passes all (3) tests
Attachment test_backendpasses_Zancas20110729.darcs.patch (399923 bytes) added
5 test_backend tests pass
Attachment JACP20_Zancas20110801.darcs.patch (414808 bytes) added
uggg... bugs...
Attachment jacp22_test_backendpasses_Zancas20110802.darcs.patch (425317 bytes) added
the 5 tests pass... so what?
Ticket 1465 more succinctly organizes the same code contained in these patches.
Attachment backends-configuration-docs.darcs.patch (172619 bytes) added
I added attachment:backends-configuration-docs.darcs.patch which contains documentation of the configuration options for the backends feature. I like Brian Warner's approach to development where he writes the docs first, even before the tests. (He writes tests second.) I encourage anyone working on this ticket to read (and possibly improve/fix/extend) these docs!
Review of attachment:backends-configuration-docs.darcs.patch:
s3.rst
:Add a short introduction saying what S3 is and why anyone might want to use it.
It's a bit inconsistent that the value of the backend option is uppercase "S3", but the other option names are lowercase "s3_". Also, I would make it "s3.", since that's similar to the use of "." to group other related options.
Should the
s3_url
option include the scheme name, i.e. defaulting tohttp://s3.amazonaws.com
? We might want to support https in future (although there would be more to configure if we check certificates).In the description of
s3_max_space
, copy the paragraph starting "This string contains a number" fromdisk.rst
rather than referring to it."enabling ``s3_max_space`` causes an extra S3 usage query to be sent for each share upload, causing the upload process to run slightly slower and incur more S3 request charges."
disk.rst
:"Storing Shares in local filesystem" -> "Storing Shares on a Local Filesystem"
use
backend = disk
, notbackend = local filesystem
, and say that it is the default.configuration.rst
:"Clients will be unaware of what backend is used by the server." -> "Clients need not be aware of which backend is used by a server."
"including how to limit the space that will be consumed" -> "including how to reserve a minimum amount of free space"
I closed the subsidiary ticket #1465 as "fixed". The current patch set for this ticket as of this writing is [attachment:20110829passespyflakes.darcs.patch]attachment:20110829passespyflakes.darcs.patch🎫1465 (from that ticket) plus attachment:backends-configuration-docs.darcs.patch.
Attachment pluggable-backends-davidsarah.darcs.patch (213441 bytes) added
This is just a "flat" recording of my refactoring of pluggable backends. I'll do a better recording tomorrow, and explain the refactoring.
Attachment pluggable-backends-davidsarah-v2.darcs.patch (305880 bytes) added
This is still just a flat recording (a lot more changes to tests were needed than I anticipated).
Attachment pluggable-backends-davidsarah-v3.darcs.patch (346554 bytes) added
Bleeding edge pluggable backends code from David-Sarah. refs #999
Attachment pluggable-backends-davidsarah-v4.darcs.patch (295378 bytes) added
Rerecording of pluggable-backends-davidsarah-v3.darcs.patch that should fix the darcs performance problem when applied to trunk.
Attachment pluggable-backends-davidsarah-v5.darcs.patch (315537 bytes) added
Work-in-progress, includes fix to bug involving BucketWriter. refs #999
Replying to davidsarah:
Attachment backends-configuration-docs-v2.darcs.patch (24325 bytes) added
docs: document the configuration options for the new backends scheme. This takes into account /tahoe-lafs/trac/issues/26943#comment:-1 and is rerecorded to avoid darcs context problems.
Replying to [zancas]comment:28:
They are? I don't think so. How would they find out about the backend type?
attachment:backends-configuration-docs-v2.darcs.patch looks good to me. One thing I would change is to remove the "Issues" section about the costs of querying S3 objects and the effects on our crawler/lease-renewal scheme. I'm not sure that this branch will eventually land without a lease-checker implemented, so that part is making a statement that might be wrong. Also I'm not really sure the costs of querying S3 objects are worth mentioning. The current S3 pricing has 10,000 GET requests for $0.01. Let's remove that documentation for now and add in documentation when we understand better what the actual limitations or costs will be.
Replying to [zancas]comment:28:
The doc meant that client nodes need not be aware of backend type. Although the current hack to wire up a StorageServer to a backend in attachment:pluggable-backends-davidsarah-v5.darcs.patch is in allmydata/client.py, that code isn't actually run by clients, it is run only when setting up a storage server.
Replying to [davidsarah]comment:31:
Ugh, I should never use the term "node" :-/. I meant the code that acts as a storage protocol client.
Attachment pluggable-backends-davidsarah-v6.darcs.patch (329873 bytes) added
v6. Tests are looking in much better shape now -- still some problems with path vs FilePath and other stale assumptions in the test framework, but the disk backend basically works now.
Attachment trace-exceptions-option.darcs.patch (19736 bytes) added
Add --trace-exceptions option to trace raised exceptions on stderr. refs #999
Attachment pluggable-backends-davidsarah-v7.darcs.patch (368250 bytes) added
Latest snapshot, more tests passing.
Attachment snapshot-backend-config-parse.patch (6145 bytes) added
snapshot of work in progress
Attachment pluggable-backends-davidsarah-v8.darcs.patch (384096 bytes) added
v8 snapshot. More tests pass.
Attachment pluggable-backends-davidsarah-v9.darcs.patch (420760 bytes) added
Still more test fixes.
Josh wrote, re: attachment:pluggable-backends-davidsarah-v8.darcs.patch:
No,
load_state
usespickle.loads(self.statefp.getContent())
which is correct. The state handling is a red herring for the test_crawlers failure, I think.In v9,
allmydata.test.test_storage.LeaseCrawler.test_basic
is hanging due to an infinite recursion in pickle.py. Use(with attachment:trace-exceptions-option.darcs.patch applied) to see the recursion. I'm on the case...
Replying to davidsarah:
That was another red herring; there was an innocuous exception in pickle.py that was happening in each iteration of whatever other code is livelocking.
Attachment pluggable-backends-davidsarah-v10.darcs.patch (435928 bytes) added
Fix most of the crawler tests. Reinstate the cancel_lease methods of ImmutableDiskShare and MutableDiskShare, since they are needed for lease expiry. refs #999
Attachment pluggable-backends-davidsarah-v11.darcs.patch (498823 bytes) added
Includes a fix for iterating over a dict while removing entries from it in mutable/publish.py, some cosmetic changes, and a start on the S3 backend.
Attachment pluggable-backends-davidsarah-v12.darcs.patch (528987 bytes) added
Updates to null and S3 backends.
Attachment passtest_status_bad_disk_stats.darcs.patch (512142 bytes) added
contains changes in v12
Attachment pluggable-backends-davidsarah-v13.darcs.patch (555578 bytes) added
Includes fixes to test_status_bad_disk_stats and test_no_st_blocks in test_storage.py, and more work on the S3 backend.
Attachment pluggable-backends-davidsarah-v14.darcs.patch (602336 bytes) added
Work in progress for asyncifying the backend interface (necessary to call txaws methods that return Deferreds). This is incomplete so lots of tests fail. refs #999
In v13,
test_storage.LeaseCrawler.test_share_corruption
fails. However this is a test that is known to have race conditions -- it used to fail when logging was enabled (#923), and we tried to fix that in changeset:3b1b0147a867759c, but in a way that in retrospect didn't really address the cause of the race condition. The problem is that it's trying to check for a particular instantaneous state of the lease crawler while it is running, which is inherently race-prone.I suggest we not worry about this test for the current LAE iteration.
Attachment pluggable-backends-davidsarah-v13a.darcs.patch (544869 bytes) added
This does not include the asyncification changes from v14, but does include a couple of fixes for failures in test_system.
Attachment pluggable-backends-davidsarah-v15.darcs.patch (703824 bytes) added
bleeding edge of asyncification work
0 /home/arc/sandbox/working 550 $ darcs apply pluggable-backends-davidsarah-v15.darcs.patch
darcs failed: Bad patch bundle!
2 /home/arc/sandbox/working 551 $
Attachment pluggable-backends-davidsarah-v16.darcs.patch (841151 bytes) added
Latest asyncified patch. About 90% of tests pass.
Attachment s3-v13a-to-v16.diff (26727 bytes) added
Differences, just in the S3 backend, between v13a and v16.
Attachment split_s3share_classes_and_prune_unused_methods.diff (10735 bytes) added
Attachment split_s3share_classes_and_prune_unused_methods.dpatch (20675 bytes) added
Attachment configure-backends-incomplete.dpatch (26608 bytes) added
Attachment pluggable-backends-davidsarah-v17.darcs.patch (861252 bytes) added
Completes the splitting of IStoredShare into IShareForReading and IShareForWriting. Does not include configuration changes.
Attachment test_backends.py (7734 bytes) added
Snapshot of test_backends.py in David-Sarah's tree
Attachment pluggable-backends-davidsarah-v18.darcs.patch (879876 bytes) added
Includes backend configuration (rerecorded from zooko's patch), and other minor fixes.
Attachment asyncify-tests.dpatch (13774 bytes) added
Attachment pluggable-backends-davidsarah-v19.darcs.patch (919584 bytes) added
Include missing files for real and mock S3 backends. Also some fixes to tests, scripts/debug.py, and config parsing.
In [5373/ticket999-S3-backend]:
In [5374/ticket999-S3-backend]:
In [5375/ticket999-S3-backend]:
In [5376/ticket999-S3-backend]:
In [5379/ticket999-S3-backend]:
In [5380/ticket999-S3-backend]:
In [5382/ticket999-S3-backend]:
Attachment debug-mutable-hash-validation-failure.dpatch (35380 bytes) added
In [5387/ticket999-S3-backend]:
In [5388/ticket999-S3-backend]:
In [5391/ticket999-S3-backend]:
In [5392/ticket999-S3-backend]:
Attachment pluggable-backends-davidsarah-v20.darcs.patch (1101695 bytes) added
Fix various bugs and tests. v20
Re: attachment:pluggable-backends-davidsarah-v20.darcs.patch, I made a mistake in recording it that will cause a conflict with the ticket999-S3-backend branch. I'll attach a fixed version.
In [5400/ticket999-S3-backend]:
In [5402/ticket999-S3-backend]:
In [5403/ticket999-S3-backend]:
In [5404/ticket999-S3-backend]:
In [5405/ticket999-S3-backend]:
In [5406/ticket999-S3-backend]:
In [5407/ticket999-S3-backend]:
In [5408/ticket999-S3-backend]:
In [5409/ticket999-S3-backend]:
In [5410/ticket999-S3-backend]:
In [5411/ticket999-S3-backend]:
In [5412/ticket999-S3-backend]:
In [5414/ticket999-S3-backend]:
Please ignore attachment:pluggable-backends-davidsarah-v20.darcs.patch; the equivalent of that patch is on the ticket999-S3-backend branch now.
In [5415/ticket999-S3-backend]:
[5415/ticket999-S3-backend] fixes all but one of the tests in
test_mutable.py
.In [5416/ticket999-S3-backend]:
In [5417/ticket999-S3-backend]:
In [5419/ticket999-S3-backend]:
In [5421/ticket999-S3-backend]:
In [5422/ticket999-S3-backend]:
In [5423/ticket999-S3-backend]:
In [5424/ticket999-S3-backend]:
In [5425/ticket999-S3-backend]:
In [5426/ticket999-S3-backend]:
In [5427/ticket999-S3-backend]:
In [5429/ticket999-S3-backend]:
In [5430/ticket999-S3-backend]:
In [5431/ticket999-S3-backend]:
In [5432/ticket999-S3-backend]:
In [5433/ticket999-S3-backend]:
In [5434/ticket999-S3-backend]:
In [5445/ticket999-S3-backend]:
In [5446/ticket999-S3-backend]:
In [5447/ticket999-S3-backend]:
In [5448/ticket999-S3-backend]:
In [5449/ticket999-S3-backend]:
In [5450/ticket999-S3-backend]:
In [5451/ticket999-S3-backend]:
In [5452/ticket999-S3-backend]:
In [5453/ticket999-S3-backend]:
In [5454/ticket999-S3-backend]:
In [5455/ticket999-S3-backend]:
In [5456/ticket999-S3-backend]:
In [5457/ticket999-S3-backend]:
In [5458/ticket999-S3-backend]:
In [5459/ticket999-S3-backend]:
In [5461/ticket999-S3-backend]:
In [5462/ticket999-S3-backend]:
In [5463/ticket999-S3-backend]:
In [5464/ticket999-S3-backend]:
In [5465/ticket999-S3-backend]:
In [5466/ticket999-S3-backend]:
In [5467/ticket999-S3-backend]:
In [5468/ticket999-S3-backend]:
In [5469/ticket999-S3-backend]:
In [5470/ticket999-S3-backend]:
In [5471/ticket999-S3-backend]:
In [5472/ticket999-S3-backend]:
In [5473/ticket999-S3-backend]:
In [5474/ticket999-S3-backend]:
In [5475/ticket999-S3-backend]:
In [5476/ticket999-S3-backend]:
In [5477/ticket999-S3-backend]:
In [5478/ticket999-S3-backend]:
In [5479/ticket999-S3-backend]:
In [5480/ticket999-S3-backend]:
In [5479/ticket999-S3-backend], there's also a fix to a preexisting bug in
test_storage.LeaseCrawler.test_unpredictable_future
, where it was checking thes["estimated-remaining-cycle"]["space-recovered"]
key twice, rather than both that key ands["estimated-current-cycle"]["space-recovered"]
as intended.In [5481/ticket999-S3-backend]:
In [5482/ticket999-S3-backend]:
In [5483/ticket999-S3-backend]:
In [5484/ticket999-S3-backend]:
In [5485/ticket999-S3-backend]:
In [5486/ticket999-S3-backend]:
In [5487/ticket999-S3-backend]:
In [5488/ticket999-S3-backend]:
In [5489/ticket999-S3-backend]:
In [5490/ticket999-S3-backend]:
In [5491/ticket999-S3-backend]:
In [5492/ticket999-S3-backend]:
In [5493/ticket999-S3-backend]:
In [5494/ticket999-S3-backend]:
In [5495/ticket999-S3-backend]:
In [5514/ticket999-S3-backend]:
In [5515/ticket999-S3-backend]:
In [5516/ticket999-S3-backend]:
In [5517/ticket999-S3-backend]:
In [5518/ticket999-S3-backend]:
In [5519/ticket999-S3-backend]:
In [5520/ticket999-S3-backend]:
In [5521/ticket999-S3-backend]:
In [5522/ticket999-S3-backend]:
In [5523/ticket999-S3-backend]:
In [5524/ticket999-S3-backend]:
In [5525/ticket999-S3-backend]:
In [5526/ticket999-S3-backend]:
Further work on this functionality will be in ticket #1569.