Megatest

Check-in [6ad4f305ae]
Login
Overview
Comment:new2old needed to handle sync in rmt correctly
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.60
Files: files | file ages | folders
SHA1: 6ad4f305ae1a65ac3d3737d56eb1bcf06cced69e
User & Date: mrwellan on 2014-10-08 12:54:59
Other Links: branch diff | manifest | tags
Context
2014-10-08
13:07
new2old needed to handle multi sync in megatest.scm correctly check-in: 5c03cce6b3 user: mrwellan tags: v1.60
12:54
new2old needed to handle sync in rmt correctly check-in: 6ad4f305ae user: mrwellan tags: v1.60
12:45
new2old needed to handle main.db correctly check-in: fbfdc4b6a2 user: mrwellan tags: v1.60
Changes

Modified rmt.scm from [b74fc0e720] to [94b2588122].

152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
      ;; mark this run as dirty if this was a write
      (if (not (member cmd api:read-only-queries))
	  (let ((start-time (current-seconds)))
	    (mutex-lock! *db-sync-mutex*)
	    (let ((last-sync (hash-table-ref/default *db-local-sync* run-id 0)))
	      (if (> (- start-time last-sync) 5) ;; every five seconds
		  (begin
		    (db:multi-db-sync run-id 'new2old)
		    (debug:print-info 0 "Sync of newdb to olddb for run-id " run-id " completed in " (- (current-seconds) start-time) " seconds")
		    (hash-table-set! *db-local-sync* run-id start-time))))
	    (mutex-unlock! *db-sync-mutex*)))
      res)))

(define (rmt:send-receive-no-auto-client-setup connection-info cmd run-id params)
  (let* ((run-id   (if run-id run-id 0))







|







152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
      ;; mark this run as dirty if this was a write
      (if (not (member cmd api:read-only-queries))
	  (let ((start-time (current-seconds)))
	    (mutex-lock! *db-sync-mutex*)
	    (let ((last-sync (hash-table-ref/default *db-local-sync* run-id 0)))
	      (if (> (- start-time last-sync) 5) ;; every five seconds
		  (begin
		    (db:multi-db-sync (list run-id) 'new2old)
		    (debug:print-info 0 "Sync of newdb to olddb for run-id " run-id " completed in " (- (current-seconds) start-time) " seconds")
		    (hash-table-set! *db-local-sync* run-id start-time))))
	    (mutex-unlock! *db-sync-mutex*)))
      res)))

(define (rmt:send-receive-no-auto-client-setup connection-info cmd run-id params)
  (let* ((run-id   (if run-id run-id 0))