Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcd00a9e

Browse files
committed
remove ifdefs
1 parentbe47745 commitcd00a9e

File tree

1 file changed

+2
-78
lines changed

1 file changed

+2
-78
lines changed

‎contrib/pg_tsdtm/pg_dtm.c‎

Lines changed: 2 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -169,42 +169,10 @@ static cid_t
169169
dtm_sync(cid_tglobal_cid)
170170
{
171171
cid_tlocal_cid;
172-
#if1
173172
while ((local_cid=dtm_get_cid())<global_cid)
174173
{
175174
local->time_shift+=global_cid-local_cid;
176175
}
177-
#else
178-
while ((local_cid=dtm_get_cid())<global_cid)
179-
{
180-
SpinLockRelease(&local->lock);
181-
#ifTRACE_SLEEP_TIME
182-
{
183-
timestamp_tnow=dtm_get_current_time();
184-
statictimestamp_tfirstReportTime;
185-
statictimestamp_tprevReportTime;
186-
statictimestamp_ttotalSleepTime;
187-
#endif
188-
dtm_sleep(global_cid-local_cid);
189-
#ifTRACE_SLEEP_TIME
190-
totalSleepTime+=dtm_get_current_time()-now;
191-
if (now>prevReportTime+USEC)
192-
{
193-
prevReportTime=now;
194-
if (firstReportTime==0)
195-
{
196-
firstReportTime=now;
197-
}
198-
else
199-
{
200-
fprintf(stderr,"Sync sleep %lu of %lu usec (%f%%)\n",totalSleepTime,now-firstReportTime,totalSleepTime*100.0 / (now-firstReportTime));
201-
}
202-
}
203-
}
204-
#endif
205-
SpinLockAcquire(&local->lock);
206-
}
207-
#endif
208176
returnlocal_cid;
209177
}
210178

@@ -507,13 +475,7 @@ DtmAdjustOldestXid(TransactionId xid)
507475
for (ts=local->trans_list_head;ts!=NULL&&ts->cid<cutoff_time;prev=ts,ts=ts->next)
508476
{
509477
if (prev!=NULL)
510-
{
511-
/*
512-
* intf(stderr, "Remove xid %d from hash at %lu\n",
513-
* prev->xid, now);
514-
*/
515478
hash_search(xid2status,&prev->xid,HASH_REMOVE,NULL);
516-
}
517479
}
518480
}
519481
if (prev!=NULL)
@@ -550,24 +512,12 @@ DtmGetOldestXmin(Relation rel, bool ignoreVacuum)
550512
bool
551513
DtmXidInMVCCSnapshot(TransactionIdxid,Snapshotsnapshot)
552514
{
553-
#ifTRACE_SLEEP_TIME
554-
statictimestamp_tfirstReportTime;
555-
statictimestamp_tprevReportTime;
556-
statictimestamp_ttotalSleepTime;
557-
statictimestamp_tmaxSleepTime;
558-
#endif
559515
timestamp_tdelay=MIN_WAIT_TIMEOUT;
560516

561517
Assert(xid!=InvalidTransactionId);
562518

563519
SpinLockAcquire(&local->lock);
564520

565-
#ifTRACE_SLEEP_TIME
566-
if (firstReportTime==0)
567-
{
568-
firstReportTime=dtm_get_current_time();
569-
}
570-
#endif
571521
while (true)
572522
{
573523
DtmTransStatus*ts= (DtmTransStatus*)hash_search(xid2status,&xid,HASH_FIND,NULL);
@@ -585,37 +535,11 @@ DtmXidInMVCCSnapshot(TransactionId xid, Snapshot snapshot)
585535
{
586536
DTM_TRACE((stderr,"%d: wait for in-doubt transaction %u in snapshot %lu\n",getpid(),xid,dtm_tx.snapshot));
587537
SpinLockRelease(&local->lock);
588-
#ifTRACE_SLEEP_TIME
589-
{
590-
timestamp_tdelta,
591-
now=dtm_get_current_time();
592-
#endif
538+
593539
dtm_sleep(delay);
594-
#ifTRACE_SLEEP_TIME
595-
delta=dtm_get_current_time()-now;
596-
totalSleepTime+=delta;
597-
if (delta>maxSleepTime)
598-
{
599-
maxSleepTime=delta;
600-
}
601-
if (now>prevReportTime+USEC*10)
602-
{
603-
prevReportTime=now;
604-
if (firstReportTime==0)
605-
{
606-
firstReportTime=now;
607-
}
608-
else
609-
{
610-
fprintf(stderr,"Snapshot sleep %lu of %lu usec (%f%%), maximum=%lu\n",totalSleepTime,now-firstReportTime,totalSleepTime*100.0 / (now-firstReportTime),maxSleepTime);
611-
}
612-
}
613-
}
614-
#endif
540+
615541
if (delay*2 <=MAX_WAIT_TIMEOUT)
616-
{
617542
delay *=2;
618-
}
619543
SpinLockAcquire(&local->lock);
620544
}
621545
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp