Overview
Comment: | Made most adjustments needed to run inmemdb with per-run server |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | inmem-per-run-db-per-run-server |
Files: | files | file ages | folders |
SHA1: |
a0a2377c26464e8c3e9546538e00ea08 |
User & Date: | matt on 2014-01-26 23:18:05 |
Other Links: | branch diff | manifest | tags |
Context
2014-01-26
| ||
23:33 | Correct call to get db in register-run, added exit when race condition causes hostinfo to not be found check-in: bc2f918b2f user: matt tags: inmem-per-run-db-per-run-server | |
23:18 | Made most adjustments needed to run inmemdb with per-run server check-in: a0a2377c26 user: matt tags: inmem-per-run-db-per-run-server | |
2014-01-25
| ||
23:15 | Starting to add tasks stuff, updates to manual check-in: acec1dccde user: matt tags: inmem-per-run-db-per-run-server | |
Changes
Modified common.scm from [a4a05606f1] to [8ec6f3bb49].
︙ | |||
41 42 43 44 45 46 47 | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | - + | (define *passnum* 0) ;; when running track calls to run-tests or similar ;; DATABASE (define *open-dbs* (vector #f (make-hash-table))) ;; megatestdb run-id-dbs ;; SERVER (define *my-client-signature* #f) |
︙ |
Modified db.scm from [d8d2f1c357] to [72167e48a7].
︙ | |||
115 116 117 118 119 120 121 122 123 124 125 126 127 128 | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | + | (if rdb rdb (let* ((local (dbr:dbstruct-get-local dbstruct)) (toppath (dbr:dbstruct-get-path dbstruct)) (dbpath (conc toppath "/db/" run-id ".db")) (dbexists (file-exists? dbpath)) (inmem (if local #f (db:open-inmem-db))) (refdb (if local #f (db:open-inmem-db))) (db (sqlite3:open-database dbpath)) (write-access (file-write-access? dbpath)) (handler (make-busy-timeout 136000))) (if (and dbexists (not write-access)) (set! *db-write-access* #f)) ;; only unset so other db's also can use this control (if write-access (begin |
︙ | |||
138 139 140 141 142 143 144 145 146 147 148 149 150 151 | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | + + | (if local (begin (dbr:dbstruct-set-runvec-val! dbstruct run-id 'inmem db) ;; direct access ... db) (begin (dbr:dbstruct-set-runvec-val! dbstruct run-id 'inmem inmem) (db:sync-tables db:sync-tests-only db inmem) (dbr:dbstruct-set-runvec-val! dbstruct run-id 'refdb refdb) (db:sync-tables db:sync-tests-only db refdb) inmem)))))) ;; This routine creates the db. It is only called if the db is not already opened ;; (define (db:open-main dbstruct) ;; (conc *toppath* "/megatest.db") (car *configinfo*))) (let ((mdb (dbr:dbstruct-get-main dbstruct))) (if mdb |
︙ | |||
171 172 173 174 175 176 177 | 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | - - - - - - - - - - | db)))) ;; Make the dbstruct, setup up auxillary db's and call for main db at least once ;; (define (db:setup run-id #!key (local #f)) (let ((dbstruct (make-dbr:dbstruct path: *toppath* local: local))) (db:get-db dbstruct #f) ;; force one call to main |
︙ | |||
830 831 832 833 834 835 836 | 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 | - - + + + + - - - + | (conc fieldname " " wildtype " '" patt "'"))) (if (null? patts) '("") patts)) comparator))) |
︙ |
Modified db_records.scm from [8182037580] to [27e2a2a722].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | + - + | ;;====================================================================== ;; dbstruct ;;====================================================================== ;; ;; -path-|-megatest.db ;; |-db-|-main.db ;; |-monitor.db ;; |-sdb.db ;; |-fdb.db ;; |-1.db ;; |-<N>.db ;; (define (make-dbr:dbstruct #!key (path #f)(local #f)) (vector #f ;; the main db (contains runs, test_meta etc.) NOT CACHED IN MEM |
︙ | |||
37 38 39 40 41 42 43 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | - - + + + | (define-inline (dbr:dbstruct-set-local! vec val)(vector-set! vec 4 val)) ;; get a rundb vector, create it if not already existing (define (dbr:dbstruct-get-rundb-rec vec run-id) (let* ((dbhash (dbr:dbstruct-get-dbhash vec)) ;; get the runs hash (runvec (hash-table-ref/default dbhash run-id #f))) ;; get the vector for run-id (if (vector? runvec) |
︙ |
Modified docs/plan.txt from [6cdd01384a] to [0ead7d4df0].
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | - - + + + + + + + + + + + + + - + | Road Map ======== Note 1: This road-map is tentative and subject to change without notice. Note 2: Starting over. Old plan is commented out. Current Items ------------- |
︙ |
Modified megatest.scm from [cfc8b605d6] to [20b3d11528].
︙ | |||
388 389 390 391 392 393 394 | 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | + + + + - - + + + + + + | transport-from-cmdinfo transport-from-config "fs")))) (debug:print 2 "chosen-transport: " chosen-transport " have; config=" transport-from-config ", cmdln=" transport-from-cmdln ", cmdinfo=" transport-from-cmdinfo) (case chosen-transport ((http) (set! *transport-type 'http) ;; if we have a run-id (why would we?) start the server for that run. ;; otherwise it is up to other calls to start the server(s) dynamically (if run-id (begin |
︙ | |||
693 694 695 696 697 698 699 700 | 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 | + + + - - - - - - - - - - - - + + + + + + + + + + + + | ;; - if cannot access db > allowed disconnect time then kill job (if (args:get-arg "-runtests") (general-run-call "-runtests" "run a test" (lambda (target runname keys keyvals) ;; ;; May or may not implement it this way ... ;; ;; Insert this run into the tasks queue |
︙ |
Modified rmt.scm from [9d09a560ab] to [1be2bf11c2].
︙ | |||
39 40 41 42 43 44 45 | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | + + - + | ;; (define (rmt:send-receive cmd run-id params) (case *transport-type* ((fs-aint-here) (debug:print 0 "ERROR: Not yet (re)supported") (exit 1)) ((fs http) ;; if run-id is #f send the request to run-id = 0 server. This will be for main.db ;; |
︙ | |||
91 92 93 94 95 96 97 98 99 100 101 102 103 104 | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | + + + + | (define (rmt:sync-inmem->db run-id) (rmt:send-receive 'sync-inmem->db run-id '())) (define (rmt:sdb-qry qry val run-id) ;; add caching if qry is 'getid or 'getstr (rmt:send-receive 'sdb-qry run-id (list qry val))) ;; NOT COMPLETED (define (rmt:runtests user run-id testpatt params) (rmt:send-receive 'runtests run-id testpatt)) ;;====================================================================== ;; K E Y S ;;====================================================================== ;; These should not require run-id but it is more consistent to have it. ;; run-id can theoretically be #f but how to handle that is not yet done. (define (rmt:get-key-val-pairs run-id) |
︙ | |||
205 206 207 208 209 210 211 212 | 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | + - + | ;;====================================================================== ;; R U N S ;;====================================================================== (define (rmt:get-run-info run-id) (rmt:send-receive 'get-run-info run-id (list run-id))) ;; Use the special run-id == #f scenario here since there is no run yet (define (rmt:register-run keyvals runname state status user) |
︙ |
Modified runs.scm from [c47d5b284a] to [d850da5471].
︙ | |||
199 200 201 202 203 204 205 | 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | - | (list (not can-not-run-more) num-running num-running-in-jobgroup max-concurrent-jobs job-group-limit))))) ;; test-names: Comma separated patterns same as test-patts but used in selection ;; of tests to run. The item portions are not respected. ;; FIXME: error out if /patt specified ;; (define (runs:run-tests target runname test-patts user flags) ;; test-names |
︙ | |||
1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 | 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 | + | ;; This could probably be refactored into one complex query ... ;; NOT PORTED - DO NOT USE YET ;; (define (runs:rollup-run keys runname user keyvals) (debug:print 4 "runs:rollup-run, keys: " keys " :runname " runname " user: " user) (let* ((db #f) ;; register run operates on the main db (new-run-id (rmt:register-run keyvals runname "new" "n/a" user)) (prev-tests (rmt:get-matching-previous-test-run-records new-run-id "%" "%")) (curr-tests (mt:get-tests-for-run new-run-id "%/%" '() '())) (curr-tests-hash (make-hash-table))) (rmt:update-run-event_time new-run-id) ;; index the already saved tests by testname and itemdat in curr-tests-hash (for-each |
︙ |
Modified server.scm from [cb22531b74] to [15b87d66c1].
︙ | |||
136 137 138 139 140 141 142 | 136 137 138 139 140 141 142 143 144 145 146 147 | - + | (thread-sleep! 3) ;; (process-run (car (argv)) (list "-server" "-" "-daemonize" "-transport" (args:get-arg "-transport" "http"))) ) (begin (debug:print-info 0 "Waiting for server to start") (thread-sleep! 4))) (if (< trycount 10) |