Mariadb

在 SST 期間 gcache.size 重要嗎?如果在 SST 期間超過 gcache.size 怎麼辦?

  • April 17, 2018

在 SST 期間,我的數據目錄如下所示(有一個帶有 的隱藏目錄.sstxtrabackup

-rw-rw---- 1 vcap vcap       113 Apr 16 08:13 grastate.dat
-rw-rw---- 1 vcap vcap       265 Apr 16 08:13 gvwstate.dat
-rw-rw---- 1 vcap vcap         0 Apr 16 08:13 sst_in_progress
-rw------- 1 vcap vcap 536872232 Apr 16 08:29 galera.cache
-rw------- 1 vcap vcap 134217728 Apr 16 08:32 gcache.page.000000
-rw------- 1 vcap vcap 134217728 Apr 16 08:36 gcache.page.000001
-rw------- 1 vcap vcap 134217728 Apr 16 08:40 gcache.page.000002
-rw------- 1 vcap vcap 134217728 Apr 16 08:44 gcache.page.000003
-rw------- 1 vcap vcap 134217728 Apr 16 08:48 gcache.page.000004
-rw------- 1 vcap vcap 134217728 Apr 16 08:52 gcache.page.000005
-rw------- 1 vcap vcap 134217728 Apr 16 08:56 gcache.page.000006
-rw------- 1 vcap vcap 134217728 Apr 16 09:00 gcache.page.000007
-rw------- 1 vcap vcap 134217728 Apr 16 09:03 gcache.page.000008
-rw------- 1 vcap vcap 134217728 Apr 16 09:07 gcache.page.000009
-rw------- 1 vcap vcap 134217728 Apr 16 09:11 gcache.page.000010
-rw------- 1 vcap vcap 134217728 Apr 16 09:15 gcache.page.000011
-rw------- 1 vcap vcap 134217728 Apr 16 09:19 gcache.page.000012
-rw-r----- 1 vcap vcap       366 Apr 16 09:20 mysql-bin.000021
-rw-rw---- 1 vcap vcap        19 Apr 16 09:20 mysql-bin.index
-rw------- 1 vcap vcap 134217728 Apr 16 09:23 gcache.page.000013
-rw------- 1 vcap vcap 134217728 Apr 16 09:27 gcache.page.000014
-rw------- 1 vcap vcap 134217728 Apr 16 09:30 gcache.page.000015
-rw------- 1 vcap vcap 134217728 Apr 16 09:32 gcache.page.000016

據我了解,SST 期間的寫入儲存在gcache.page.0000*文件中。它是否正確?我們將大小設置為最大。512 MB ( gcache.size)。如果我們達到最大值會發生什麼?如果在 SST 期間插入 2 GB?

2018-04-16  8:29:00 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000000 of size 134217728 bytes
2018-04-16  8:32:54 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000001 of size 134217728 bytes
2018-04-16  8:36:48 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000002 of size 134217728 bytes
2018-04-16  8:40:41 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000003 of size 134217728 bytes
2018-04-16  8:44:33 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000004 of size 134217728 bytes
2018-04-16  8:48:26 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000005 of size 134217728 bytes
2018-04-16  8:52:19 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000006 of size 134217728 bytes
2018-04-16  8:56:12 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000007 of size 134217728 bytes
2018-04-16  9:00:05 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000008 of size 134217728 bytes
2018-04-16  9:03:57 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000009 of size 134217728 bytes
2018-04-16  9:07:50 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000010 of size 134217728 bytes
2018-04-16  9:11:42 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000011 of size 134217728 bytes
2018-04-16  9:15:34 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000012 of size 134217728 bytes
2018-04-16  9:19:33 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000013 of size 134217728 bytes
2018-04-16  9:23:23 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000014 of size 134217728 bytes
2018-04-16  9:27:02 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000015 of size 134217728 bytes
2018-04-16  9:30:40 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000016 of size 134217728 bytes
2018-04-16  9:34:18 140448739440384 [Note] WSREP: Created page /var/vcap/store/mysql/gcache.page.000017 of size 134217728 bytes
2018-04-16  9:34:58 140449443399552 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2018-04-16  9:35:07 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000000
2018-04-16  9:35:08 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000001
2018-04-16  9:35:09 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000002
2018-04-16  9:35:11 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000003
2018-04-16  9:35:12 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000004
2018-04-16  9:35:13 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000005
2018-04-16  9:35:15 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000006
2018-04-16  9:35:16 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000007
2018-04-16  9:35:17 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000008
2018-04-16  9:35:19 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000009
2018-04-16  9:35:20 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000010
2018-04-16  9:35:21 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000011
2018-04-16  9:35:22 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000012
2018-04-16  9:35:32 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000013
2018-04-16  9:35:45 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000014
2018-04-16  9:35:59 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000015
2018-04-16  9:36:13 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000016
2018-04-16  9:36:16 140448383366912 [Note] WSREP: Deleted page /var/vcap/store/mysql/gcache.page.000017
2018-04-16  9:36:27 140436269124352 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
2018-04-16  9:36:39 140588932401024 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2018-04-16  9:37:55 140579234867968 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool

不,gcache.size僅與 IST 有關。GCache用於在 SST 期間將傳入事務儲存到加入節點。Gcache 用於儲存交易,以防另一個節點請求狀態轉移。如果 GCache 足夠大,可以容納所有需要的事務,那麼這將允許 IST。

在 SST 期間到加入者節點的傳入事務被儲存在本地接收隊列中(最大大小由gcs.recv_q_hard_limit變數控制,從狀態變數中看到的目前大小wsrep_local_recv_queue)。該隊列獨立於gcache.size.

引用自:https://dba.stackexchange.com/questions/204057