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
3706f08a
Commit
3706f08a
authored
Oct 31, 2000
by
Vadim B. Mikheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix recovery cache code (thanks to Peter Eisentraut for
pointing to bug).
parent
b99ee7f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
23 deletions
+10
-23
src/backend/access/transam/xlogutils.c
src/backend/access/transam/xlogutils.c
+10
-23
No files found.
src/backend/access/transam/xlogutils.c
View file @
3706f08a
...
...
@@ -238,15 +238,14 @@ static XLogRelDesc *_xlrelarr = NULL;
static
Form_pg_class
_xlpgcarr
=
NULL
;
static
int
_xlast
=
0
;
static
int
_xlcnt
=
0
;
#define _XLOG_INITRELCACHESIZE 32
#define _XLOG_MAXRELCACHESIZE 512
#define _XLOG_RELCACHESIZE 512
static
void
_xl_init_rel_cache
(
void
)
{
HASHCTL
ctl
;
_xlcnt
=
_XLOG_
INIT
RELCACHESIZE
;
_xlcnt
=
_XLOG_RELCACHESIZE
;
_xlast
=
0
;
_xlrelarr
=
(
XLogRelDesc
*
)
malloc
(
sizeof
(
XLogRelDesc
)
*
_xlcnt
);
memset
(
_xlrelarr
,
0
,
sizeof
(
XLogRelDesc
)
*
_xlcnt
);
...
...
@@ -261,7 +260,7 @@ _xl_init_rel_cache(void)
ctl
.
datasize
=
sizeof
(
XLogRelDesc
*
);
ctl
.
hash
=
tag_hash
;
_xlrelcache
=
hash_create
(
_XLOG_
INIT
RELCACHESIZE
,
&
ctl
,
_xlrelcache
=
hash_create
(
_XLOG_RELCACHESIZE
,
&
ctl
,
HASH_ELEM
|
HASH_FUNCTION
);
}
...
...
@@ -297,6 +296,8 @@ _xl_remove_hash_entry(XLogRelDesc **edata, int dummy)
static
XLogRelDesc
*
_xl_new_reldesc
(
void
)
{
XLogRelDesc
*
res
;
_xlast
++
;
if
(
_xlast
<
_xlcnt
)
{
...
...
@@ -304,27 +305,13 @@ _xl_new_reldesc(void)
return
(
&
(
_xlrelarr
[
_xlast
]));
}
if
(
2
*
_xlcnt
<=
_XLOG_MAXRELCACHESIZE
)
{
_xlrelarr
=
(
XLogRelDesc
*
)
realloc
(
_xlrelarr
,
2
*
sizeof
(
XLogRelDesc
)
*
_xlcnt
);
memset
(
&
(
_xlrelarr
[
_xlcnt
]),
0
,
sizeof
(
XLogRelDesc
)
*
_xlcnt
);
_xlpgcarr
=
(
Form_pg_class
)
realloc
(
_xlpgcarr
,
2
*
sizeof
(
FormData_pg_class
)
*
_xlcnt
);
memset
(
&
(
_xlpgcarr
[
_xlcnt
]),
0
,
sizeof
(
FormData_pg_class
)
*
_xlcnt
);
_xlcnt
+=
_xlcnt
;
_xlrelarr
[
_xlast
].
reldata
.
rd_rel
=
&
(
_xlpgcarr
[
_xlast
]);
return
(
&
(
_xlrelarr
[
_xlast
]));
}
else
/* reuse */
{
XLogRelDesc
*
res
=
_xlrelarr
[
0
].
moreRecently
;
/* reuse */
res
=
_xlrelarr
[
0
].
moreRecently
;
_xl_remove_hash_entry
(
&
res
,
0
);
_xl_remove_hash_entry
(
&
res
,
0
);
_xlast
--
;
return
(
res
);
}
_xlast
--
;
return
(
res
);
}
extern
void
CreateDummyCaches
(
void
);
...
...
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