Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
63c678d1
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
63c678d1
编写于
3月 03, 2007
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix for COPY-after-truncate feature.
Simon Riggs
上级
ae35867a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
9 deletion
+28
-9
src/backend/catalog/index.c
src/backend/catalog/index.c
+2
-1
src/backend/utils/cache/relcache.c
src/backend/utils/cache/relcache.c
+23
-7
src/include/utils/relcache.h
src/include/utils/relcache.h
+3
-1
未找到文件。
src/backend/catalog/index.c
浏览文件 @
63c678d1
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.2
79 2007/02/14 01:58:56 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.2
80 2007/03/03 20:08:41 momjian
Exp $
*
*
* INTERFACE ROUTINES
...
...
@@ -1250,6 +1250,7 @@ setNewRelfilenode(Relation relation)
/* Remember we did this in current transaction, to allow later optimisations */
relation
->
rd_newRelfilenodeSubid
=
GetCurrentSubTransactionId
();
RelationCacheResetAtEOXact
();
/* Make sure the relfilenode change is visible */
CommandCounterIncrement
();
...
...
src/backend/utils/cache/relcache.c
浏览文件 @
63c678d1
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.25
6 2007/02/27 23:48:09 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.25
7 2007/03/03 20:08:41 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1915,9 +1915,6 @@ RelationCacheInvalidateEntry(Oid relationId)
* so we do not touch new-in-transaction relations; they cannot be targets
* of cross-backend SI updates (and our own updates now go through a
* separate linked list that isn't limited by the SI message buffer size).
* We don't do anything special for newRelfilenode-in-transaction relations,
* though since we have a lock on the relation nobody else should be
* generating cache invalidation messages for it anyhow.
*
* We do this in two phases: the first pass deletes deletable items, and
* the second one rebuilds the rebuildable items. This is essential for
...
...
@@ -1960,6 +1957,14 @@ RelationCacheInvalidate(void)
if
(
relation
->
rd_createSubid
!=
InvalidSubTransactionId
)
continue
;
/*
* Reset newRelfilenode hint. It is never used for correctness, only
* for performance optimization. An incorrectly set hint can lead
* to data loss in some circumstances, so play safe.
*/
if
(
relation
->
rd_newRelfilenodeSubid
!=
InvalidSubTransactionId
)
relation
->
rd_newRelfilenodeSubid
=
InvalidSubTransactionId
;
relcacheInvalsReceived
++
;
if
(
RelationHasReferenceCountZero
(
relation
))
...
...
@@ -2011,6 +2016,17 @@ RelationCacheInvalidate(void)
list_free
(
rebuildList
);
}
/*
* RelationCacheResetAtEOXact
*
* Register that work will be required at main-transaction commit or abort
*/
void
RelationCacheResetAtEOXact
(
void
)
{
need_eoxact_work
=
true
;
}
/*
* AtEOXact_RelationCache
*
...
...
@@ -2161,7 +2177,7 @@ AtEOSubXact_RelationCache(bool isCommit, SubTransactionId mySubid,
if
(
isCommit
)
relation
->
rd_newRelfilenodeSubid
=
parentSubid
;
else
relation
->
rd_newRelfilenodeSubid
=
InvalidSubTransactionId
;
relation
->
rd_newRelfilenodeSubid
=
InvalidSubTransactionId
;
}
/*
...
...
@@ -2255,7 +2271,7 @@ RelationBuildLocalRelation(const char *relname,
rel
->
rd_newRelfilenodeSubid
=
InvalidSubTransactionId
;
/* must flag that we have rels created in this transaction */
need_eoxact_work
=
true
;
RelationCacheResetAtEOXact
()
;
/* is it a temporary relation? */
rel
->
rd_istemp
=
isTempNamespace
(
relnamespace
);
...
...
@@ -2911,7 +2927,7 @@ RelationSetIndexList(Relation relation, List *indexIds, Oid oidIndex)
relation
->
rd_oidindex
=
oidIndex
;
relation
->
rd_indexvalid
=
2
;
/* mark list as forced */
/* must flag that we have a forced index list */
need_eoxact_work
=
true
;
RelationCacheResetAtEOXact
()
;
}
/*
...
...
src/include/utils/relcache.h
浏览文件 @
63c678d1
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/utils/relcache.h,v 1.5
7 2007/01/05 22:19:59
momjian Exp $
* $PostgreSQL: pgsql/src/include/utils/relcache.h,v 1.5
8 2007/03/03 20:08:41
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -60,6 +60,8 @@ extern void RelationCacheInvalidateEntry(Oid relationId);
extern
void
RelationCacheInvalidate
(
void
);
extern
void
RelationCacheResetAtEOXact
(
void
);
extern
void
AtEOXact_RelationCache
(
bool
isCommit
);
extern
void
AtEOSubXact_RelationCache
(
bool
isCommit
,
SubTransactionId
mySubid
,
SubTransactionId
parentSubid
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录