Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99e-bb - mndany.f06
There are 10 other files named mndany.f06 in the archive. Click here to see a list.
;******************** START OF DBMS10-V5A EDIT 602 *************************
;
; [SYMPTOM]
; 
;      DBMEND commands which require positioning to the end of
; the journal can fail with the diagnostic:
; 
;    ?MNDFAE UNABLE TO: START READING FROM LAST CHUNK IN JOURNAL
; 
; This can easily happen  with  a  large  journal  (over  6000
; blocks) which has been closed such that the journal has been
; overwritten (only the label page has valid  information  for
; the current sequence).
; 
; [DIAGNOSIS]
; 
;      A binary search algorithm is implemented to locate  the
; last  page  in the journal with the current journal sequence
; number.  The search starts with a  range  the  size  of  the
; whole  journal,  and  repeatidly halves the range during the
; process of the search.  The search terminates when the range
; is  3  pages or less, allowing a short serial backwards walk
; to  definitively  locate  the  desired   last   used   page.
; Unfortunately   the   range  'extent'  value  is  maintained
; independently of the  actual  range  size  between  any  two
; points  which  are being searched, and it is also rounded up
; for odd length extents in an effort  to  prevent  collapsing
; too fast because of truncation when the extent is divided by
; 2.  The combination of these aspects of  the  algorithm  can
; result  in  an  extent value which is larger than the actual
; range size between any two points, and  if  the  search  has
; been   entirely   uni-directional,   can  easily  result  in
; computing a block number which is outside  the  valid  block
; numbers  for  the  file (either less than 1, or greater than
; the largest allocated).  It is  this  last  situation  which
; produces the MNDFAE diagnostic.
; 
; [CURE]
; 
;      Rework the binary algorithm slightly to  recompute  the
; search extent based on the end points of a particular search
; range.  This causes slightly slower convergence towards  the
; desired  point  of  the  file  (and a few extra reads in the
; process), but it will always work, regardless of the size of
; the file, or the direction of the search.
;
;*************** EDIT THE FOLLOWING INTO FILE 602.FIX *********************
.EDIT 602
.NAME EGM
.DATE 21-Mar-83
.MODULE DBMEND
	LOPAGE==R4					;[602] LOW PAGE OF RANGE
	HIPAGE==R5					;[602] HI PAGE OF RANGE
.INSERT INISEARCH+24,BEFORE,<LSH PAGNUM,-1>
	PUSH	P,LOPAGE				;[602] SAVE ACS
	PUSH	P,HIPAGE				;[602]
	SETZ	LOPAGE,					;[602] LOWEST PAGE - 1
	MOVE	HIPAGE,PAGNUM				;[602] VERY LAST PAGE
.ENDI
.INSERT ISR.LP+21,REPLACE:2,<CAIG VERGFAC,3>
	CAME	LABSEQ,JR.LOOK+JP.SEQ			;[602] IF OLD SEQUENCE
	SKIPA	HIPAGE,PAGNUM				;[602] DECREASE HI END
	JRST	[MOVE	LOPAGE,PAGNUM			;[602] ELSE INCREASE LOW
		 SUBI	LOPAGE,1			;[602]  END OF RANGE
		 JRST	.+1]				;[602]
	MOVE	VERGFAC,HIPAGE				;[602] DETERMINE NEW
	SUB	VERGFAC,LOPAGE				;[602]  RANGE SIZE
	CAIG	VERGFAC,3				;HAS RANGE SHRUNK TO MIN
	JRST	[POP	P,HIPAGE			;[602] YES, FREE ACS
		 POP	P,LOPAGE			;[602]
		 CAME	LABSEQ,JR.LOOK+JP.SEQ		;[602] GET RIGHT PAGE
		 SOJA	PAGNUM,POP$A			;PAST EOJ, USE PRIOR
		 ADDI	PAGNUM,-1(VERGFAC)		;IN J, MAKE SURE PAST
		 POPJ	P,]
.ENDI
.INSERT ISR.LP+26,REPLACE:4,<CAMN LABSEQ,JR.LOOK+JP.SEQ>
	MOVE	PAGNUM,LOPAGE				;[602] FROM LOW PAGE -1
	ADD	PAGNUM,VERGFAC				;[602] TO MID RANGE
.ENDI
.ENDE
;***************************** CAUTION *************************************
;
;		TO AVOID LOSING ANY PREVIOUS PATCHES  BE
;		SURE TO USE THE LATEST PATCHED REL FILES
;		       AS A BASE FOR THIS EDIT.
;THIS PATCH AFFECTS THE FOLLOWING:
;DBMS COMPONENTS:
;	DBMEND
;
;LANGUAGE INTERFACES:
;	NONE
;	------------------ TO INSTALL THIS EDIT ------------------
;
;	.RUN SYS:MAKLIB
;	*MNDANY.REL=MNDANY.REL,602.FIX/F
;	*/EXIT
;	.RUN SYS:LINK
;	*@DBMEN1.CMD		;FROM DBMS-10 DISTRIBUTION TAPE
;	.SSAVE DBMEND
;
;************************** END OF EDIT 602 *******************************