Changes In Branch v1.63-elena Through [983192e6e6] Excluding Merge-Ins
This is equivalent to a diff from 3dd33d4cce to 983192e6e6
2017-03-01
| ||
19:10 | fixed issue for elena (0 byte megatest.db on make setup) check-in: 880cbf2fca user: bjbarcla tags: v1.63, 1.6309a | |
19:04 | updated fix, removed mutex check-in: 344bd252c6 user: bjbarcla tags: v1.63-elena | |
18:57 | bugfixed check-in: 983192e6e6 user: bjbarcla tags: v1.63-elena | |
15:36 | made wal mode optional check-in: 3dd33d4cce user: bjbarcla tags: v1.63 | |
15:35 | reversed polarity of walmode Closed-Leaf check-in: e6ea5fd0f3 user: bjbarcla tags: v1.63-no-wal | |
2017-02-23
| ||
16:41 | bumped version check-in: 738c84b513 user: bjbarcla tags: v1.63, v1.6309 | |
Modified common.scm from [bbb1140396] to [c2bde245d0].
︙ | |||
634 635 636 637 638 639 640 641 642 643 644 645 646 647 | 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 | + | (define (common:writable-watchdog dbstruct) (thread-sleep! 0.05) ;; delay for startup (let ((legacy-sync (common:run-sync?)) (debug-mode (debug:debug-mode 1)) (last-time (current-seconds)) (this-wd-num (begin (mutex-lock! *wdnum*mutex) (let ((x *wdnum*)) (set! *wdnum* (add1 *wdnum*)) (mutex-unlock! *wdnum*mutex) x)))) (debug:print-info 0 *default-log-port* "Periodic sync thread started.") (debug:print-info 3 *default-log-port* "watchdog starting. legacy-sync is " legacy-sync" pid="(current-process-id)" this-wd-num="this-wd-num) (if (and legacy-sync (not *time-to-exit*)) (let* (;;(dbstruct (db:setup)) (mtdb (dbr:dbstruct-mtdb dbstruct)) (mtpath (db:dbdat-get-path mtdb))) (debug:print-info 0 *default-log-port* "Server running, periodic sync started.") (let loop () |
︙ |
Modified db.scm from [a86510f3f3] to [3dc977eab2].
︙ | |||
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | + + + + - + + + + + + + + | (let ((syncprag (configf:lookup *configdat* "setup" "sychronous"))) (sqlite3:execute db (conc "PRAGMA synchronous = " (or syncprag 0) ";")))) ;; open an sql database inside a file lock ;; returns: db existed-prior-to-opening ;; RA => Returns a db handler; sets the lock if opened in writable mode ;; (define *db-open-mutex* (make-mutex)) (define (db:lock-create-open fname initproc) (let* ((parent-dir (or (pathname-directory fname)(current-directory))) ;; no parent? go local (dir-writable (file-write-access? parent-dir)) (file-exists (file-exists? fname)) (file-write (if file-exists (file-write-access? fname) dir-writable ))) (mutex-lock! *db-open-mutex*) (if file-write ;; dir-writable (let (;; (lock (obtain-dot-lock fname 1 5 10)) (db (sqlite3:open-database fname))) (sqlite3:set-busy-handler! db (make-busy-timeout 136000)) ;; (db:set-sync db) (sqlite3:execute db "PRAGMA synchronous = 0;") (if (not file-exists) (begin (if (and (configf:lookup *configdat* "setup" "use-wal") (string-match "^/tmp/.*" fname)) ;; this is a file in /tmp (sqlite3:execute db "PRAGMA journal_mode=WAL;") (print "Creating " fname " in NON-WAL mode.")) (initproc db))) ;; (release-dot-lock fname) (mutex-unlock! *db-open-mutex*) db) (begin (debug:print 2 *default-log-port* "WARNING: opening db in non-writable dir " fname) |
︙ | |||
341 342 343 344 345 346 347 | 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 | + - + - + | ;; (exit 1)))) ;; Open the classic megatest.db file (defaults to open in toppath) ;; ;; NOTE: returns a dbdat not a dbstruct! ;; (define (db:open-megatest-db #!key (path #f)(name #f)) (let* ((dbdir (or path *toppath*)) |
︙ | |||
1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 | 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 | + + | ;; (define open-run-close (define open-run-close open-run-close-exception-handling) ;; open-run-close-no-exception-handling ;; open-run-close-exception-handling) ;;) (define (db:initialize-main-db dbdat) (when (not *configinfo*) (launch:setup)) ;; added because Elena was getting stack dump because *configinfo* below was #f. (let* ((configdat (car *configinfo*)) ;; tut tut, global warning... (keys (keys:config-get-fields configdat)) (havekeys (> (length keys) 0)) (keystr (keys->keystr keys)) (fieldstr (keys->key/field keys)) (db (db:dbdat-get-db dbdat))) (for-each (lambda (key) |
︙ |