Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
82358ca9
Commit
82358ca9
authored
Jun 09, 2005
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put a critical section around update of hash index metapage. Per
discussion with Qingqing Zhou.
parent
65d27324
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
src/backend/access/hash/hashpage.c
src/backend/access/hash/hashpage.c
+12
-1
No files found.
src/backend/access/hash/hashpage.c
View file @
82358ca9
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/hash/hashpage.c,v 1.
49 2005/05/11 01:26:01 neilc
Exp $
* $PostgreSQL: pgsql/src/backend/access/hash/hashpage.c,v 1.
50 2005/06/09 18:23:50 tgl
Exp $
*
*
* NOTES
* NOTES
* Postgres hash pages look like ordinary relation pages. The opaque
* Postgres hash pages look like ordinary relation pages. The opaque
...
@@ -421,7 +421,15 @@ _hash_expandtable(Relation rel, Buffer metabuf)
...
@@ -421,7 +421,15 @@ _hash_expandtable(Relation rel, Buffer metabuf)
/*
/*
* Okay to proceed with split. Update the metapage bucket mapping
* Okay to proceed with split. Update the metapage bucket mapping
* info.
* info.
*
* Since we are scribbling on the metapage data right in the shared
* buffer, any failure in this next little bit leaves us with a big
* problem: the metapage is effectively corrupt but could get written
* back to disk. We don't really expect any failure, but just to be
* sure, establish a critical section.
*/
*/
START_CRIT_SECTION
();
metap
->
hashm_maxbucket
=
new_bucket
;
metap
->
hashm_maxbucket
=
new_bucket
;
if
(
new_bucket
>
metap
->
hashm_highmask
)
if
(
new_bucket
>
metap
->
hashm_highmask
)
...
@@ -456,6 +464,9 @@ _hash_expandtable(Relation rel, Buffer metabuf)
...
@@ -456,6 +464,9 @@ _hash_expandtable(Relation rel, Buffer metabuf)
if
(
!
_hash_try_getlock
(
rel
,
start_nblkno
,
HASH_EXCLUSIVE
))
if
(
!
_hash_try_getlock
(
rel
,
start_nblkno
,
HASH_EXCLUSIVE
))
elog
(
PANIC
,
"could not get lock on supposedly new bucket"
);
elog
(
PANIC
,
"could not get lock on supposedly new bucket"
);
/* Done mucking with metapage */
END_CRIT_SECTION
();
/*
/*
* Copy bucket mapping info now; this saves re-accessing the meta page
* Copy bucket mapping info now; this saves re-accessing the meta page
* inside _hash_splitbucket's inner loop. Note that once we drop the
* inside _hash_splitbucket's inner loop. Note that once we drop the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment