Binary file . matches
.
all: postgres $(POSTGRES_IMP) global1.bki.source local1_template1.bki.source \
global1.bki.source local1_template1.bki.source \
catalog/global1.bki.source catalog/local1_template1.bki.source \
	    global1.bki.source local1_template1.bki.source \
# make a link as "postmaster".  Install the bki files templates and sample 
# (History:  Before Release 2, make install generated a bki.source file
# and then used build parameters to convert it to a bki file, then installed
# that bki file in the /files subdirectory of the default data directory.
# Initdb then used the bki file to generate the database catalog classes.
         global1.bki.source local1_template1.bki.source \
	$(INSTALL) $(INSTLOPTS) global1.bki.source \
	  $(LIBDIR)/global1.bki.source
	$(INSTALL) $(INSTLOPTS) local1_template1.bki.source \
	  $(LIBDIR)/local1_template1.bki.source
./Makefile
	BlockNumber lbknum,
				rbknum;
		lbknum = BufferGetBlockNumber(leftbuf);
		lbknum = BufferGetBlockNumber(buffer);
	rbknum = BufferGetBlockNumber(rightbuf);
		ItemPointerSet(&(res->pointerData), lbknum, leftoff);
		ItemPointerSet(&(res->pointerData), rbknum, rightoff);
	ItemPointerSet(&(ltup->t_tid), lbknum, 1);
	ItemPointerSet(&(rtup->t_tid), rbknum, 1);
./access/gist/gist.c
	BlockNumber lbknum,
				rbknum;
		lbknum = BufferGetBlockNumber(leftbuf);
		lbknum = BufferGetBlockNumber(buffer);
	rbknum = BufferGetBlockNumber(rightbuf);
		ItemPointerSet(&(res->pointerData), lbknum, leftoff);
		ItemPointerSet(&(res->pointerData), rbknum, rightoff);
	ItemPointerSet(&(ltup->t_tid), lbknum, 1);
	ItemPointerSet(&(rtup->t_tid), rbknum, 1);
./access/gist/gist.c%
	/* bk only set locks for relation level lock and systems tables */
	/* bk: for ricardo: no locks on relations */
					/* bk: we have a new lock type */
					/* bk: bettina for ricardo: do not set this lock */
	/* bk: also remote txn should not set write locks on relations anymore */
					/* bk: we have a new lock type */
					/* bk: for ricardo: do not set this lock here */
		/* bk: also remote txn should not set write locks on relations anymore at this stage */
					/* bk: we have a new lock type */
					/* bk for ricardo: do not set this lock here */
	/* bk also remote txn should not set relation level locks at this stage */
./access/heap/heapam.c
	/* bk only set locks for relation level lock and systems tables */
	/* bk: for ricardo: no locks on relations */
					/* bk: we have a new lock type */
					/* bk: bettina for ricardo: do not set this lock */
	/* bk: also remote txn should not set write locks on relations anymore */
					/* bk: we have a new lock type */
					/* bk: for ricardo: do not set this lock here */
		/* bk: also remote txn should not set write locks on relations anymore at this stage */
					/* bk: we have a new lock type */
					/* bk for ricardo: do not set this lock here */
	/* bk also remote txn should not set relation level locks at this stage */
./access/heap/heapam.c%
		BlockNumber rbknum;
		BlockNumber bknum = BufferGetBlockNumber(buf);
									   bknum, P_HIKEY);
			rbknum = BufferGetBlockNumber(rbuf);
			ItemPointerSet(&(new_item->bti_itup.t_tid), rbknum, P_HIKEY);
						   bknum, P_HIKEY);
								   bknum, P_HIKEY);
	BlockNumber lbkno,
				rbkno;
	BlockNumber rootbknum;
	lbkno = BufferGetBlockNumber(lbuf);
	rbkno = BufferGetBlockNumber(rbuf);
	ItemPointerSet(&(new_item->bti_itup.t_tid), lbkno, P_HIKEY);
	ItemPointerSet(&(new_item->bti_itup.t_tid), rbkno, P_HIKEY);
	rootbknum = BufferGetBlockNumber(rootbuf);
	_bt_metaproot(rel, rootbknum, 0);
	BlockNumber bknum;
	BlockNumber nbknum;
	nbknum = BufferGetBlockNumber(nbuf);
	pageop->btpo_next = nbknum; /* next points to the new page */
	npageop->btpo_prev = bknum = BufferGetBlockNumber(buf);
	ItemPointerSet(&(btitem->bti_itup.t_tid), bknum, P_HIKEY);
		rpageop->btpo_prev = nbknum;
				   bknum, P_HIKEY);
	ItemPointerSet(&(nitem->bti_itup.t_tid), nbknum, P_HIKEY);
	ItemPointerSet(&(stack->bts_btitem->bti_itup.t_tid), nbknum, P_HIKEY);
	ItemPointerSet(&(res->pointerData), nbknum, P_HIKEY);
./access/nbtree/nbtinsert.c
_bt_metaproot(Relation rel, BlockNumber rootbknum, int level)
	metad->btm_root = rootbknum;
./access/nbtree/nbtpage.c
	BlockNumber obknum;
				obknum = BufferGetBlockNumber(*bufP);
					while (opaque->btpo_next != obknum)
						obknum = BufferGetBlockNumber(*bufP);
./access/nbtree/nbtsearch.c
	BlockNumber obknum;
				obknum = BufferGetBlockNumber(*bufP);
					while (opaque->btpo_next != obknum)
						obknum = BufferGetBlockNumber(*bufP);
./access/nbtree/nbtsearch.c%
_bt_metaproot(Relation rel, BlockNumber rootbknum, int level)
	metad->btm_root = rootbknum;
./access/nbtree/nbtpage.c%
		BlockNumber rbknum;
		BlockNumber bknum = BufferGetBlockNumber(buf);
									   bknum, P_HIKEY);
			rbknum = BufferGetBlockNumber(rbuf);
			ItemPointerSet(&(new_item->bti_itup.t_tid), rbknum, P_HIKEY);
						   bknum, P_HIKEY);
								   bknum, P_HIKEY);
	BlockNumber lbkno,
				rbkno;
	BlockNumber rootbknum;
	lbkno = BufferGetBlockNumber(lbuf);
	rbkno = BufferGetBlockNumber(rbuf);
	ItemPointerSet(&(new_item->bti_itup.t_tid), lbkno, P_HIKEY);
	ItemPointerSet(&(new_item->bti_itup.t_tid), rbkno, P_HIKEY);
	rootbknum = BufferGetBlockNumber(rootbuf);
	_bt_metaproot(rel, rootbknum, 0);
	BlockNumber bknum;
	BlockNumber nbknum;
	nbknum = BufferGetBlockNumber(nbuf);
	pageop->btpo_next = nbknum; /* next points to the new page */
	npageop->btpo_prev = bknum = BufferGetBlockNumber(buf);
	ItemPointerSet(&(btitem->bti_itup.t_tid), bknum, P_HIKEY);
		rpageop->btpo_prev = nbknum;
				   bknum, P_HIKEY);
	ItemPointerSet(&(nitem->bti_itup.t_tid), nbknum, P_HIKEY);
	ItemPointerSet(&(stack->bts_btitem->bti_itup.t_tid), nbknum, P_HIKEY);
	ItemPointerSet(&(res->pointerData), nbknum, P_HIKEY);
./access/nbtree/nbtinsert.c%
	BlockNumber lbknum,
				rbknum;
		lbknum = BufferGetBlockNumber(leftbuf);
		lbknum = BufferGetBlockNumber(buffer);
	rbknum = BufferGetBlockNumber(rightbuf);
		ItemPointerSet(&(res->pointerData), lbknum, leftoff);
		ItemPointerSet(&(res->pointerData), rbknum, rightoff);
	ItemPointerSet(&(ltup->t_tid), lbknum, 1);
	ItemPointerSet(&(rtup->t_tid), rbknum, 1);
./access/rtree/rtree.c
	BlockNumber lbknum,
				rbknum;
		lbknum = BufferGetBlockNumber(leftbuf);
		lbknum = BufferGetBlockNumber(buffer);
	rbknum = BufferGetBlockNumber(rightbuf);
		ItemPointerSet(&(res->pointerData), lbknum, leftoff);
		ItemPointerSet(&(res->pointerData), rbknum, rightoff);
	ItemPointerSet(&(ltup->t_tid), lbknum, 1);
	ItemPointerSet(&(rtup->t_tid), rbknum, 1);
./access/rtree/rtree.c%
#include <utils/backend_stats.h>  /* (bk): statistics */
 /* bk bk bk */
	 *	(wb) Mark aborted reading txn's in case of remote bknd
	//EndPortalAllocMode();   /* bk: check whether this works */
		/* bk: might be called twice because of funny race condition, but only execute once */
	/* bk: with funny race conditions, abort can be called twice 
		/* bk: optimistic must remove this part */
	AtAbort_CatCache();    /* bk: set cachdisabled to false -> */
			/* (bk) statistic collection */
			/* bk: put to global statistics */
	/* bk */
		/* bk: now disconnect only at process termination */
./access/transam/xact.c
#include <utils/backend_stats.h>  /* (bk): statistics */
 /* bk bk bk */
	 *	(wb) Mark aborted reading txn's in case of remote bknd
	//EndPortalAllocMode();   /* bk: check whether this works */
		/* bk: might be called twice because of funny race condition, but only execute once */
	/* bk: with funny race conditions, abort can be called twice 
		/* bk: optimistic must remove this part */
	AtAbort_CatCache();    /* bk: set cachdisabled to false -> */
			/* (bk) statistic collection */
			/* bk: put to global statistics */
	/* bk */
		/* bk: now disconnect only at process termination */
./access/transam/xact.c%
Binary file ./catalog matches
./catalog
/genbki.sh/1.1.1.1.8.3/Fri Dec 17 16:33:27 1999//TOptimistic
/genbki.sh.in/1.1.1.1/Wed Apr 14 17:25:05 1999//TOptimistic
./catalog/CVS/Entries
# genbki.sh--
#    shell script which generates .bki files from specially formatted .h
#    files.  These .bki files are used to initialize the postgres template
#    $Header: /home/postgres/cvs_root/postgres-r/src/backend/a,v 1.1.1.1 2001/05/25 14:29:48 postgres Exp $
trap "rm -f /tmp/genbki.tmp /tmp/genbkitmp.c" 0 1 2 3 15
>/tmp/genbki.tmp
#	the .bki file...
			printf "%d	%s\n", oid, data >> "/tmp/genbki.tmp";
#  if this is the last line, then output the bki catalog stuff.
' >/tmp/genbkitmp.c
@CPP@ $BKIOPTS /tmp/genbkitmp.c | \
cat /tmp/genbki.tmp 1>&2
./catalog/genbki.sh.in
all: SUBSYS.o global1.bki.source local1_template1.bki.source \
GENBKI= ./genbki.sh
global1.bki.source: $(GENBKI) $(GLOBALBKI_SRCS)
local1_template1.bki.source: $(GENBKI) $(LOCALBKI_SRCS)
	rm -f SUBSYS.o $(OBJS) global1.bki.source local1_template1.bki.source \
./catalog/Makefile
When the compile-time scripts (such as Gen_fmgrtab.sh and genbki.sh)
these in order to generate the .bki files.  The .bki files are then
clause of the .bki insert statement.  If no such pointers are required
./catalog/README
# genbki.sh--
#    shell script which generates .bki files from specially formatted .h
#    files.  These .bki files are used to initialize the postgres template
#    $Header: /home/postgres/cvs_root/postgres-r/src/backend/a,v 1.1.1.1 2001/05/25 14:29:48 postgres Exp $
trap "rm -f /tmp/genbki.tmp /tmp/genbkitmp.c" 0 1 2 3 15
>/tmp/genbki.tmp
#	the .bki file...
			printf "%d	%s\n", oid, data >> "/tmp/genbki.tmp";
#  if this is the last line, then output the bki catalog stuff.
' >/tmp/genbkitmp.c
gcc -E $BKIOPTS /tmp/genbkitmp.c | \
cat /tmp/genbki.tmp 1>&2
./catalog/genbki.sh
			/* bk: instead set a write lock on the key value */
		/* bk: do write lock on index now always */
		/* bk: fast hack - hack: make a write lock on all indices to write */
	/* bk: do it for ricardo: unselt lock on index */
		/* bk: fast hack - hack: make a write lock on all indices to write */
	/* bk: this should be somewhere a changable constant, when we set relation lock instead of tuple lock at queries */
	 /* bk */
			/* (bk) hack - hack: set once a relation lock on index to avoid deadlocks */
			/* bk for ricardo: set lock anyway */
				 * the insert, or else it would not have included it in the write set. Since this bknd is
				 * the delete, or else it would not have included it in the write set. Since this bknd is
	/* (bk) hack - hack: set once a relation lock on index to avoid deadlocks */
	/* bk for ricardo: have set the lock -- now i must unset it */
./executor/execMain.c
			/* bk: instead set a write lock on the key value */
		/* bk: do write lock on index now always */
		/* bk: fast hack - hack: make a write lock on all indices to write */
	/* bk: do it for ricardo: unselt lock on index */
		/* bk: fast hack - hack: make a write lock on all indices to write */
	/* bk: this should be somewhere a changable constant, when we set relation lock instead of tuple lock at queries */
	 /* bk */
			/* (bk) hack - hack: set once a relation lock on index to avoid deadlocks */
			/* bk for ricardo: set lock anyway */
				 * the insert, or else it would not have included it in the write set. Since this bknd is
				 * the delete, or else it would not have included it in the write set. Since this bknd is
	/* (bk) hack - hack: set once a relation lock on index to avoid deadlocks */
	/* bk for ricardo: have set the lock -- now i must unset it */
./executor/execMain.c%
					   int which_subkey);
		   int which_subkey);
static List *new_join_pathkey(List *subkeys,
				 List *considered_subkeys, List *join_rel_tlist,
static List *new_matching_subkeys(Var *subkey, List *considered_subkeys,
 * 'which-subkey' is a flag that selects the desired subkey of a join key
						int which_subkey,
			match_pathkey_joinkeys(pathkey, joinkeys, which_subkey);
 *	  outer or inner subkey matches any subkey of 'pathkey'.
					   int which_subkey)
	Var		   *path_subkey;
		path_subkey = (Var *) lfirst(i);
			if (var_equal(path_subkey,
						  extract_subkey(jk, which_subkey)))
 *	  2. each subkey of a given path must match(i.e., be(var_equal) to) the
 *		 appropriate subkey of the corresponding join key in 'joinkeys',
 *		 i.e., the Nth path key must match its subkeys against the subkey of
 * 'which-subkey' is a flag that selects the desired subkey of a join key
every_func(List *joinkeys, List *pathkey, int which_subkey)
			tempkey = extract_subkey(xjoinkey, which_subkey);
					 int which_subkey)
		key_match = every_func(joinkeys, path->keys, which_subkey);
 *	  Builds a subkey list for a path by pulling one of the subkeys from
 *	  target list 'tlist' that corresponds to that subkey.
 * 'which-subkey' is a flag that selects the desired subkey of a join key
				  int which_subkey)
		var = (Var *) extract_subkey(jkey, which_subkey);
 *	  Finds new vars that become subkeys due to qualification clauses that
 *	  contain any previously considered subkeys.  These new subkeys plus the
 *	  subkeys from 'subkeys' form a new pathkey for the join relation.
 *	  Note that each returned subkey is the var node found in
 * 'subkeys' is a list of subkeys for which matching subkeys are to be
 * 'considered-subkeys' is the current list of all subkeys corresponding
 * Returns a new pathkey(list of subkeys).
new_join_pathkey(List *subkeys,
				 List *considered_subkeys,
	Var		   *subkey;
	List	   *matched_subkeys = NIL;
	List	   *newly_considered_subkeys = NIL;
	foreach(i, subkeys)
		subkey = (Var *) lfirst(i);
		if (subkey == NULL)
		matched_subkeys =
			new_matching_subkeys(subkey, considered_subkeys,
		tlist_key = matching_tlvar(subkey, join_rel_tlist);
		newly_considered_subkeys = NIL;
			if (!member(tlist_key, matched_subkeys))
				newly_considered_subkeys = lcons(tlist_key,
												 matched_subkeys);
			newly_considered_subkeys = matched_subkeys;
		considered_subkeys =
			append(considered_subkeys, newly_considered_subkeys);
		t_list = nconc(t_list, newly_considered_subkeys);
 * new-matching-subkeys--
 *	  Returns a list of new subkeys:
 *	  (1) which are not listed in 'considered-subkeys'
 *		  'subkey'
 *	  Note that each returned subkey is the var node found in
 * 'subkey' is the var node for which we are trying to find matching
 * Returns a list of new subkeys.
new_matching_subkeys(Var *subkey,
					 List *considered_subkeys,
			matching_tlvar(other_join_clause_var(subkey, joinclause),
			!(member(tlist_other_var, considered_subkeys)))
			considered_subkeys = lappend(considered_subkeys,
			 * considered_subkeys = nreverse(considered_subkeys); XXX -- I
./optimizer/path/joinutils.c
 *		(subkey1 ... subkeyN)
 *		where subkeyI is a var node
 *		(outer-subkey inner-subkey)
 *				where each subkey is a var node
 * extract-subkey--
 *	 Returns the subkey in a join key corresponding to the outer or inner
extract_subkey(JoinKey *jk, int which_subkey)
	switch (which_subkey)
			elog(DEBUG, "extract_subkey with neither INNER or OUTER");
 *	  equivalent if the first subkey (var node) within each sublist of
 *	  Creates a list of subkeys by retrieving var nodes corresponding to
 *	  and is thrown away.  The returned subkey list is of the form:
 * Returns the list of cons'd subkeys.
./optimizer/util/keys.c
	{"statistics", STATISTICS},  /* bk: for backend statistics */
./parser/keywords.c
 *      (bk) Statistics
 *      (bk) Write Set Transfer
./parser/gram.y
 *      (bk) Statistics
 *      (bk) Write Set Transfer
./parser/gram.y%
	{"statistics", STATISTICS},  /* bk: for backend statistics */
./parser/keywords.c%
typedef struct bkend
	/* bk: change because doesn't work on ik6 */
	pqsignal(SIGPIPE, SIG_IGN);  /* bk: formerly die but then remote backend crashed */
./postmaster/postmaster.c
typedef struct bkend
	/* bk: change because doesn't work on ik6 */
	pqsignal(SIGPIPE, SIG_IGN);  /* bk: formerly die but then remote backend crashed */
./postmaster/postmaster.c%
*	backend to startup (used with remote bknd startup)
/* bk now also two */
/* bk: new two sockets to group communication */
  /* bk start up a couple of remote processes */
       *    bk: simple copy that for now the two sockets
				 *	generate connection object (always for remote bknd)
	      /* bk: in case of basic messages there is no backend created anymore */
       *    bk: simple copy that for now the two sockets
				 *	generate connection object (always for remote bknd)
	      /* bk: I set the waitForBknd now in handle_gc2rtxn */
		/* (bk) reorganize: first look if closed -> then close, disable socket if existent
			  /* (bk) put socket in the idle process list if remote process */
				/*(bk) new check it*/
				/* bk: now also false, because we do not destroy the socket */
   /* bk: now the total order socket */
*	struct pointed to by <waitForBknd>: for each remote bknd, this connection
		/* bk procid only intersting for local backends */
		/* bk this is only at replica manager startup */
	/* bk: this is the last msg for this txn */
	/* bk: create new conn */
		 /* bk: new: 
	  /* bk: set the socket to invalid, it is now to the new conn */
		/* disableSocket(ltxnsock->sock);*/  /* bk no more disabling */
		  /* bk: now the total order socket */
	  /* bk: set the socket to invalid, it is now to the new conn */
	  elog(NOTICE,"i am in bknd_present");
		  /* bk take care: second is now not dummy! */
/* bk: new group_socket to see whether it comes total order or not */
  bufsockptr	ltxnsock;   /* bk don't init immediately, maynot be valid anymore  = conn->dc.bsock;*/
		  /* (bk) why enable, i would rather disable */
		  /* bk now: since we keep the socket connection until backend dies
			  /* (bk) why enable, i would rather disable */
			  /* bk again socket has to be enabled because connection is not
		  /* bk enable now the total order socket */
/* bk: new the socket because we have now two */
  /* (bk) get idle process */
     /* bk: new only when write set arrives */
		/* (bk) we do not have any idle remote process, start a new one */
		/* (bk) inform that we are waiting */
		/* (bk) this variable was set when repl manager got first request of 
		/* (bk) similary to RmgrAccept */
		/*(bk): as a dummy without socket connected it will be deleted in rmgr main loop */
	  /* bk new: create backend only when write set arrives: better control of backend use */
			/* bk: betweend write-set arrival  backend created the abort msg arrived */
			/* bk: before backend creation the commit msg arrived */
			/* bk: no more possible */
    /* bk: no more possible */
    /* bk: commit/abort may now also arrive in lockphase */
		  /* bk: actually this is no more necessary, result is only important when
./replication/replicaManager.c
	   /* bk: 2 sockets */
./replication/pg_transis.c
#include "utils/builtins.h"     /* (bk): write set */
#include <utils/backend_stats.h>  /* (bk): statistics */
#include <libpq/bufferedSock.h> /* (bk): write set */
*	WriteSetFormTuple (remote bknd)
*	Write WriteSetGetDatum (remote bknd)
			*   (needed by the remote bknd to process the ws)
*  (bk) is used for only applying updates without setting any locks
			*   (needed by the remote bknd to process the ws)
./replication/writeset.c
#include <utils/backend_stats.h>  /* (bk): statistics */	
	/* bk: now only the first time, a connection is established, 
		/* bk: if we are non-blocking, we only want to test whether something
		/* bk: put msg type */
	   /* bk: length of the following is 8 bytes */
	/* bk: now first send msg to replicamanager */
./replication/rmgrLib.c
< /* bk: new two sockets to group communication */
<   /* bk start up a couple of remote processes */
<        *    bk: simple copy that for now the two sockets
< 				 *	generate connection object (always for remote bknd)
< 	      /* bk: in case of basic messages there is no backend created anymore */
> 								*	generate connection object (always for remote bknd)
<        *    bk: simple copy that for now the two sockets
< 				 *	generate connection object (always for remote bknd)
< 	      /* bk: I set the waitForBknd now in handle_gc2rtxn */
> 							*	generate connection object (always for remote bknd)
< 		/* (bk) reorganize: first look if closed -> then close, disable socket if existent
< 			/* (bk) put socket in the idle process list if remote process */
< 			  /*(bk) new check it*/
<    /* bk: now the total order socket */
< 		/* bk this is only at replica manager startup */
< 		  /* bk: now the total order socket */
< /* bk: new group_socket to see whether it comes total order or not */
< 	  /* (bk) why enable, i would rather disable */
< 		  /* (bk) why enable, i would rather disable */
< 		  /* bk enable now the total order socket */
< /* bk: new the socket because we have now two */
<   /* (bk) get idle process */
<      /* bk: new only when write set arrives */
< 		/* (bk) we do not have any idle remote process, start a new one */
< 		/* (bk) inform that we are waiting */
< 		/* (bk) this variable was set when repl manager got first request of 
< 		/* (bk) similary to RmgrAccept */
< 		/*(bk): as a dummy without socket connected it will be deleted in rmgr main loop */
< 	  /* bk new: create backend only when write set arrives: better control of backend use */
< 			/* bk: betweend write-set arrival  backend created the abort msg arrived */
< 			/* bk: before backend creation the commit msg arrived */
< 			/* bk: no more possible */
<     /* bk: no more possible */
<     /* bk: commit/abort may now also arrive in lockphase */
< 		  /* bk: actually this is no more necessary, result is only important when
./replication/d
#include "utils/builtins.h"     /* (bk): write set */
#include <utils/backend_stats.h>  /* (bk): statistics */
#include <libpq/bufferedSock.h> /* (bk): write set */
*	WriteSetFormTuple (remote bknd)
*	Write WriteSetGetDatum (remote bknd)
			*   (needed by the remote bknd to process the ws)
*  (bk) is used for only applying updates without setting any locks
			*   (needed by the remote bknd to process the ws)
./replication/writeset.c%
*	backend to startup (used with remote bknd startup)
/* bk now also two */
/* bk: new two sockets to group communication */
  /* bk start up a couple of remote processes */
       *    bk: simple copy that for now the two sockets
				 *	generate connection object (always for remote bknd)
	      /* bk: in case of basic messages there is no backend created anymore */
       *    bk: simple copy that for now the two sockets
				 *	generate connection object (always for remote bknd)
	      /* bk: I set the waitForBknd now in handle_gc2rtxn */
		/* (bk) reorganize: first look if closed -> then close, disable socket if existent
			  /* (bk) put socket in the idle process list if remote process */
				/*(bk) new check it*/
				/* bk: now also false, because we do not destroy the socket */
   /* bk: now the total order socket */
*	struct pointed to by <waitForBknd>: for each remote bknd, this connection
		/* bk procid only intersting for local backends */
		/* bk this is only at replica manager startup */
	/* bk: this is the last msg for this txn */
	/* bk: create new conn */
		 /* bk: new: 
	  /* bk: set the socket to invalid, it is now to the new conn */
		/* disableSocket(ltxnsock->sock);*/  /* bk no more disabling */
		  /* bk: now the total order socket */
	  /* bk: set the socket to invalid, it is now to the new conn */
	  elog(NOTICE,"i am in bknd_present");
		  /* bk take care: second is now not dummy! */
/* bk: new group_socket to see whether it comes total order or not */
  bufsockptr	ltxnsock;   /* bk don't init immediately, maynot be valid anymore  = conn->dc.bsock;*/
		  /* (bk) why enable, i would rather disable */
		  /* bk now: since we keep the socket connection until backend dies
			  /* (bk) why enable, i would rather disable */
			  /* bk again socket has to be enabled because connection is not
		  /* bk enable now the total order socket */
/* bk: new the socket because we have now two */
  /* (bk) get idle process */
     /* bk: new only when write set arrives */
		/* (bk) we do not have any idle remote process, start a new one */
		/* (bk) inform that we are waiting */
		/* (bk) this variable was set when repl manager got first request of 
		/* (bk) similary to RmgrAccept */
		/*(bk): as a dummy without socket connected it will be deleted in rmgr main loop */
	  /* bk new: create backend only when write set arrives: better control of backend use */
			/* bk: betweend write-set arrival  backend created the abort msg arrived */
			/* bk: before backend creation the commit msg arrived */
			/* bk: no more possible */
    /* bk: no more possible */
    /* bk: commit/abort may now also arrive in lockphase */
		  /* bk: actually this is no more necessary, result is only important when
./replication/replicaManager.c%
#include <utils/backend_stats.h>  /* (bk): statistics */	
	/* bk: now only the first time, a connection is established, 
		/* bk: if we are non-blocking, we only want to test whether something
		/* bk: put msg type */
	   /* bk: length of the following is 8 bytes */
	/* bk: now first send msg to replicamanager */
./replication/rmgrLib.c%
  /* bk: 2 sockets */
./replication/pg_ensemble.c
  /* bk: 2 sockets */
./replication/pg_ensemble.c%
	   /* bk: 2 sockets */
./replication/pg_transis.c%
(*) S 8 T (backend to startup \(used with remote bknd startup\)) N
() S 8 T () S 16 T () S 24 T () S 32 T (*) S 40 T (generate connection object \(always for remote bknd\)) N
(*) S 8 T (struct pointed to by <waitForBknd>: for each remote bknd, this connection) N
./replication/replicaManager.out
(*) S 8 T (backend to startup \(used with remote bknd startup\)) N
() S 8 T () S 16 T () S 24 T () S 32 T (*) S 40 T (generate connection object \(always for remote bknd\)) N
(*) S 8 T (struct pointed to by <waitForBknd>: for each remote bknd, this connection) N
./replication/replicaManager.out~
*	backend to startup (used with remote bknd startup)
				 *	generate connection object (always for remote bknd)
*	struct pointed to by <waitForBknd>: for each remote bknd, this connection
./replication/replicaManager-old.c
*	backend to startup (used with remote bknd startup)
				 *	generate connection object (always for remote bknd)
*	struct pointed to by <waitForBknd>: for each remote bknd, this connection
./replication/replicaManager-old.c~
  /* bk: 2 sockets */
./replication/pg_ensemble_simple.c
  /* bk: 2 sockets */
./replication/pg_ensemble_total.c
  /* bk: 2 sockets */
./replication/pg_ensemble_total.c%
  /* bk: 2 sockets */
./replication/pg_ensemble_simple.c%
#include <utils/backend_stats.h>  /* (bk): statistics */
./storage/buffer/bufmgr.c
#include <utils/backend_stats.h>  /* (bk): statistics */
./storage/buffer/bufmgr.c%
	/* bk: Statistics in shared memory */
	/* bk: Global BackendStatitics */
	/* bk: statistics added */
./storage/ipc/ipci.c
	/* bk: Statistics in shared memory */
	/* bk: Global BackendStatitics */
	/* bk: statistics added */
./storage/ipc/ipci.c%
#include <utils/backend_stats.h>  /* (bk): statistics */
./storage/lmgr/lmgr.c%
#include <utils/backend_stats.h>  /* (bk): statistics */
./storage/lmgr/lmgr.c
#include "storage/multilev.h"   /* (bk): because of the no lock.... */
#include <utils/backend_stats.h>  /* (bk): statistics */
/* bk for tests no static */
	/* bk: check for aborts */
	/* bk: if i have already the lock I must get it granted */
		  /* bk: note: in the case of internal abort the
	bool        xid_has_lock = false;    /* bk: access lock only when entry was really granted */
	/* bk: there might be shadows in the shadow list if we were aborted at some point
		/* bk: lock only relevant, if xid-granted */
		/* bk: note, we might have a xid-entry where the lock is not granted!!!!
		/* bk: since the entry might exist without the lock granted, only update lock information if
		   bk: this is only done when lock was granted and hence, access to lock is ok
./storage/lmgr/lock.c
#include "storage/proc.h"   /* bk: for abort check */
#include "storage/lock.h"   /* bk: for tuple level locking */
	/* bk: read for write conflicts with read for write and write on all levels */
	1                         /* bk: have to add for READ_FOR_WRITE */
	/* bk: check for aborts */
./storage/lmgr/multi.c
	/* bk: initialize connection state */
		/* bk: now do the same for semaphore for multiple acquisition */
						/* bk: uses old semphore */
						/* bk: if proc is in send phase: wake it up so that it aborts */
		/* bk: do not know which semaphore to use here, procedure not used right now */
					/* bk: not ProcRemoveWaiting must derecement also the
	/* bk: reset semaphores */
			/* bk: decrement also the nHolding counters */
*   (bk) note: this can only happen in read phase. Then, the waiting
		/* bk: de236crement also the nHolding counters */
		/* bk: i know it must be a read lock that will be removed here ! */
		/* bk: before all shadows were deleted (whether still waiting for a lock, i.e. where waitLinks
		/* bk: we also have to delete the xid entry in the proc's lockqueye! */
		/* bk: no, don't do that, xidentP might hold other locks, e.g. read locks */
		/* bk: new we cannot delete shadow here, because we have to behave
	/* bk: now also for multiple */
	/* bk: now the shadow has the reqmode strored to unlock the right semaphore */
		 /* bk: procsleep is used for request mode REQ_SINGLE, hence the old
	/* bk: delete the shadow out of the lists both in NO_ERROR and ERROR case */
		/* bk: new we take now the multiple semaphore */
	/* bk: new we take now the multiple semaphore */
		/* bk: weird race condition: if the txn belonging to this
		/* (bk) now i undo this again, the case where the abort
		/* bk: we have to check aborting too, because txn requires lock on pg_log when in aborting state */
		  /* bk wakeup might fail because of two correct situations:
		struct itimerval	timeval,     // bk: set timer to zero so that it does not start again
		/* bk: don't know what to do here ! PREDICT_ABORT not used */
				/* bk: don't know what to do here ! PREDICT_ABORT not used */
		/* bk: don't know what to do here ! PREDICT_ABORT not used */
	/* bk change from while to if, because there can only be one shadow!! */
	if(&curr_shdw->shadowLinks != queue)  /* bk */
	{									  /* bk */
	  /* bk test */
	/*		break;*/ /* bk */
	/* bk: there can only be one waiting shadow  in the read phase*/
		/* bk: now, do that now in WaitonLock */
/* bk: new, give as input also the SEMA */
./storage/lmgr/proc.c
/* (bk)
./storage/lmgr/single.c
#include "storage/multilev.h"   /* (bk): because of the no lock.... */
#include <utils/backend_stats.h>  /* (bk): statistics */
/* bk for tests no static */
	/* bk: check for aborts */
	/* bk: if i have already the lock I must get it granted */
		  /* bk: note: in the case of internal abort the
	bool        xid_has_lock = false;    /* bk: access lock only when entry was really granted */
	/* bk: there might be shadows in the shadow list if we were aborted at some point
		/* bk: lock only relevant, if xid-granted */
		/* bk: note, we might have a xid-entry where the lock is not granted!!!!
		/* bk: since the entry might exist without the lock granted, only update lock information if
		   bk: this is only done when lock was granted and hence, access to lock is ok
./storage/lmgr/lock.c%
#include "storage/proc.h"   /* bk: for abort check */
#include "storage/lock.h"   /* bk: for tuple level locking */
	/* bk: read for write conflicts with read for write and write on all levels */
	1                         /* bk: have to add for READ_FOR_WRITE */
	/* bk: check for aborts */
./storage/lmgr/multi.c%
	/* bk: initialize connection state */
		/* bk: now do the same for semaphore for multiple acquisition */
						/* bk: uses old semphore */
						/* bk: if proc is in send phase: wake it up so that it aborts */
		/* bk: do not know which semaphore to use here, procedure not used right now */
					/* bk: not ProcRemoveWaiting must derecement also the
	/* bk: reset semaphores */
			/* bk: decrement also the nHolding counters */
*   (bk) note: this can only happen in read phase. Then, the waiting
		/* bk: de236crement also the nHolding counters */
		/* bk: i know it must be a read lock that will be removed here ! */
		/* bk: before all shadows were deleted (whether still waiting for a lock, i.e. where waitLinks
		/* bk: we also have to delete the xid entry in the proc's lockqueye! */
		/* bk: no, don't do that, xidentP might hold other locks, e.g. read locks */
		/* bk: new we cannot delete shadow here, because we have to behave
	/* bk: now also for multiple */
	/* bk: now the shadow has the reqmode strored to unlock the right semaphore */
		 /* bk: procsleep is used for request mode REQ_SINGLE, hence the old
	/* bk: delete the shadow out of the lists both in NO_ERROR and ERROR case */
		/* bk: new we take now the multiple semaphore */
	/* bk: new we take now the multiple semaphore */
		/* bk: weird race condition: if the txn belonging to this
		/* (bk) now i undo this again, the case where the abort
		/* bk: we have to check aborting too, because txn requires lock on pg_log when in aborting state */
		  /* bk wakeup might fail because of two correct situations:
		struct itimerval	timeval,     // bk: set timer to zero so that it does not start again
		/* bk: don't know what to do here ! PREDICT_ABORT not used */
				/* bk: don't know what to do here ! PREDICT_ABORT not used */
		/* bk: don't know what to do here ! PREDICT_ABORT not used */
	/* bk change from while to if, because there can only be one shadow!! */
	if(&curr_shdw->shadowLinks != queue)  /* bk */
	{									  /* bk */
	  /* bk test */
	/*		break;*/ /* bk */
	/* bk: there can only be one waiting shadow  in the read phase*/
		/* bk: now, do that now in WaitonLock */
/* bk: new, give as input also the SEMA */
./storage/lmgr/proc.c%
< 		/* bk: now do the same for semaphore for multiple acquisition */
< 						/* bk: uses old semphore */
< 						/* bk: if proc is in send phase: wake it up so that it aborts */
< 		/* bk: do not know which semaphore to use here, procedure not used right now */
< 					/* bk: not ProcRemoveWaiting must derecement also the
< *   (bk) note: this can only happen in read phase. Then, the waiting
< 		/* bk: decrement also the nHolding counters */
< 		/* bk: i know it must be a read lock that will be removed here ! */
< 		/* bk: before all shadows were deleted (whether still waiting for a lock, i.e. where waitLinks
< 		/* bk: we also have to delete the xid entry in the proc's lockqueye! */
< 		/* bk: new we cannot delete shadow here, because we have to behave
< 	/* bk: now also for multiple */
< 	/* bk: now the shadow has the reqmode strored to unlock the right semaphore */
< 		 /* bk: procsleep is used for request mode REQ_SINGLE, hence the old
< 	/* bk: delete the shadow out of the lists both in NO_ERROR and ERROR case */
< 		/* bk: new we take now the multiple semaphore */
< 	/* bk: new we take now the multiple semaphore */
< 		/* bk: weird race condition: if the txn belonging to this
< 		/* (bk) now i undo this again, the case where the abort
< 		  /* bk wakeup might fail because of two correct situations:
< 		/* bk: don't know what to do here ! PREDICT_ABORT not used */
< 				/* bk: don't know what to do here ! PREDICT_ABORT not used */
< 		/* bk: don't know what to do here ! PREDICT_ABORT not used */
< /* bk: new, give as input also the SEMA */
./storage/lmgr/d
< 		/* bk: now do the same for semaphore for multiple acquisition */
< 						/* bk: uses old semphore */
< 						/* bk: if proc is in send phase: wake it up so that it aborts */
< 		/* bk: do not know which semaphore to use here, procedure not used right now */
< 					/* bk: not ProcRemoveWaiting must derecement also the
< *   (bk) note: this can only happen in read phase. Then, the waiting
< 		/* bk: decrement also the nHolding counters */
< 		/* bk: i know it must be a read lock that will be removed here ! */
< 		/* bk: before all shadows were deleted (whether still waiting for a lock, i.e. where waitLinks
< 		/* bk: we also have to delete the xid entry in the proc's lockqueye! */
< 		/* bk: new we cannot delete shadow here, because we have to behave
< 	/* bk: now also for multiple */
< 	/* bk: now the shadow has the reqmode strored to unlock the right semaphore */
< 		 /* bk: procsleep is used for request mode REQ_SINGLE, hence the old
< 	/* bk: delete the shadow out of the lists both in NO_ERROR and ERROR case */
< 		/* bk: new we take now the multiple semaphore */
< 	/* bk: new we take now the multiple semaphore */
< 		/* bk: weird race condition: if the txn belonging to this
< 		/* (bk) now i undo this again, the case where the abort
< 		  /* bk wakeup might fail because of two correct situations:
< 		/* bk: don't know what to do here ! PREDICT_ABORT not used */
< 				/* bk: don't know what to do here ! PREDICT_ABORT not used */
< 		/* bk: don't know what to do here ! PREDICT_ABORT not used */
< /* bk: new, give as input also the SEMA */
./storage/lmgr/#d#
/* (bk)
./storage/lmgr/single.c%
#include <utils/backend_stats.h>  /* (bk): statistics */
./storage/smgr/smgr.c
	 * .bki file entries are processed.
./storage/smgr/md.c
#include <utils/backend_stats.h>  /* (bk): statistics */
./storage/smgr/smgr.c%
/* bk */
				/* bk: for now use b to change flushbufferenabled */
				 *	bk: choose tuple level locking
				/* (bk) now use to switch on/off backendstatistics */
				/* bk: use now for queries */
	/* bk: this is already done in InitPostgres! */
		/* bk : no I/O */
		/* (bk) before a remote process did not have a loop but only
				elog(NOTICE, "Inconsistent decision: remote bknd aborted but received a commit message.");
			/* (bk) before there was a disconnect, now it is that we are ready */
		  *	6. (bk) tell rmgr that completely ready 
./tcop/postgres.c
						/* bk: set local backend statistics back */
		/* (bk) statistics */
./tcop/utility.c
/* bk */
				/* bk: for now use b to change flushbufferenabled */
				 *	bk: choose tuple level locking
				/* (bk) now use to switch on/off backendstatistics */
				/* bk: use now for queries */
	/* bk: this is already done in InitPostgres! */
		/* bk : no I/O */
		/* (bk) before a remote process did not have a loop but only
				elog(NOTICE, "Inconsistent decision: remote bknd aborted but received a commit message.");
			/* (bk) before there was a disconnect, now it is that we are ready */
		  *	6. (bk) tell rmgr that completely ready 
./tcop/postgres.c%
						/* bk: set local backend statistics back */
		/* (bk) statistics */
./tcop/utility.c%
# Unlike genbki.sh, which can run through cpp last, we have to
./utils/Gen_fmgrtab.sh
# Unlike genbki.sh, which can run through cpp last, we have to
./utils/Gen_fmgrtab.sh.in
/* bk */
./utils/adt/varlena.c
/* bk */
./utils/adt/varlena.c%
 *		EnableCatCahe();   bk: must be done if txn is aborted while DisableCache = 1;
	may_not_abort_right_now = true;   /* bk: if txn aborts in here, we are in trouble somehow */
./utils/cache/catcache.c
 *		EnableCatCahe();   bk: must be done if txn is aborted while DisableCache = 1;
	may_not_abort_right_now = true;   /* bk: if txn aborts in here, we are in trouble somehow */
./utils/cache/catcache.c%
		/* bk: optimistic: kick out replica manager */
./utils/init/postinit.c
		/* bk: optimistic: kick out replica manager */
./utils/init/postinit.c%
# Unlike genbki.sh, which can run through cpp last, we have to
./utils/Gen_fmgrtab.sh%
