Hi team,
My postgre version is 9.4.9, and I face a space issue.
Every time I restart postgre server, it generates a new history file:
0000156A.history => 0000156B.history
Now it takes a lot of space about 800MB (5787 history file):
-rw------- 1 pgsql pgsql 247K Mar 13 14:49 00001568.history
-rw------- 1 pgsql pgsql 247K Mar 13 14:51 00001569.history
-rw------- 1 pgsql pgsql 247K Mar 13 14:52 0000156A.history
-rw------- 1 pgsql pgsql 247K Mar 13 15:03 0000156B.history
-rw------- 1 pgsql pgsql 247K Mar 13 15:56 0000156C.history
-rw------- 1 pgsql pgsql 247K Mar 13 16:06 0000156D.history
-rw------- 1 pgsql pgsql 247K Mar 13 16:06 0000156E.history
-rw------- 1 pgsql pgsql 248K Mar 13 17:13 0000156F.history
-rw------- 1 pgsql pgsql 16M Mar 13 17:13 0000156F00000024000000F2
-rw------- 1 pgsql pgsql 248K Mar 13 17:13 00001570.history
-rw------- 1 pgsql pgsql 16M Mar 14 10:11 0000157000000024000000F2
Is file 00001570.history important?
When I do diff to these file I found new file just have a new line compared to previous history file :
command:
diff 0000156F.history 00001570.history
result
10971a10972,10973
>
> 5487 24/F2000090 reached consistency
Is there a safety way to clean .history file?
1. Just save latest one?
2. Or remove history file which is marked as done in pg_xlog/archive_status like:
-rw------- 1 pgsql pgsql 0 Mar 13 14:52 0000156A.history.done
-rw------- 1 pgsql pgsql 0 Mar 13 15:03 0000156B.history.done
-rw------- 1 pgsql pgsql 0 Mar 13 15:56 0000156C.history.done
-rw------- 1 pgsql pgsql 0 Mar 13 16:06 0000156D.history.done
-rw------- 1 pgsql pgsql 0 Mar 13 16:06 0000156E.history.done
-rw------- 1 pgsql pgsql 0 Mar 13 17:13 0000156F.history.done
-rw------- 1 pgsql pgsql 0 Mar 13 17:13 0000156F00000024000000F2.done
-rw------- 1 pgsql pgsql 0 Mar 13 17:13 00001570.history.done
Thanks.
By Pin