It seems I forgot to record the changes to variable.lisp.
Amended patch attach.
Leslie
Thu Apr 17 14:31:04 CEST 2008 [EMAIL PROTECTED]
* Implemented backup functionality in migrate code.
New patches:
[Implemented backup functionality in migrate code.
[EMAIL PROTECTED] {
move ./src/elephant/migrate.lisp ./src/elephant/backup.lisp
hunk ./elephant.asd 320
- (:file "migrate")
+ (:file "backup")
hunk ./src/elephant/backup.lisp 3
-;;; migrate.lisp -- Migrate between repositories
+;;; backup.lisp -- Backup or migrate between repositories
hunk ./src/elephant/backup.lisp 6
-;;; New version 2/19/2006 by Ian Eslick
-;;; <[EMAIL PROTECTED]>
+;;; New version 2/19/2006 by Ian Eslick <[EMAIL PROTECTED]>
+;;; Backup functionality added 2008 by Leslie P. Polzer <[EMAIL PROTECTED]>
hunk ./src/elephant/backup.lisp 27
-;; The generic function Migrate provides an interface to moving objects between
-;; repositories and is used by the upgrade interface.
+;; The generic functions MIGRATE/BACKUP provide an interface to moving/copying objects
+;; between repositories and is used by the upgrade interface.
hunk ./src/elephant/backup.lisp 65
+;;
+;; - Another quirk is the usage of MAKE-INSTANCE, which will make use
+;; of any initforms; if any of those initforms will access data that
+;; is not available (e.g. the *SESSION* binding of Hunchentoot)
+;; the process will fail. Be sure to wrap such cases appropriately,
+;; for example like:
+;;
+;; (and (boundp '*session*) *session* (session-value 'user))
hunk ./src/elephant/backup.lisp 78
-;; (defmethod migrate ((dst store-controller) (src my-class)))
+;; (defmethod backup ((dst store-controller) (src my-class)))
hunk ./src/elephant/backup.lisp 88
-
hunk ./src/elephant/backup.lisp 89
+ (:documentation "Convenience/compatibility function that calls (BACKUP DST SRC :MIGRATE-P T)")
+ (:method (dst src)
+ (backup dst src :migrate-p t)))
+
+(defgeneric backup (dst src &key migrate-p)
hunk ./src/elephant/backup.lisp 105
-(defmethod migrate ((dst store-controller) (src store-controller))
- "Perform a wholesale repository migration from the root.
- Also acts as a poor man's GC if you copy to another store
+(defmethod backup ((dst store-controller) (src store-controller) &key (migrate-p nil))
+ "Perform a wholesale repository backup from the root.
+ Also acts as a poor man's GC if you migrate to another store
hunk ./src/elephant/backup.lisp 117
- (when *migrate-messages*
- (if *migrate-verbose*
+ (when *backup-messages*
+ (if *backup-verbose*
hunk ./src/elephant/backup.lisp 137
- (setf (%index-cache (find-class classname)) newcidx)
+ (when migrate-p
+ (setf (%index-cache (find-class classname)) newcidx))
hunk ./src/elephant/backup.lisp 143
- (register-copied-object classidx newcidx)))
+ (when migrate-p
+ (register-copied-object classidx newcidx))
+ ))
hunk ./src/elephant/backup.lisp 148
- (when *migrate-messages*
- (if *migrate-verbose*
+ (when *backup-messages*
+ (if *backup-verbose*
hunk ./src/elephant/backup.lisp 159
- (update-in-memory-objects src dst)
- (if (eq *store-controller* src)
- (setf *store-controller* dst)
- (setf *store-controller* nil))
+ (when migrate-p
+ (update-in-memory-objects src dst)
+ (if (eq *store-controller* src)
+ (setf *store-controller* dst)
+ (setf *store-controller* nil)))
hunk ./src/elephant/backup.lisp 170
- (declare (ignore oldoid))
- (when (= (mod (1- (incf count)) 1000) 0)
- (when (and *migrate-messages* *migrate-verbose*)
- (format t "~A objects copied~%" count)))
- (let ((newinst (migrate sc oldinst)))
- (ensure-transaction (:store-controller sc)
- ;; This isn't redundant in most cases, but we may have
- ;; indexed objects without slots and without a slot
- ;; write the new index won't be updated in that case
- (setf (get-value (oid newinst) new) newinst))))
+ (when (and *backup-messages* *backup-verbose*)
+ (when (= (mod (1- (incf count)) 1000) 0)
+ (format t "~A objects copied~%" count))
+ (format t "oldoid: ~S oldinst: ~S type: ~S~%" oldoid oldinst (type-of oldinst)))
+ (when oldinst
+ (let ((newinst (migrate sc oldinst)))
+ (ensure-transaction (:store-controller sc)
+ ;; This isn't redundant in most cases, but we may have
+ ;; indexed objects without slots and without a slot
+ ;; write the new index won't be updated in that case
+ (setf (get-value (oid newinst) new) newinst)))))
hunk ./src/elephant/backup.lisp 187
-(defmethod migrate ((dst t) (src t))
- (error "Cannot migrate ~A of type ~A to destination of type ~A" src (type-of src) (type-of dst)))
+(defmethod backup ((dst t) (src t) &key (migrate-p nil))
+ (error "Cannot copy ~A of type ~A to destination of type ~A" src (type-of src) (type-of dst)))
hunk ./src/elephant/backup.lisp 190
-(defmethod migrate ((dst store-controller) (src t))
- "Default: standard objects are automatically migrated"
+(defmethod backup ((dst store-controller) (src t) &key (migrate-p nil))
+ "Default: standard objects are automatically copied"
hunk ./src/elephant/backup.lisp 198
-(defmethod migrate :before ((dst store-controller) (src persistent))
+(defmethod backup :before ((dst store-controller) (src persistent) &key (migrate-p nil))
hunk ./src/elephant/backup.lisp 209
-(defmethod migrate :before ((dst store-controller) (src store-controller))
+(defmethod backup :before ((dst store-controller) (src store-controller) &key (migrate-p nil))
hunk ./src/elephant/backup.lisp 213
-(defmethod migrate :after ((dst store-controller) (src store-controller))
+(defmethod backup :after ((dst store-controller) (src store-controller) &key (migrate-p nil))
hunk ./src/elephant/backup.lisp 217
-(defmethod migrate ((dst store-controller) (src standard-class))
- (error "Cannot migrate class objects (i.e. ~A)" src))
+(defmethod backup ((dst store-controller) (src standard-class) &key (migrate-p nil))
+ (error "Cannot copy class objects (i.e. ~A)" src))
hunk ./src/elephant/backup.lisp 220
-(defmethod migrate ((dst store-controller) (src function))
- (error "Cannot migrate function objects (i.e. ~A)" src))
+(defmethod backup ((dst store-controller) (src function) &key (migrate-p nil))
+ (error "Cannot copy function objects (i.e. ~A)" src))
hunk ./src/elephant/backup.lisp 229
-(defmethod migrate ((dst store-controller) (src persistent))
- "Migrate a persistent object and apply a binary (lambda (dst src) ...)
- function to the new object. Users can override migrate by creating
+(defmethod backup ((dst store-controller) (src persistent) &key (migrate-p nil))
+ "Copy a persistent object and apply a binary (lambda (dst src) ...)
+ function to the new object. Users can override copying by creating
hunk ./src/elephant/backup.lisp 266
- (let ((value (migrate dstsc (slot-value-using-class class src slot-def))))
+ (let ((value (backup dstsc (slot-value-using-class class src slot-def))))
hunk ./src/elephant/backup.lisp 283
-(defmethod migrate ((dst store-controller) (src btree))
+(defmethod backup ((dst store-controller) (src btree) &key (migrate-p nil))
hunk ./src/elephant/backup.lisp 293
-(defmethod migrate ((dst store-controller) (src indexed-btree))
+(defmethod backup ((dst store-controller) (src indexed-btree) &key (migrate-p nil))
hunk ./src/elephant/backup.lisp 303
- (when (and *migrate-messages* *migrate-verbose*)
+ (when (and *backup-messages* *backup-verbose*)
hunk ./src/elephant/backup.lisp 314
- (let ((newval (migrate sc value))
- (newkey (migrate sc key)))
+ (let ((newval (backup sc value))
+ (newkey (backup sc key)))
hunk ./src/elephant/backup.lisp 323
-(defmethod migrate ((dst store-controller) (src standard-object))
+(defmethod backup ((dst store-controller) (src standard-object) &key (migrate-p nil))
hunk ./src/elephant/backup.lisp 332
- (setf (slot-value src slotname) (migrate dst value)))))
+ (setf (slot-value src slotname) (backup dst value)))))
hunk ./src/elephant/backup.lisp 336
-(defmethod migrate ((dst store-controller) (src structure-object))
+(defmethod backup ((dst store-controller) (src structure-object) &key (migrate-p nil))
hunk ./src/elephant/backup.lisp 344
- (migrate dst value)))))
+ (backup dst value)))))
hunk ./src/elephant/backup.lisp 347
-(defmethod migrate ((dst store-controller) (src cons))
+(defmethod backup ((dst store-controller) (src cons) &key (migrate-p nil))
hunk ./src/elephant/backup.lisp 349
- (cons (migrate dst (car src))
- (migrate dst (cdr src))))
+ (cons (backup dst (car src))
+ (backup dst (cdr src))))
hunk ./src/elephant/backup.lisp 352
-(defmethod migrate ((dst store-controller) (src array))
+(defmethod backup ((dst store-controller) (src array) &key (migrate-p nil))
hunk ./src/elephant/backup.lisp 358
- (migrate dst value))))
+ (backup dst value))))
hunk ./src/elephant/backup.lisp 361
-(defmethod migrate ((dst store-controller) (src hash-table))
- "Migrate each hash element as the types are non-uniform"
+(defmethod backup ((dst store-controller) (src hash-table) &key (migrate-p nil))
+ "Copy each hash element as the types are non-uniform"
hunk ./src/elephant/backup.lisp 365
- (migrate dst value)))
+ (backup dst value)))
hunk ./src/elephant/backup.lisp 456
-
-
-
-
hunk ./src/elephant/variables.lisp 102
-(defparameter *migrate-messages* t
- "Print information during migrate to update user on ongoing progress")
+(defparameter *backup-messages* t
+ "Print information during backup/migrate to update user on ongoing progress")
hunk ./src/elephant/variables.lisp 105
-(defparameter *migrate-verbose* t
+(defparameter *backup-verbose* t
}
Context:
[un-disabled tests for SBCL
[EMAIL PROTECTED]
[db-postmodern: sync-cache type handling fix
[EMAIL PROTECTED]
[test concurrency extended
[EMAIL PROTECTED]
[transaction restart support plus extended features
[EMAIL PROTECTED]
[db-postmodern: transaction retry handling, serializable isolation
[EMAIL PROTECTED]
[db-postmodern: small sync cache fix
[EMAIL PROTECTED]
cache was discarded in empty txn
]
[Disabling threading tests for SBCL
Robert L. Read**20080410015544]
[Chun Tian's conditional for lispworks slot-definition-allocation
[EMAIL PROTECTED]
[spelling errors
Robert L. Read**20080408140049]
[Changed erroneous statement in tutorial that index comparison uses EQUALP.
[EMAIL PROTECTED]
[DB-POSTMODERN: remove DBPM-ERROR; don't attempt to remove an already prepared statement (pointless since the txn is aborted at the time); defer all errors to txn handler (but warn and print the offending statement)
[EMAIL PROTECTED]
[DB-POSTMODERN: support transaction retries; handle deadlock; add savepoint utility functions; add warnings to help debugging problematic conditions.
[EMAIL PROTECTED]
[added BORDEAUX-THREADS dependency and changed PM controller to use it instead of SB-THREAD stuff.
[EMAIL PROTECTED]
[added concurrency test cases.
[EMAIL PROTECTED]
[DB-POSTMODERN: reap old connections when a new one is requested.
[EMAIL PROTECTED]
[Improve berkeley DB version agnostic code
[EMAIL PROTECTED]
Added an error message to configure my-config.sexp and made sure we load
it directly from my-config.sexp so that we get it right at load time.
Prior patch didn't override default until after load time.
]
[Support for multiple BDB versions
[EMAIL PROTECTED]
[db-bdb updated to BerkeleyDB 4.6
[EMAIL PROTECTED]
Changed only BDB constants as upgrade 4.5 -> 4.6 they were
changed.
A kind of hack perhaps. But it works. The testing was not excessive,
but it works well for my project.
]
[Check for unbound slot; potential fix for a compiler error
[EMAIL PROTECTED]
[Fix test dependence for ff-index-test
[EMAIL PROTECTED]
[Enable multi-store indexed classes
[EMAIL PROTECTED]
[DB-POSTMODERN: reap old connections when a new one is requested.
[EMAIL PROTECTED]
[Enable multiple process connections to a BDB data-store via DB_REGISTER option
[EMAIL PROTECTED]
[Change semantics of transaction :retry-count from tries to retries
[EMAIL PROTECTED]
[Minor edits, fixed a comment, fixed a db-lisp out of date error
[EMAIL PROTECTED]
[Refactor UTF{16,32}LE serializers.
[EMAIL PROTECTED]
[add test for STRING types (as opposed to SIMPLE-STRING types)
[EMAIL PROTECTED]
[Alex's patch for 8.3
[EMAIL PROTECTED]
I entered here the patch from Alex of 2088/02/16
which apparently makes this compatible with Postgres 8.3.
It is green for me on all tests on Posgres 8.1, so
I am committing it.
]
[mtype change in dcm
[EMAIL PROTECTED]
[moved cache-instance into initial-persistent-setup
[EMAIL PROTECTED]
because it was bypassed by recreate-instance otherwise
]
[accessor name in tests change
[EMAIL PROTECTED]
[db-postmodern: pm-btree initialization fixed
[EMAIL PROTECTED]
[recreate-instance stuff improved
[EMAIL PROTECTED]
[db-postmodern: removed specialized map-index
[EMAIL PROTECTED]
because pure cursor version works fine and is more robust
]
[cursor-duplicate removed from db-postmodern
Henrik Hjelte<[EMAIL PROTECTED]>*-20071124163701]
[db-postmodern fix map-index optimization bug
Henrik Hjelte <[EMAIL PROTECTED]>**20080104151644]
[db-postmodern: cursors re-implemented
[EMAIL PROTECTED]
[controller-doc-improvement
[EMAIL PROTECTED]
[Amend OPEN-STORE docs.
[EMAIL PROTECTED]
[tutorial
[EMAIL PROTECTED]
[non-keyword-accessors
[EMAIL PROTECTED]
allows lispworks to run tests.
]
[function-call-key-form
[EMAIL PROTECTED]
[documentation type fix
[EMAIL PROTECTED]
[Fix the use of internal symbol of sb-kernel in memutils
Leonardo Varuzza <[EMAIL PROTECTED]>**20071230000120
memutil.lisp use the functions sb-kernel::copy-*-from-system-area, which
aren't exported in the latest version of sbcl.
Fix it adding the :: when appropriate
]
[db-bdb bugfix: when bdb key comparison compared only the first half of utf16 strings
[EMAIL PROTECTED]
[Fix instance deserialization to bypass initialization protocol
[EMAIL PROTECTED]
[db-postmodern: optimized map-index for -by-value case
[EMAIL PROTECTED]
[db-postmodern: optimized form-slot-key for persistent-slot-reader
[EMAIL PROTECTED]
it uses SBCL internal function now, for other implementation it's less optimized.
]
[db-postmodern: small example update
[EMAIL PROTECTED]
[added sh script for flushing logs sample
[EMAIL PROTECTED]
[db-postmodern removed possiblity of using NIL as a key in btrees
Henrik Hjelte<[EMAIL PROTECTED]>**20071124163828]
[cursor-duplicate removed from db-postmodern
Henrik Hjelte<[EMAIL PROTECTED]>**20071124163701]
[removed a little compiler warning (typo)
Henrik Hjelte<[EMAIL PROTECTED]>**20071122151929]
[remove kind-hints parameter from add-index
Henrik Hjelte<[EMAIL PROTECTED]>**20071122151046
Probably a coming feature from Ian, but
right now it breaks the generic function add-index
and thus postmodern, so I removed it for now.
]
[Ensure set-db-synch is defined before pset is loaded
[EMAIL PROTECTED]
[Fix instance deserialization to bypass initialization protocol
[EMAIL PROTECTED]
[Fix to from-end traversal of new map-index
[EMAIL PROTECTED]
[New map-index implementation
[EMAIL PROTECTED]
[Cheaper get-instance-by-value
[EMAIL PROTECTED]
[TAG ELEPHANT-0-9-1
[EMAIL PROTECTED]
Patch bundle hash:
ddc97b937faba0cb8fe892934a8af3c9d3b658fd
_______________________________________________
elephant-devel site list
elephant-devel@common-lisp.net
http://common-lisp.net/mailman/listinfo/elephant-devel