Overview
Comment: | Locking of db |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.80 |
Files: | files | file ages | folders |
SHA1: |
494cb9b03533ac1081fb65ccec93dccc |
User & Date: | mrwellan on 2023-03-02 19:12:46 |
Other Links: | branch diff | manifest | tags |
Context
2023-03-02
| ||
19:19 | Better message check-in: c3879943f0 user: mrwellan tags: v1.80 | |
19:12 | Locking of db check-in: 494cb9b035 user: mrwellan tags: v1.80 | |
2023-03-01
| ||
21:29 | Speculative fix for transaction crash. Check if there is a transaction before proceeding. check-in: e8d8a38e49 user: mrwellan tags: v1.80 | |
Changes
Modified db.scm from [e3db33630a] to [5ed64563c8].
︙ | |||
1535 1536 1537 1538 1539 1540 1541 | 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 | + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + | ;; extract index number given a header/data structure (define (db:get-index-by-header header field) (list-index (lambda (x)(equal? x field)) header)) ;; look up values in a header/data structure (define (db:get-value-by-header row header field) (let ((len (vector-length row))) |
︙ | |||
3359 3360 3361 3362 3363 3364 3365 | 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 | + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | (if (and test-id state status (equal? status "AUTO")) (db:test-data-rollup dbstruct run-id test-id status)) (if new-state-eh ;; moved from db:test-set-state-status (mt:process-triggers dbstruct run-id test-id new-state-eh new-status-eh)) tr-res))))) (define (db:roll-up-rules state-status-counts state status) (if (null? state-status-counts) '(#f #f) |
︙ |
Modified dbfile.scm from [a3424eedef] to [776ffe336b].
︙ | |||
399 400 401 402 403 404 405 406 | 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 | + + - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | (define (dbfile:brute-force-salvage-db fname) (let* ((backupfname (conc fname"-"(current-process-id)".bak")) (cmd (conc "cp "fname" "backupfname";mv "fname" "(conc fname ".delme;") "cp "backupfname" "fname))) (dbfile:print-err "WARNING: attempting recovery of file "fname" by running commands:\n" " "cmd) (system cmd))) ;; opens and returns handle and nothing else ;; |
︙ |
Modified dbmod.scm from [982e41ee49] to [cf9c562387].
︙ | |||
337 338 339 340 341 342 343 344 345 346 347 348 349 350 | 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | + + | (conc "SELECT name FROM pragma_table_info('"tablename"') as tblInfo;")) has-last)) ;; tbls is ( ("tablename" ( "field1" [#f|proc1] ) ( "field2" [#f|proc2] ) .... ) ) ;; ;; direction = fromdest, todest ;; mode = 'full, 'incr ;; ;; Idea: youngest in dest is last_update time ;; (define (dbmod:attach-sync tables dbh destdbfile direction #!key (mode 'full) (no-update '("keys")) ;; do ) (debug:print 0 *default-log-port* "Doing sync "direction" "destdbfile) (if (not (sqlite3:auto-committing? dbh)) |
︙ |
Modified tcp-transportmod.scm from [e26313be2b] to [0f2615acc5].
︙ | |||
338 339 340 341 342 343 344 | 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | + + + - + - + + + + | )) (define (tt:keep-running ttdat dbfname dbstruct) ;; verfiy conn for ready ;; listener socket has been started by this stage ;; wait for a port before creating the registration file ;; (let* ((db-locked-in #f) (areapath (tt-areapath ttdat)) (nosyncdbpath (conc areapath"/.megatest")) |
︙ | |||
365 366 367 368 369 370 371 | 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 | + - + + + + + + | (let loop () (let* ((servers (tt:get-server-info-sorted ttdat dbfname)) (ok (cond ((null? servers) #f) ;; not ok ((equal? (list-ref (car servers) 6) ;; compare the servinfofile (tt-servinf-file ttdat)) (debug:print-info 0 *default-log-port* "Keep running, I'm the top server.") (if db-locked-in |
︙ |