From: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
---|---|
To: | Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: PATCH: add pg_current_xlog_flush_location function |
Date: | 2015-12-13 05:13:03 |
Message-ID: | CAA4eK1J4P7vOcSK83dXrFBJ_7P0_veGekpPygkMEH7yxx7ypRg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sun, Dec 13, 2015 at 12:07 AM, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com
> wrote:
> Hi,
>
> attached is a patch adding a function pg_current_xlog_flush_location(),
> which proved quite useful when investigating the ext4 data loss bug. It's
> mostly what was already sent to that thread, except for docs that were
> missing in the initial version.
>
>
/*
+ * Get latest WAL flush pointer
+ */
+XLogRecPtr
+GetXLogFlushRecPtr(void)
+{
+ SpinLockAcquire(&XLogCtl->info_lck);
+ LogwrtResult = XLogCtl->LogwrtResult;
+ SpinLockRelease(&XLogCtl->info_lck);
+
+ return LogwrtResult.Flush;
+}
+
Is there a reason why you can't use existing function
GetFlushRecPtr() in xlog.c?
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Kapila | 2015-12-13 05:24:04 | Re: PATCH: track last known XLOG segment in control file |
Previous Message | Robert Haas | 2015-12-13 02:28:23 | Re: Rework the way multixact truncations work |