COMPILATION LISTING OF SEGMENT tm_cleanup Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 05/06/86 1300.1 mst Tue Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1983 * 4* * * 5* *********************************************************** */ 6 7 8 /****^ HISTORY COMMENTS: 9* 1) change(86-02-27,Pierret), approve(86-02-27,MCR7340), 10* audit(86-04-28,Newcomb), install(86-05-06,MR12.0-1054): 11* Changed to execute file_mangaer_$post_transaction before unlocking locks. 12* END HISTORY COMMENTS */ 13 14 15 /* format: style4,ifthenstmt,^indproc,^indcomtxt */ 16 /*---------------*/ 17 18 tm_cleanup: proc (A_tdt_ptr, A_txn_index); 19 20 /* DESCRIPTION: 21* 22* This procedure is invoked by all operations' cleanup handlers. 23* It looks at the state of the process's TDT entry and does whatever 24* is necessary to put the entry in a consistent state. 25**/ 26 27 /* HISTORY: 28* 29*Written by Steve Herbst, 08/04/82 30*Modified: 31*08/16/82 by Steve Herbst: Changed to use consolidated dm_tm_tdt.incl.pl1 with 32* entry declarations. 33*09/13/82 by Steve Herbst: Changed for no-locking environment. 34*09/22/82 by Steve Herbst: Added $crawlout 35*09/23/82 by Lindsey Spratt: Changed to use new lock_manager_ calling sequences. 36*10/05/82 by Steve Herbst: Added TM_ABORT_POST_COMMIT_STATE 37*10/14/82 by Steve Herbst: Changed calling sequence of pfm_$flush_modified_ci 38*11/01/82 by Steve Herbst: Changed to turn on txn's error_sw for error states. 39*11/05/82 by Steve Herbst: Made to set tm_tdt.error_code on error return. 40*12/14/82 by Steve Herbst: Let daemon try to adjust an error txn if it hasn't. 41*01/12/83 by Steve Herbst: Made to log errors that occur while cleaning up. 42*01/14/83 by Steve Herbst: Added $restart_error, changed to log errors by 43* calling tm_error_state. 44*03/21/83 by Steve Herbst: Fixed $restart_error to set dm_data_$current_txn_id, 45* made all entries save & restore dm_data_. 46*05/27/83 by Steve Herbst: Made to update checkpoint_id & rollback_count in 47* TDT entry. 48*10/19/83 by Steve Herbst: Changed behavior in case where perprocess list of 49* modified ci's is no longer available. 50*09/25/84 by Steve Herbst: Changed in response to audit comments. 51*11/27/84 by Steve Herbst: Changed further in response to audit comments. 52*12/26/84 by Matthew Pierret: Commented out call to file_manager_$post_commit. 53* before_journal_manager_ currently handles postcommit operations 54* for file_manager_. 55*01/29/85 by Steve Herbst: Fixed to ignore dm_error_$file_was_deleted. 56*02/07/85 by Stanford S. Cox: Added fm$post_transaction call (moved from 57* lm_per_system_), STATE 45: Chg lm$unlock_to_checkpoint call to 58* lm$unlock_all. 59*02/12/85 by S. Cox: TM_ROLLBACK_UNLOCKING_STATE: Rmvd fm$post_transaction call. 60*04/23/85 by Matthew C. Pierret: Switched the order of the calls to 61* file_manager_$post_transaction and lock_manager_$unlock_all. This 62* allows file_manager_$post_transaction to operate under the safety 63* of the locks acquired by the transaction. 64**/ 65 66 /* DECLARATIONS */ 67 68 /* Parameter */ 69 70 dcl A_tdt_ptr ptr parameter; 71 dcl A_txn_index fixed bin parameter; 72 73 74 /* Constants */ 75 76 dcl ME char (32) int static options (constant) init ("tm_cleanup"); 77 78 /* Based */ 79 80 /* Static */ 81 82 /* Automatic */ 83 84 dcl (process_id, saved_current_txn_id, txn_id) bit (36) aligned; 85 dcl daemon_sw bit (1); 86 dcl (saved_current_txn_index, state, txn_index) fixed bin; 87 dcl code fixed bin (35); 88 89 /* External */ 90 91 dcl dm_data_$current_txn_id bit (36) aligned ext; 92 dcl dm_data_$current_txn_index fixed bin ext; 93 dcl dm_data_$my_tdt_index fixed bin ext; 94 dcl dm_data_$tm_tdt_ptr ptr ext; 95 dcl dm_error_$file_was_deleted fixed bin (35) ext; 96 dcl dm_system_data_$initializer_processid bit (36) ext; 97 98 /* Entries */ 99 100 dcl before_journal_manager_$flush_transaction entry (bit (36) aligned, fixed bin, fixed bin (35)); 101 dcl before_journal_manager_$rollback entry (bit (36) aligned, fixed bin, fixed bin, fixed bin (35)); 102 dcl before_journal_manager_$write_aborted_mark entry (bit (36) aligned, fixed bin, fixed bin (35)); 103 dcl before_journal_manager_$write_committed_mark entry (bit (36) aligned, fixed bin, fixed bin (35)); 104 dcl before_journal_manager_$write_rolled_back_mark entry (bit (36) aligned, fixed bin, fixed bin (35)); 105 dcl get_process_id_ entry returns (bit (36)); 106 dcl lock_manager_$unlock_all entry; 107 dcl file_manager_$flush_modified_ci entry (bit (36) aligned, fixed bin, fixed bin (35)); 108 dcl file_manager_$post_transaction entry (); 109 dcl tm_error_state entry (fixed bin, fixed bin, fixed bin (35), char (*), char (*)); 110 111 /* Builtins */ 112 113 dcl unspec builtin; 114 115 /* Conditions */ 116 117 dcl cleanup condition; 118 119 /* END OF DECLARATIONS */ 120 121 tm_tdt_ptr = A_tdt_ptr; 122 txn_index = A_txn_index; 123 call SAVE_DM_DATA; 124 on cleanup call RESTORE_DM_DATA; 125 126 go to COMMON; 127 128 restart_error: entry (A_tdt_ptr, A_txn_index); 129 130 /* This entry point acts like $tm_cleanup but first changes an error state into the corresponding 131* state before the call that produced the error */ 132 133 tm_tdt_ptr = A_tdt_ptr; 134 txn_index = A_txn_index; 135 call SAVE_DM_DATA; 136 on cleanup call RESTORE_DM_DATA; 137 138 dm_data_$current_txn_id = tm_tdt.txn_id (txn_index); 139 140 if tm_tdt.error_sw (txn_index) then do; 141 tm_tdt.error_sw (txn_index) = "0"b; 142 tm_tdt.error_code (txn_index) = 0; 143 144 if tm_tdt.state (txn_index) > TM_ERROR_INCREMENT then 145 tm_tdt.state (txn_index) = tm_tdt.state (txn_index) - TM_ERROR_INCREMENT; 146 end; 147 go to COMMON; 148 149 crawlout: entry; /* callable from any program in the process */ 150 151 tm_tdt_ptr = dm_data_$tm_tdt_ptr; 152 txn_index = dm_data_$my_tdt_index; 153 call SAVE_DM_DATA; 154 on cleanup call RESTORE_DM_DATA; 155 156 COMMON: 157 process_id = get_process_id_ (); 158 daemon_sw = (process_id = dm_system_data_$initializer_processid); 159 160 txn_id = tm_tdt.txn_id (txn_index); 161 if txn_id = "0"b then go to HANDLE_STATE; /* deleted transaction */ 162 163 /* If this is not the process that created the transaction, we no longer have 164* the (perprocess) list of modified control intervals. So... */ 165 166 if tm_tdt.process_id (txn_index) ^= process_id then do; 167 168 /* if commit hasn't flushed modified ci's, must convert to an abort */ 169 if tm_tdt.state (txn_index) = TM_COMMIT_FLUSHING_TXN_STATE | 170 tm_tdt.state (txn_index) = TM_COMMIT_FLUSHING_CI_STATE then 171 tm_tdt.state (txn_index) = TM_ABORT_FLUSHING_TXN_STATE; 172 173 else if tm_tdt.state (txn_index) = TM_ABORT_FLUSHING_CI_STATE then 174 tm_tdt.state (txn_index) = TM_ABORT_ROLLING_BACK_STATE; /* repeat the rollback */ 175 176 else if tm_tdt.state (txn_index) = TM_ROLLBACK_FLUSHING_CI_STATE then 177 tm_tdt.state (txn_index) = TM_ROLLBACK_ROLLING_BACK_STATE; /* repeat the rollback */ 178 end; 179 180 HANDLE_STATE: 181 state = tm_tdt.state (txn_index); 182 if state < 0 | state > HIGHEST_STATE then state, tm_tdt.state (txn_index) = 0; 183 go to STATE (state); 184 185 186 STATE (0): /* transaction does not exist */ 187 188 if dm_data_$current_txn_index ^= 0 then do; 189 dm_data_$current_txn_id = "0"b; 190 dm_data_$current_txn_index = 0; 191 end; 192 193 unspec (tm_tdt.transaction (txn_index)) = "0"b; /* now it's really gone */ 194 RETURN: 195 call RESTORE_DM_DATA; 196 return; 197 198 199 /* TM_IN_PROGRESS_STATE */ 200 STATE (1): 201 202 if dm_data_$current_txn_index ^= 0 then do; /* dm_data_$current_txn_id = "0"b if */ 203 /* transaction was in error previously */ 204 dm_data_$current_txn_id = tm_tdt.txn_id (dm_data_$current_txn_index); 205 end; 206 207 go to RETURN; /* nothing to clean up */ 208 209 210 /* TM_BEGIN_STARTING_STATE */ 211 STATE (11): 212 213 tm_tdt.state (txn_index) = 0; 214 go to HANDLE_STATE; /* nothing to clean up; delete txn */ 215 216 217 /* TM_ABORT_FLUSHING_TXN_STATE */ 218 STATE (21): 219 220 call before_journal_manager_$flush_transaction (txn_id, txn_index, code); 221 if code ^= 0 then 222 call ERROR_STATE (TM_ABORT_FLUSHING_TXN_ERROR, code, "bjm_$flush_transaction"); 223 224 tm_tdt.state (txn_index) = TM_ABORT_ROLLING_BACK_STATE; 225 go to HANDLE_STATE; 226 227 /* TM_ABORT_ROLLING_BACK_STATE */ 228 STATE (22): 229 230 call before_journal_manager_$rollback (txn_id, txn_index, 0, code); 231 if code ^= 0 then 232 call ERROR_STATE (TM_ABORT_ROLLING_BACK_ERROR, code, "bjm_$rollback"); 233 234 tm_tdt.checkpoint_id (txn_index) = 0; 235 tm_tdt.rollback_count (txn_index) = tm_tdt.rollback_count (txn_index) + 1; 236 237 tm_tdt.state (txn_index) = TM_ABORT_FLUSHING_CI_STATE; 238 go to HANDLE_STATE; 239 240 /* TM_ABORT_FLUSHING_CI_STATE */ 241 STATE (23): 242 243 call file_manager_$flush_modified_ci (txn_id, txn_index, code); 244 if code ^= 0 & code ^= dm_error_$file_was_deleted then 245 /* previous cleanup may have deleted the file */ 246 call ERROR_STATE (TM_ABORT_FLUSHING_CI_ERROR, code, "fm_$flush_modified_ci"); 247 248 tm_tdt.state (txn_index) = TM_ABORT_WRITING_MARK_STATE; 249 go to HANDLE_STATE; 250 251 /* TM_ABORT_WRITING_MARK_STATE */ 252 STATE (24): 253 254 call before_journal_manager_$write_aborted_mark (txn_id, txn_index, code); 255 if code ^= 0 then 256 call ERROR_STATE (TM_ABORT_WRITING_MARK_ERROR, code, "bjm_$write_aborted_mark"); 257 258 tm_tdt.state (txn_index) = TM_ABORT_UNLOCKING_STATE; 259 go to HANDLE_STATE; 260 261 /* TM_ABORT_UNLOCKING_STATE */ 262 STATE (25): 263 264 call file_manager_$post_transaction; 265 call lock_manager_$unlock_all; 266 267 tm_tdt.state (txn_index) = TM_ABORT_METERING_STATE; 268 go to HANDLE_STATE; 269 270 /* TM_ABORT_METERING_STATE */ 271 STATE (26): 272 273 /* Metering not implemented yet */ 274 275 tm_tdt.state (txn_index) = 0; 276 go to HANDLE_STATE; 277 278 279 /* TM_COMMIT_FLUSHING_TXN_STATE */ 280 STATE (31): 281 282 call before_journal_manager_$flush_transaction (txn_id, txn_index, code); 283 if code ^= 0 then 284 call ERROR_STATE (TM_COMMIT_FLUSHING_TXN_ERROR, code, "bjm_$flush_transaction"); 285 286 tm_tdt.state (txn_index) = TM_COMMIT_FLUSHING_CI_STATE; 287 go to HANDLE_STATE; 288 289 /* TM_COMMIT_FLUSHING_CI_STATE */ 290 STATE (32): 291 292 call file_manager_$flush_modified_ci (txn_id, txn_index, code); 293 if code ^= 0 then /* for commit, dm_error_$file_was_deleted is always an error */ 294 call ERROR_STATE (TM_COMMIT_FLUSHING_CI_ERROR, code, "fm_$flush_modified_ci"); 295 296 tm_tdt.state (txn_index) = TM_COMMIT_WRITING_MARK_STATE; 297 go to HANDLE_STATE; 298 299 /* TM_COMMIT_WRITING_MARK_STATE */ 300 STATE (33): 301 302 call before_journal_manager_$write_committed_mark (txn_id, txn_index, code); 303 if code ^= 0 then 304 call ERROR_STATE (TM_COMMIT_WRITING_MARK_ERROR, code, "bjm_$write_committed_mark"); 305 306 tm_tdt.state (txn_index) = TM_COMMIT_POST_COMMIT_STATE; 307 go to HANDLE_STATE; 308 309 /* TM_COMMIT_POST_COMMIT_STATE */ 310 STATE (34): 311 312 /* ************************************************************************** 313* * There are no post_commit operations handled by transaction_manager_ yet. * 314* 315* if tm_tdt.post_commit_flags.fmgr (txn_index) then do; 316* call file_manager_$post_commit (txn_id, txn_index, code); 317* if code ^= 0 then 318* call ERROR_STATE (TM_COMMIT_POST_COMMIT_ERROR, code, "fm_$post_commit"); 319* end; 320* 321* if tm_tdt.bjmgr (txn_index) then do; 322* call before_journal_manager_$post_commit (txn_id, txn_index, code); 323* if code ^= 0 then 324* call ERROR_STATE (TM_COMMIT_POST_COMMIT_ERROR, code, "bjm_$post_commit"); 325* end; 326*************************************************************************** */ 327 tm_tdt.state (txn_index) = TM_COMMIT_UNLOCKING_STATE; 328 go to HANDLE_STATE; 329 330 /* TM_COMMIT_UNLOCKING_STATE */ 331 STATE (35): 332 333 call file_manager_$post_transaction; 334 call lock_manager_$unlock_all; 335 336 tm_tdt.state (txn_index) = TM_COMMIT_METERING_STATE; 337 go to HANDLE_STATE; 338 339 /* TM_COMMIT_METERING_STATE */ 340 STATE (36): 341 342 /* Metering not implemented yet */ 343 344 tm_tdt.state (txn_index) = 0; 345 go to HANDLE_STATE; 346 347 348 /* TM_ROLLBACK_FLUSHING_TXN_STATE */ 349 STATE (41): 350 351 call before_journal_manager_$flush_transaction (txn_id, txn_index, code); 352 if code ^= 0 then 353 call ERROR_STATE (TM_ROLLBACK_FLUSHING_TXN_ERROR, code, "bjm_$flush_transaction"); 354 355 tm_tdt.state (txn_index) = TM_ROLLBACK_ROLLING_BACK_STATE; 356 go to HANDLE_STATE; 357 358 /* TM_ROLLBACK_ROLLING_BACK_STATE */ 359 STATE (42): 360 361 call before_journal_manager_$rollback (txn_id, txn_index, 0 /* USE CHECKPOINT FROM ENTRY */, code); 362 if code ^= 0 then 363 call ERROR_STATE (TM_ROLLBACK_ROLLING_BACK_ERROR, code, "bjm_$rollback"); 364 365 tm_tdt.checkpoint_id (txn_index) = 0; 366 tm_tdt.rollback_count (txn_index) = tm_tdt.rollback_count (txn_index) + 1; 367 368 tm_tdt.state (txn_index) = TM_ROLLBACK_FLUSHING_CI_STATE; 369 go to HANDLE_STATE; 370 371 /* TM_ROLLBACK_FLUSHING_CI_STATE */ 372 STATE (43): 373 374 call file_manager_$flush_modified_ci (txn_id, txn_index, code); 375 if code ^= 0 & code ^= dm_error_$file_was_deleted then 376 /* previous cleanup may have deleted the file */ 377 call ERROR_STATE (TM_ROLLBACK_FLUSHING_CI_ERROR, code, "fm_$flush_modified_ci"); 378 379 tm_tdt.state (txn_index) = TM_ROLLBACK_WRITING_MARK_STATE; 380 go to HANDLE_STATE; 381 382 /* TM_ROLLBACK_WRITING_MARK_STATE */ 383 STATE (44): 384 385 call before_journal_manager_$write_rolled_back_mark (txn_id, txn_index, code); 386 if code ^= 0 then 387 call ERROR_STATE (TM_ROLLBACK_WRITING_MARK_ERROR, code, "bjm_$write_rolled_back_mark"); 388 389 tm_tdt.state (txn_index) = TM_ROLLBACK_UNLOCKING_STATE; 390 go to HANDLE_STATE; 391 392 /* TM_ROLLBACK_UNLOCKING_STATE */ 393 STATE (45): 394 395 call lock_manager_$unlock_all (); 396 397 tm_tdt.state (txn_index) = TM_ROLLBACK_METERING_STATE; 398 go to HANDLE_STATE; 399 400 /* TM_ROLLBACK_METERING_STATE */ 401 STATE (46): 402 403 /* Metering not implemented yet */ 404 405 tm_tdt.state = TM_IN_PROGRESS_STATE; 406 go to RETURN; 407 408 409 /* ERROR STATES */ 410 411 STATE (71): STATE (72): STATE (73): STATE (74): STATE (75): STATE (76): 412 STATE (81): STATE (82): STATE (83): STATE (84): STATE (85): STATE (86): 413 STATE (91): STATE (92): STATE (93): STATE (94): STATE (95): STATE (96): 414 415 go to RETURN; /* nothing to try */ 416 417 418 /* UNASSIGNED STATES */ 419 420 STATE (2): STATE (3): STATE (4): STATE (5): STATE (6): STATE (7): STATE (8): STATE (9): STATE (10): 421 STATE (12): STATE (13): STATE (14): STATE (15): STATE (16): STATE (17): STATE (18): STATE (19): STATE (20): 422 STATE (27): STATE (28): STATE (29): STATE (30): 423 STATE (37): STATE (38): STATE (39): STATE (40): 424 STATE (47): STATE (48): STATE (49): STATE (50): 425 STATE (51): STATE (52): STATE (53): STATE (54): STATE (55): STATE (56): STATE (57): STATE (58): STATE (59): STATE (60): 426 STATE (61): STATE (62): STATE (63): STATE (64): STATE (65): STATE (66): STATE (67): STATE (68): STATE (69): STATE (70): 427 STATE (77): STATE (78): STATE (79): STATE (80): 428 STATE (87): STATE (88): STATE (89): STATE (90): 429 430 state, tm_tdt.state (txn_index) = 0; 431 go to HANDLE_STATE; 432 433 ERROR_STATE: proc (P_state, P_code, P_name); 434 435 dcl P_state fixed bin; 436 dcl P_code fixed bin (35); 437 dcl P_name char (*); 438 439 call tm_error_state (txn_index, P_state, P_code, ME, P_name); 440 441 go to RETURN; 442 443 end ERROR_STATE; 444 445 446 RESTORE_DM_DATA: proc; 447 448 dm_data_$current_txn_index = saved_current_txn_index; 449 dm_data_$current_txn_id = saved_current_txn_id; 450 451 end RESTORE_DM_DATA; 452 453 454 SAVE_DM_DATA: proc; 455 456 saved_current_txn_index = dm_data_$current_txn_index; 457 saved_current_txn_id = dm_data_$current_txn_id; 458 459 end SAVE_DM_DATA; 460 1 1 /* START OF: dm_tm_tdt.incl.pl1 */ 1 2 1 3 /* Transaction Definition Table for transaction_manager_ */ 1 4 /* This structure is used to reference the TDT. The process_id field for the 1 5* i'th TDT entry, for example, is usually referenced as tm_tdt.process_id (i). 1 6* A TDT entry is in use by a process when its process_id field is nonzero. 1 7* An entry is reserved by using the stacq builtin to set process_id, if and 1 8* only if it is already zero. The entry is being used for a transaction when 1 9* tm_tdt.txn_id (i) is nonzero. The possible values of tm_tdt.state (i) are 1 10* listed in dm_tm_states.incl.pl1. If state = 0, no operation has been 1 11* performed yet on the transaction. */ 1 12 1 13 1 14 /* HISTORY: 1 15*Designed by Matt Pierret, 01/26/82. 1 16*Coded by Steve Herbst, 07/27/82. 1 17*Modified: 1 18*08/05/82 by Steve Herbst: Added tm_tdt.operation and padded last_uid to full word. 1 19*08/05/82 by Steve Herbst: Changed creator_process_id to bit (36). 1 20*08/16/82 by Steve Herbst: Added contents of dm_tm_tdt_entry.incl.pl1. 1 21*09/09/82 by Steve Herbst: Removed in_use flag from TDT entry and rearranged fields. 1 22*09/20/82 by Steve Herbst: Removed tm_tdt.operation. 1 23*11/01/82 by Steve Herbst: Added event_channel and error_sw to tm_tdt_entry. 1 24*11/05/82 by Steve Herbst: Added suspended_sw and error_code to tm_tdt_entry. 1 25*11/11/82 by Steve Herbst: Deleted tm_tdt_entry.alloc_complete. 1 26*11/23/82 by Steve Herbst: Compacted, changed some numbers to unsigned. 1 27*12/14/82 by Steve Herbst: Added tm_tdt_entry.daemon_error_sw. 1 28*01/11/83 by Steve Herbst: Added owner_name, abandoned_sw & kill_sw to tm_tdt_entry. 1 29*01/24/83 by Steve Herbst: Replaced daemon_error_sw with daemon_adjust_count. 1 30*01/25/83 by Steve Herbst: Moved abandoned_sw from transaction portion to entry header portion. 1 31*05/13/83 by Steve Herbst: Version 3, changed all fixed bin (18) unal uns numbers to fixed bin (17) unaligned. 1 32*05/26/83 by Steve Herbst: Added rollback_count and checkpoint_id. 1 33**/ 1 34 1 35 dcl tm_tdt_ptr ptr; 1 36 dcl tdt_max_count fixed bin; 1 37 1 38 dcl TM_TDT_VERSION_3 char (8) int static options (constant) init ("TM-TDT 3"); 1 39 1 40 1 41 dcl 1 tm_tdt aligned based (tm_tdt_ptr), 1 42 2 version char (8), /* = "TM-TDT 3" */ 1 43 2 lock fixed bin (71), /* (currently not used) */ 1 44 2 last_uid bit (27) aligned, /* last transaction uid assigned */ 1 45 2 flags, 1 46 3 no_begins bit (1) unaligned, /* ON => only priv process can begin transaction */ 1 47 3 mbz1 bit (35) unaligned, 1 48 2 entry_count fixed bin, /* number of slots allocated */ 1 49 2 mbz2 fixed bin, /* for even word boundary */ 1 50 2 entry (tdt_max_count refer (tm_tdt.entry_count)) 1 51 like tm_tdt_entry; 1 52 1 53 1 54 1 55 /* TDT entries: */ 1 56 1 57 dcl tm_tdt_entry_ptr ptr; 1 58 1 59 dcl 1 tm_tdt_entry aligned based (tm_tdt_entry_ptr), 1 60 2 event_channel fixed bin (71), /* for communication with the process */ 1 61 2 process_id bit (36) aligned, /* process for which this entry is reserved */ 1 62 2 owner_name char (32), /* person.project of owner process */ 1 63 2 entry_flags, 1 64 3 abandoned_sw bit (1) unaligned, /* ON => owner has called tm_$abandon on this entry */ 1 65 3 mbz3 bit (35) unaligned, 1 66 2 transaction unaligned, 1 67 3 txn_id bit (36) aligned, /* unique identifier assigned at begin time */ 1 68 3 date_time_created fixed bin (71) aligned, 1 69 3 mode fixed bin (17) unaligned, /* mode specified with transaction begin */ 1 70 3 state fixed bin (17) unaligned, /* state transaction is currently in */ 1 71 3 error_code fixed bin (35) aligned, /* goes along with error_sw and error state */ 1 72 3 checkpoint_id fixed bin (17) unaligned, /* identifier of the current rollback checkpoint */ 1 73 3 rollback_count fixed bin (17) unaligned, /* number of times bjm_$rollback has been called */ 1 74 3 daemon_adjust_count fixed bin (17) unaligned, /* number of times daemon has tried to adjust since user */ 1 75 3 return_idx fixed bin (17) unaligned, /* parent transaction, or zero */ 1 76 3 flags, 1 77 4 dead_process_sw bit (1) unaligned, /* ON => treat process as dead even if it isn't yet */ 1 78 4 suspended_sw bit (1) unaligned, /* ON => suspended by tm_$suspend_txn */ 1 79 4 error_sw bit (1) unaligned, /* ON => state is one of the error states */ 1 80 4 kill_sw bit (1) unaligned, /* ON => being processed by tm_$kill */ 1 81 4 mbz4 bit (29) unaligned, 1 82 3 post_commit_flags, 1 83 4 (fmgr, 1 84 bjmgr, 1 85 ajmgr) bit (1) unaligned, 1 86 3 mbz4 fixed bin; 1 87 1 88 1 89 /* END OF: dm_tm_tdt.incl.pl1 */ 461 462 2 1 /* START OF: dm_tm_states.incl.pl1 */ 2 2 2 3 /* HISTORY: 2 4* 2 5*Designed by Matthew Pierret, 01/26/82. 2 6*Coded by Steve Herbst, 08/05/82. 2 7*Modified: 2 8*09/20/82 by Steve Herbst: States renames for distinct operations. 2 9*10/05/82 by Steve Herbst: Added TM_ABORT_POST_COMMIT_STATE. 2 10*01/14/83 by Steve Herbst: Added TM_ERROR_INCREMENT. 2 11*01/18/83 by Steve Herbst: Added HIGHEST_ABORT_STATE, etc. 2 12*08/23/84 by Steve Herbst: Added OP_NAME... constants. 2 13**/ 2 14 2 15 2 16 /* NOTE: Changing this file necessitates changes tm_cleanup */ 2 17 2 18 dcl (HIGHEST_STATE init (96), 2 19 LOWEST_ABORT_STATE init (21), 2 20 HIGHEST_ABORT_STATE init (30), 2 21 LOWEST_COMMIT_STATE init (31), 2 22 HIGHEST_COMMIT_STATE init (40), 2 23 LOWEST_ROLLBACK_STATE init (41), 2 24 HIGHEST_ROLLBACK_STATE init (50)) fixed bin int static options (constant); 2 25 2 26 dcl TM_ERROR_INCREMENT fixed bin int static options (constant) init (50); 2 27 /* error state = corresponding pre-call state + 50 */ 2 28 2 29 2 30 dcl ( TM_IN_PROGRESS_STATE init (1), 2 31 2 32 TM_BEGIN_STARTING_STATE init (11), 2 33 2 34 TM_ABORT_FLUSHING_TXN_STATE init (21), 2 35 TM_ABORT_FLUSHING_TXN_ERROR init (71), 2 36 TM_ABORT_ROLLING_BACK_STATE init (22), 2 37 TM_ABORT_ROLLING_BACK_ERROR init (72), 2 38 TM_ABORT_FLUSHING_CI_STATE init (23), 2 39 TM_ABORT_FLUSHING_CI_ERROR init (73), 2 40 TM_ABORT_WRITING_MARK_STATE init (24), 2 41 TM_ABORT_WRITING_MARK_ERROR init (74), 2 42 TM_ABORT_UNLOCKING_STATE init (25), 2 43 TM_ABORT_UNLOCKING_ERROR init (75), 2 44 TM_ABORT_METERING_STATE init (26), 2 45 TM_ABORT_METERING_ERROR init (76), 2 46 2 47 TM_COMMIT_FLUSHING_TXN_STATE init (31), 2 48 TM_COMMIT_FLUSHING_TXN_ERROR init (81), 2 49 TM_COMMIT_FLUSHING_CI_STATE init (32), 2 50 TM_COMMIT_FLUSHING_CI_ERROR init (82), 2 51 TM_COMMIT_WRITING_MARK_STATE init (33), 2 52 TM_COMMIT_WRITING_MARK_ERROR init (83), 2 53 TM_COMMIT_POST_COMMIT_STATE init (34), 2 54 TM_COMMIT_POST_COMMIT_ERROR init (84), 2 55 TM_COMMIT_UNLOCKING_STATE init (35), 2 56 TM_COMMIT_UNLOCKING_ERROR init (85), 2 57 TM_COMMIT_METERING_STATE init (36), 2 58 TM_COMMIT_METERING_ERROR init (86), 2 59 2 60 TM_ROLLBACK_FLUSHING_TXN_STATE init (41), 2 61 TM_ROLLBACK_FLUSHING_TXN_ERROR init (91), 2 62 TM_ROLLBACK_ROLLING_BACK_STATE init (42), 2 63 TM_ROLLBACK_ROLLING_BACK_ERROR init (92), 2 64 TM_ROLLBACK_FLUSHING_CI_STATE init (43), 2 65 TM_ROLLBACK_FLUSHING_CI_ERROR init (93), 2 66 TM_ROLLBACK_WRITING_MARK_STATE init (44), 2 67 TM_ROLLBACK_WRITING_MARK_ERROR init (94), 2 68 TM_ROLLBACK_UNLOCKING_STATE init (45), 2 69 TM_ROLLBACK_UNLOCKING_ERROR init (95), 2 70 TM_ROLLBACK_METERING_STATE init (46), 2 71 TM_ROLLBACK_METERING_ERROR init (96)) 2 72 2 73 fixed bin int static options (constant); 2 74 2 75 dcl (OP_NAME_ABORT init ("abort"), 2 76 OP_NAME_COMMIT init ("commit"), 2 77 OP_NAME_ROLLBACK init ("rollback")) char (32) int static options (constant); 2 78 2 79 /* END OF: dm_tm_states.incl.pl1 */ 463 464 465 466 end tm_cleanup; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 05/06/86 1256.7 tm_cleanup.pl1 >spec>install>1054>tm_cleanup.pl1 461 1 01/07/85 0900.1 dm_tm_tdt.incl.pl1 >ldd>include>dm_tm_tdt.incl.pl1 463 2 01/07/85 0900.1 dm_tm_states.incl.pl1 >ldd>include>dm_tm_states.incl.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. A_tdt_ptr parameter pointer dcl 70 ref 18 121 128 133 A_txn_index parameter fixed bin(17,0) dcl 71 ref 18 122 128 134 HIGHEST_STATE constant fixed bin(17,0) initial dcl 2-18 ref 182 ME 000154 constant char(32) initial unaligned dcl 76 set ref 439* P_code parameter fixed bin(35,0) dcl 436 set ref 433 439* P_name parameter char unaligned dcl 437 set ref 433 439* P_state parameter fixed bin(17,0) dcl 435 set ref 433 439* TM_ABORT_FLUSHING_CI_ERROR 000151 constant fixed bin(17,0) initial dcl 2-30 set ref 244* TM_ABORT_FLUSHING_CI_STATE constant fixed bin(17,0) initial dcl 2-30 ref 173 237 TM_ABORT_FLUSHING_TXN_ERROR 000153 constant fixed bin(17,0) initial dcl 2-30 set ref 221* TM_ABORT_FLUSHING_TXN_STATE constant fixed bin(17,0) initial dcl 2-30 ref 169 TM_ABORT_METERING_STATE constant fixed bin(17,0) initial dcl 2-30 ref 267 TM_ABORT_ROLLING_BACK_ERROR 000152 constant fixed bin(17,0) initial dcl 2-30 set ref 231* TM_ABORT_ROLLING_BACK_STATE constant fixed bin(17,0) initial dcl 2-30 ref 173 224 TM_ABORT_UNLOCKING_STATE constant fixed bin(17,0) initial dcl 2-30 ref 258 TM_ABORT_WRITING_MARK_ERROR 000150 constant fixed bin(17,0) initial dcl 2-30 set ref 255* TM_ABORT_WRITING_MARK_STATE constant fixed bin(17,0) initial dcl 2-30 ref 248 TM_COMMIT_FLUSHING_CI_ERROR 000146 constant fixed bin(17,0) initial dcl 2-30 set ref 293* TM_COMMIT_FLUSHING_CI_STATE constant fixed bin(17,0) initial dcl 2-30 ref 169 286 TM_COMMIT_FLUSHING_TXN_ERROR 000147 constant fixed bin(17,0) initial dcl 2-30 set ref 283* TM_COMMIT_FLUSHING_TXN_STATE constant fixed bin(17,0) initial dcl 2-30 ref 169 TM_COMMIT_METERING_STATE constant fixed bin(17,0) initial dcl 2-30 ref 336 TM_COMMIT_POST_COMMIT_STATE constant fixed bin(17,0) initial dcl 2-30 ref 306 TM_COMMIT_UNLOCKING_STATE constant fixed bin(17,0) initial dcl 2-30 ref 310 TM_COMMIT_WRITING_MARK_ERROR 000145 constant fixed bin(17,0) initial dcl 2-30 set ref 303* TM_COMMIT_WRITING_MARK_STATE constant fixed bin(17,0) initial dcl 2-30 ref 296 TM_ERROR_INCREMENT constant fixed bin(17,0) initial dcl 2-26 ref 144 144 TM_IN_PROGRESS_STATE constant fixed bin(17,0) initial dcl 2-30 ref 401 TM_ROLLBACK_FLUSHING_CI_ERROR 000142 constant fixed bin(17,0) initial dcl 2-30 set ref 375* TM_ROLLBACK_FLUSHING_CI_STATE constant fixed bin(17,0) initial dcl 2-30 ref 176 368 TM_ROLLBACK_FLUSHING_TXN_ERROR 000144 constant fixed bin(17,0) initial dcl 2-30 set ref 352* TM_ROLLBACK_METERING_STATE constant fixed bin(17,0) initial dcl 2-30 ref 397 TM_ROLLBACK_ROLLING_BACK_ERROR 000143 constant fixed bin(17,0) initial dcl 2-30 set ref 362* TM_ROLLBACK_ROLLING_BACK_STATE constant fixed bin(17,0) initial dcl 2-30 ref 176 355 TM_ROLLBACK_UNLOCKING_STATE constant fixed bin(17,0) initial dcl 2-30 ref 389 TM_ROLLBACK_WRITING_MARK_ERROR 000141 constant fixed bin(17,0) initial dcl 2-30 set ref 386* TM_ROLLBACK_WRITING_MARK_STATE constant fixed bin(17,0) initial dcl 2-30 ref 379 before_journal_manager_$flush_transaction 000024 constant entry external dcl 100 ref 218 280 349 before_journal_manager_$rollback 000026 constant entry external dcl 101 ref 228 359 before_journal_manager_$write_aborted_mark 000030 constant entry external dcl 102 ref 252 before_journal_manager_$write_committed_mark 000032 constant entry external dcl 103 ref 300 before_journal_manager_$write_rolled_back_mark 000034 constant entry external dcl 104 ref 383 checkpoint_id 32 based fixed bin(17,0) array level 4 packed unaligned dcl 1-41 set ref 234* 365* cleanup 000110 stack reference condition dcl 117 ref 124 136 154 code 000107 automatic fixed bin(35,0) dcl 87 set ref 218* 221 221* 228* 231 231* 241* 244 244 244* 252* 255 255* 280* 283 283* 290* 293 293* 300* 303 303* 349* 352 352* 359* 362 362* 372* 375 375 375* 383* 386 386* daemon_sw 000103 automatic bit(1) unaligned dcl 85 set ref 158* dm_data_$current_txn_id 000010 external static bit(36) dcl 91 set ref 138* 189* 204* 449* 457 dm_data_$current_txn_index 000012 external static fixed bin(17,0) dcl 92 set ref 186 190* 200 204 448* 456 dm_data_$my_tdt_index 000014 external static fixed bin(17,0) dcl 93 ref 152 dm_data_$tm_tdt_ptr 000016 external static pointer dcl 94 ref 151 dm_error_$file_was_deleted 000020 external static fixed bin(35,0) dcl 95 ref 244 375 dm_system_data_$initializer_processid 000022 external static bit(36) unaligned dcl 96 ref 158 entry 10 based structure array level 2 dcl 1-41 entry_count 6 based fixed bin(17,0) level 2 dcl 1-41 ref 401 error_code 31 based fixed bin(35,0) array level 4 dcl 1-41 set ref 142* error_sw 34(02) based bit(1) array level 5 packed unaligned dcl 1-41 set ref 140 141* file_manager_$flush_modified_ci 000042 constant entry external dcl 107 ref 241 290 372 file_manager_$post_transaction 000044 constant entry external dcl 108 ref 262 331 flags 34 based structure array level 4 packed unaligned dcl 1-41 get_process_id_ 000036 constant entry external dcl 105 ref 156 lock_manager_$unlock_all 000040 constant entry external dcl 106 ref 265 334 393 process_id 12 based bit(36) array level 3 in structure "tm_tdt" dcl 1-41 in procedure "tm_cleanup" ref 166 process_id 000100 automatic bit(36) dcl 84 in procedure "tm_cleanup" set ref 156* 158 166 rollback_count 32(18) based fixed bin(17,0) array level 4 packed unaligned dcl 1-41 set ref 235* 235 366* 366 saved_current_txn_id 000101 automatic bit(36) dcl 84 set ref 449 457* saved_current_txn_index 000104 automatic fixed bin(17,0) dcl 86 set ref 448 456* state 30(18) based fixed bin(17,0) array level 4 in structure "tm_tdt" packed unaligned dcl 1-41 in procedure "tm_cleanup" set ref 144 144* 144 169 169 169* 173 173* 176 176* 180 182* 211* 224* 237* 248* 258* 267* 271* 286* 296* 306* 310* 336* 340* 355* 368* 379* 389* 397* 401* 420* state 000105 automatic fixed bin(17,0) dcl 86 in procedure "tm_cleanup" set ref 180* 182 182 182* 183 420* tm_error_state 000046 constant entry external dcl 109 ref 439 tm_tdt based structure level 1 dcl 1-41 tm_tdt_entry based structure level 1 dcl 1-59 tm_tdt_ptr 000116 automatic pointer dcl 1-35 set ref 121* 133* 138 140 141 142 144 144 144 151* 160 166 169 169 169 173 173 176 176 180 182 193 204 211 224 234 235 235 237 248 258 267 271 286 296 306 310 336 340 355 365 366 366 368 379 389 397 401 420 transaction 24 based structure array level 3 unaligned dcl 1-41 set ref 193* txn_id 24 based bit(36) array level 4 in structure "tm_tdt" dcl 1-41 in procedure "tm_cleanup" set ref 138 160 204 txn_id 000102 automatic bit(36) dcl 84 in procedure "tm_cleanup" set ref 160* 161 218* 228* 241* 252* 280* 290* 300* 349* 359* 372* 383* txn_index 000106 automatic fixed bin(17,0) dcl 86 set ref 122* 134* 138 140 141 142 144 144 144 152* 160 166 169 169 169 173 173 176 176 180 182 193 211 218* 224 228* 234 235 235 237 241* 248 252* 258 267 271 280* 286 290* 296 300* 306 310 336 340 349* 355 359* 365 366 366 368 372* 379 383* 389 397 420 439* unspec builtin function dcl 113 set ref 193* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. HIGHEST_ABORT_STATE internal static fixed bin(17,0) initial dcl 2-18 HIGHEST_COMMIT_STATE internal static fixed bin(17,0) initial dcl 2-18 HIGHEST_ROLLBACK_STATE internal static fixed bin(17,0) initial dcl 2-18 LOWEST_ABORT_STATE internal static fixed bin(17,0) initial dcl 2-18 LOWEST_COMMIT_STATE internal static fixed bin(17,0) initial dcl 2-18 LOWEST_ROLLBACK_STATE internal static fixed bin(17,0) initial dcl 2-18 OP_NAME_ABORT internal static char(32) initial unaligned dcl 2-75 OP_NAME_COMMIT internal static char(32) initial unaligned dcl 2-75 OP_NAME_ROLLBACK internal static char(32) initial unaligned dcl 2-75 TM_ABORT_METERING_ERROR internal static fixed bin(17,0) initial dcl 2-30 TM_ABORT_UNLOCKING_ERROR internal static fixed bin(17,0) initial dcl 2-30 TM_BEGIN_STARTING_STATE internal static fixed bin(17,0) initial dcl 2-30 TM_COMMIT_METERING_ERROR internal static fixed bin(17,0) initial dcl 2-30 TM_COMMIT_POST_COMMIT_ERROR internal static fixed bin(17,0) initial dcl 2-30 TM_COMMIT_UNLOCKING_ERROR internal static fixed bin(17,0) initial dcl 2-30 TM_ROLLBACK_FLUSHING_TXN_STATE internal static fixed bin(17,0) initial dcl 2-30 TM_ROLLBACK_METERING_ERROR internal static fixed bin(17,0) initial dcl 2-30 TM_ROLLBACK_UNLOCKING_ERROR internal static fixed bin(17,0) initial dcl 2-30 TM_TDT_VERSION_3 internal static char(8) initial unaligned dcl 1-38 tdt_max_count automatic fixed bin(17,0) dcl 1-36 tm_tdt_entry_ptr automatic pointer dcl 1-57 NAMES DECLARED BY EXPLICIT CONTEXT. COMMON 000437 constant label dcl 156 ref 126 147 ERROR_STATE 001447 constant entry internal dcl 433 ref 221 231 244 255 283 293 303 352 362 375 386 HANDLE_STATE 000520 constant label dcl 180 ref 161 214 225 238 249 259 268 276 287 297 307 328 337 345 356 369 380 390 398 431 RESTORE_DM_DATA 001514 constant entry internal dcl 446 ref 124 136 154 194 RETURN 000554 constant label dcl 194 ref 207 406 411 441 SAVE_DM_DATA 001527 constant entry internal dcl 454 ref 123 135 153 STATE 000000 constant label array(0:96) dcl 186 ref 183 crawlout 000401 constant entry external dcl 149 restart_error 000313 constant entry external dcl 128 tm_cleanup 000252 constant entry external dcl 18 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 2304 2354 1771 2314 Length 2634 1771 50 243 313 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME tm_cleanup 142 external procedure is an external procedure. on unit on line 124 64 on unit on unit on line 136 64 on unit on unit on line 154 64 on unit ERROR_STATE internal procedure shares stack frame of external procedure tm_cleanup. RESTORE_DM_DATA 64 internal procedure is called by several nonquick procedures. SAVE_DM_DATA internal procedure shares stack frame of external procedure tm_cleanup. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME tm_cleanup 000100 process_id tm_cleanup 000101 saved_current_txn_id tm_cleanup 000102 txn_id tm_cleanup 000103 daemon_sw tm_cleanup 000104 saved_current_txn_index tm_cleanup 000105 state tm_cleanup 000106 txn_index tm_cleanup 000107 code tm_cleanup 000116 tm_tdt_ptr tm_cleanup THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_e_as call_ext_out_desc call_ext_out call_int_this call_int_other return enable ext_entry int_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. before_journal_manager_$flush_transaction before_journal_manager_$rollback before_journal_manager_$write_aborted_mark before_journal_manager_$write_committed_mark before_journal_manager_$write_rolled_back_mark file_manager_$flush_modified_ci file_manager_$post_transaction get_process_id_ lock_manager_$unlock_all tm_error_state THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. dm_data_$current_txn_id dm_data_$current_txn_index dm_data_$my_tdt_index dm_data_$tm_tdt_ptr dm_error_$file_was_deleted dm_system_data_$initializer_processid LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 18 000246 121 000257 122 000263 123 000265 124 000266 126 000310 128 000311 133 000320 134 000324 135 000326 136 000327 138 000351 140 000357 141 000362 142 000364 144 000365 147 000377 149 000400 151 000406 152 000412 153 000414 154 000415 156 000437 158 000450 160 000454 161 000461 166 000462 169 000466 173 000503 176 000512 180 000520 182 000530 183 000540 186 000542 189 000545 190 000546 193 000547 194 000554 196 000560 200 000561 204 000564 207 000567 211 000570 214 000574 218 000575 221 000610 224 000623 225 000631 228 000632 231 000650 234 000661 235 000667 237 000676 238 000701 241 000702 244 000715 248 000733 249 000741 252 000742 255 000755 258 000770 259 000776 262 000777 265 001004 267 001011 268 001017 271 001020 276 001024 280 001025 283 001040 286 001053 287 001061 290 001062 293 001075 296 001110 297 001116 300 001117 303 001132 306 001142 307 001150 310 001151 328 001155 331 001156 334 001163 336 001170 337 001176 340 001177 345 001203 349 001204 352 001217 355 001232 356 001240 359 001241 362 001257 365 001270 366 001276 368 001305 369 001310 372 001311 375 001324 379 001342 380 001350 383 001351 386 001364 389 001374 390 001402 393 001403 397 001410 398 001416 401 001417 406 001437 411 001440 420 001441 431 001446 433 001447 439 001460 441 001512 446 001513 448 001521 449 001524 451 001526 454 001527 456 001530 457 001533 459 001535 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved