Putting index entries to XLog

Started by Carsten Kropfabout 16 years ago3 messagesgeneral
Jump to latest
#1Carsten Kropf
ckropf2@fh-hof.de

Hi *,
I have encountered a problem while implementing an index structure. I don't have any access to the RM (I don't know, how to set it up properly) using my index. However, when I don't have the situation of working with a temporary table, I need to put entries using XLogInsert(...). The problem for me is, that based on the fact, that I don't have the access to the RM, I can't put proper entries to the xlog facility. How can I achieve that my index structure can be stored properly at least?
I'm getting lots of errors, when I just put a XLogRecPtr with data {1,1} as LSN of the page. On the other hand when doing XLogInsert calls to work with the component properly I don't know which data to put in there. When I'm using some kind of RM_ID (like RM_GIST_ID or something like that) I'm getting problems because I don't know which code to insert there. I decided to take RM_GIST_ID and an invalid code (so it won't call any of the xlog gist implementations upon recovery) which, however failed, too. Unfortunately my task is to implement a certain structure with PostgreSQL, so all of my current work actually depend on this action.
I hope that somebody will be able to help me according to this issue.
Thanks in advance

Best regards
Carsten Kropf

#2Martijn van Oosterhout
kleptog@svana.org
In reply to: Carsten Kropf (#1)
Re: Putting index entries to XLog

I didn't see an answer to this, so I thought I'd point out that you do
not need to do anything with XLOG to make a functional index. It is
only necessary when you want to make it crash-safe or work over SR.

But when you're building a new index type, making it crash safe is one
of the last things on the list. So unless you're really far I'd suggest
dropping everything XLog realted and coming back to it later.

Have anice day,

On Thu, Feb 25, 2010 at 12:41:36PM +0100, Carsten Kropf wrote:

Hi *,
I have encountered a problem while implementing an index structure. I don't have any access to the RM (I don't know, how to set it up properly) using my index. However, when I don't have the situation of working with a temporary table, I need to put entries using XLogInsert(...). The problem for me is, that based on the fact, that I don't have the access to the RM, I can't put proper entries to the xlog facility. How can I achieve that my index structure can be stored properly at least?
I'm getting lots of errors, when I just put a XLogRecPtr with data {1,1} as LSN of the page. On the other hand when doing XLogInsert calls to work with the component properly I don't know which data to put in there. When I'm using some kind of RM_ID (like RM_GIST_ID or something like that) I'm getting problems because I don't know which code to insert there. I decided to take RM_GIST_ID and an invalid code (so it won't call any of the xlog gist implementations upon recovery) which, however failed, too. Unfortunately my task is to implement a certain structure with PostgreSQL, so all of my current work actually depend on this action.
I hope that somebody will be able to help me according to this issue.
Thanks in advance

Best regards
Carsten Kropf
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

Please line up in a tree and maintain the heap invariant while
boarding. Thank you for flying nlogn airlines.

#3Simon Riggs
simon@2ndQuadrant.com
In reply to: Carsten Kropf (#1)
Re: Putting index entries to XLog

On Thu, 2010-02-25 at 12:41 +0100, Carsten Kropf wrote:

I have encountered a problem while implementing an index structure. I don't have any access to the RM (I don't know, how to set it up properly) using my index. However, when I don't have the situation of working with a temporary table, I need to put entries using XLogInsert(...). The problem for me is, that based on the fact, that I don't have the access to the RM, I can't put proper entries to the xlog facility. How can I achieve that my index structure can be stored properly at least?
I'm getting lots of errors, when I just put a XLogRecPtr with data {1,1} as LSN of the page. On the other hand when doing XLogInsert calls to work with the component properly I don't know which data to put in there. When I'm using some kind of RM_ID (like RM_GIST_ID or something like that) I'm getting problems because I don't know which code to insert there. I decided to take RM_GIST_ID and an invalid code (so it won't call any of the xlog gist implementations upon recovery) which, however failed, too. Unfortunately my task is to implement a certain structure with PostgreSQL, so all of my current work actually depend on this action.
I hope that somebody will be able to help me according to this issue.
Thanks in advance

Each new index type requires a new rmgr to allow it to be recoverable.

The rmgr is not part of the index API, so it is not currently possible
to add a new index type *and* make it recoverable without editing the
server source code.

--
Simon Riggs www.2ndQuadrant.com