Re: Handling GIN incomplete splits

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Handling GIN incomplete splits
Date: 2013-11-20 13:27:50
Message-ID: CAB7nPqQfokZjUbh-B4PWC3Rz8BiZaP+k=L4d9RcJnn667NZQXg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here are some comments about the 4th patch.
1) Compiles without warnings, passes make check.
2) s/ginFinshSplit/ginFinishSplit
3) Server crashes when trying to create a gin index index creation (see
example of previous email with pg_trgm). Here is the backtrace of the crash:
* thread #1: tid = 0x15221, 0x00007fff8c59f866
libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread,
stop reason = signal SIGABRT
frame #0: 0x00007fff8c59f866 libsystem_kernel.dylib`__pthread_kill + 10
frame #1: 0x00007fff8e60735c libsystem_pthread.dylib`pthread_kill + 92
frame #2: 0x00007fff91586bba libsystem_c.dylib`abort + 125
frame #3: 0x000000010e953ed9
postgres`ExceptionalCondition(conditionName=0x000000010ea31055,
errorType=0x000000010e9b5973, fileName=0x000000010ea2fd3d, lineNumber=1175)
+ 137 at assert.c:54
frame #4: 0x000000010e79073a
postgres`UnpinBuffer(buf=0x000000010f37f9c0, fixOwner='\0') + 282 at
bufmgr.c:1175
frame #5: 0x000000010e793465 postgres`ReleaseBuffer(buffer=3169) + 565
at bufmgr.c:2540
frame #6: 0x000000010e414e43
postgres`freeGinBtreeStack(stack=0x00007fa2138adcf8) + 67 at ginbtree.c:196
frame #7: 0x000000010e415330
postgres`ginInsertValue(btree=0x00007fff51807e80, stack=0x00007fa2138a6dd8,
insertdata=0x00007fff51807e70, buildStats=0x00007fff51809fa0) + 1216 at
ginbtree.c:728
frame #8: 0x000000010e404ebf
postgres`ginEntryInsert(ginstate=0x00007fff51807fe0, attnum=1, key=7828073,
category='\0', items=0x0000000117d0ab28, nitem=76,
buildStats=0x00007fff51809fa0) + 1055 at gininsert.c:218
frame #9: 0x000000010e405ad6
postgres`ginbuild(fcinfo=0x00007fff5180a050) + 1590 at gininsert.c:392
frame #10: 0x000000010e9609ba
postgres`OidFunctionCall3Coll(functionId=2738, collation=0,
arg1=4693605424, arg2=4693760992, arg3=140334089145912) + 186 at fmgr.c:1649
frame #11: 0x000000010e4f4b30
postgres`index_build(heapRelation=0x0000000117c2bc30,
indexRelation=0x0000000117c51be0, indexInfo=0x00007fa213888e38,
isprimary='\0', isreindex='\0') + 464 at index.c:1963
frame #12: 0x000000010e4f2f07
postgres`index_create(heapRelation=0x0000000117c2bc30,
indexRelationName=0x00007fa213888b30, indexRelationId=16445, relFileNode=0,
indexInfo=0x00007fa213888e38, indexColNames=0x00007fa2138892d8,
accessMethodObjectId=2742, tableSpaceId=0,
collationObjectId=0x00007fa213889330, classObjectId=0x00007fa213889350,
coloptions=0x00007fa213889370, reloptions=0, isprimary='\0',
isconstraint='\0', deferrable='\0', initdeferred='\0',
allow_system_table_mods='\0', skip_build='\0', concurrent='\0',
is_internal='\0') + 3591 at index.c:1082
frame #13: 0x000000010e5da885
postgres`DefineIndex(stmt=0x00007fa213888b90, indexRelationId=0,
is_alter_table='\0', check_rights='\x01', skip_build='\0', quiet='\0') +
4181 at indexcmds.c:595
frame #14: 0x000000010e7dd4a3
postgres`ProcessUtilitySlow(parsetree=0x00007fa21384b530,
queryString=0x00007fa21384a838, context=PROCESS_UTILITY_TOPLEVEL,
params=0x0000000000000000, dest=0x00007fa21384b918,
completionTag=0x00007fff5180b020) + 2931 at utility.c:1163
frame #15: 0x000000010e7dc4d7
postgres`standard_ProcessUtility(parsetree=0x00007fa21384b530,
queryString=0x00007fa21384a838, context=PROCESS_UTILITY_TOPLEVEL,
params=0x0000000000000000, dest=0x00007fa21384b918,
completionTag=0x00007fff5180b020) + 3511 at utility.c:873
frame #16: 0x000000010e7db719
postgres`ProcessUtility(parsetree=0x00007fa21384b530,
queryString=0x00007fa21384a838, context=PROCESS_UTILITY_TOPLEVEL,
params=0x0000000000000000, dest=0x00007fa21384b918,
completionTag=0x00007fff5180b020) + 185 at utility.c:352
frame #17: 0x000000010e7db0e5
postgres`PortalRunUtility(portal=0x00007fa213889638,
utilityStmt=0x00007fa21384b530, isTopLevel='\x01', dest=0x00007fa21384b918,
completionTag=0x00007fff5180b020) + 325 at pquery.c:1187
frame #18: 0x000000010e7da002
postgres`PortalRunMulti(portal=0x00007fa213889638, isTopLevel='\x01',
dest=0x00007fa21384b918, altdest=0x00007fa21384b918,
completionTag=0x00007fff5180b020) + 514 at pquery.c:1318
frame #19: 0x000000010e7d95c4
postgres`PortalRun(portal=0x00007fa213889638, count=9223372036854775807,
isTopLevel='\x01', dest=0x00007fa21384b918, altdest=0x00007fa21384b918,
completionTag=0x00007fff5180b020) + 964 at pquery.c:816
frame #20: 0x000000010e7d4d77
postgres`exec_simple_query(query_string=0x00007fa21384a838) + 1207 at
postgres.c:1048
frame #21: 0x000000010e7d3fc1 postgres`PostgresMain(argc=1,
argv=0x00007fa21301a3c0, dbname=0x00007fa21301a228,
username=0x00007fa21301a208) + 2753 at postgres.c:3992
frame #22: 0x000000010e75868c
postgres`BackendRun(port=0x00007fa212e00240) + 700 at postmaster.c:4085
frame #23: 0x000000010e757c81
postgres`BackendStartup(port=0x00007fa212e00240) + 433 at postmaster.c:3774
frame #24: 0x000000010e7544fe postgres`ServerLoop + 606 at
postmaster.c:1585
frame #25: 0x000000010e751d74 postgres`PostmasterMain(argc=3,
argv=0x00007fa212c041f0) + 5380 at postmaster.c:1240
frame #26: 0x000000010e6930fd postgres`main(argc=3,
argv=0x00007fa212c041f0) + 653 at main.c:196
Test has been done on OSX 10.9.

This is all I have for now... I will have a look at the code later, as this
patch changes quite a bit the internals of gin, it is going to take a
little bit of time.
Thanks,
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2013-11-20 13:30:39 Re: Data corruption issues using streaming replication on 9.0.14/9.2.5/9.3.1
Previous Message Karsten Hilbert 2013-11-20 13:21:15 Re: pg_upgrade ?deficiency