ããã«ã¡ã¯ããµã¤ãã¦ãºã»ã©ãã®æéã§ãã
å æ¥ã®è¨äº(åå¹´ããã£ããã°èª¿æ»ã®é¡æ«ã¯)ã§ã¯ãé·æéè¦å´ããä¸å ·å調æ»ã«ã¤ãã¦ãã£ããã¨ã¾ã¨ãã¦é ããã®ã§ããã®è¡éã«èµ·ããããããã®ãã¨ãæãèµ·ãããã²ã¨ãææ ¨ã«ãµãã£ã¦ãã¾ãã (ç§ãè¨äºå稿ãã¬ãã¥ã¼ãã¾ããããããç§ãæ¸ãããæãå ¥ããå¼·ããã¦é·æã«ãªã£ã¦ãã¾ãããã£ã¨èªã¿ã¥ãããªã£ã¦ãã¾ã£ãã§ããããã)
ãã¦ãä»åã¯ãcrashblk ã¨ããã½ããã¦ã§ã¢ããªã¼ãã³ã½ã¼ã¹åããã®ã§ããã®ç´¹ä»ããããã¨æãã¾ãã ã½ã¼ã¹ã³ã¼ã㯠GitHub ã¬ãã¸ã㪠ã«ç½®ãã¦ããã¾ãã ã©ã¤ã»ã³ã¹ã¯ GPLv2 or 3 ã§ãã
crashblk ã¨ã¯
crashblk (ããã£ãã ã¶ãããã¨èªãã§ãã¾ã) ã¯ãLinux ã«ã¼ãã«ã®ãããã¯ããã¤ã¹ãã©ã¤ãããã¡ã¤ã«ã·ã¹ãã ãªã©ããã¹ãããããã®ãããã¯ããã¤ã¹ãã©ã¤ãã§ããç§ã¯ WalB ãéçºãã¦ãã¾ããããã®å質ãé«ããããã®éå ·ã®ã²ã¨ã¤ã¨ã㦠crashblk ãä½ãã¾ããã
crashblk ã®æ©è½ã¯ä»¥ä¸ã® 3 ã¤ã§ãã
- ã¯ã©ãã·ã¥æ¨¡æ¬
- IO ã¨ã©ã¼æ¨¡æ¬
- ã¬ã¹ãã³ã¹ã¿ã¤ã è¨å®
ã¯ã©ãã·ã¥æ¨¡æ¬ã¯ãçªç¶ã®é»æºæã«ããæ¸ãè¾¼ã¿ã¯å®äºãã¦ãããã®ã®ãæ°¸ç¶åããã¦ããªããã¼ã¿ãæ¶ããæåããå®éã®é»æºæãããã«åç¾ãã¾ããIO ã¨ã©ã¼æ¨¡æ¬ã¯ãã¹ãã¬ã¼ã¸ã®æ éã«ãããæ¯èãã¨ãã¦ãIO ãå ¨ã¦ã¨ã©ã¼ã«ãªãæåãæ¸ã込㿠IO ã ãã¨ã©ã¼ã«ãªãæåã模æ¬ãã¾ããã¬ã¹ãã³ã¹ã¿ã¤ã è¨å®ã¯ãread, write, flush ã®ãªã¯ã¨ã¹ã種é¡æ¯ã«ãã¬ã¹ãã³ã¹ã¿ã¤ã ã®æ¯ãå¹ ãè¨å®ãããã¨ãã§ããã¹ãã¬ã¼ã¸ã®æ§ã ãªæ§è½ç¹æ§ãåç¾ãããã¨ãåºæ¥ã¾ãã
crashblk ã¯ãæ°¸ç¶åä¿è¨¼ãããã¯ãã®ãã¼ã¿ãæ°¸ç¶åããã¦ããããIO ã¨ã©ã¼æã«æå¾ ããæåããããããªã©ããã¹ãããããã«ä½¿ãã¾ããWalB ã«ã¼ãã«ãã©ã¤ãã®ãã¹ãã«ããã¦ã¯ãã¾ãã«ãããã®ç¨éã§ä½¿ãã¾ãããã¾ãããã¡ã¤ã«ã·ã¹ãã ã®ã¸ã£ã¼ãã«ã«ããä¸è²«æ§å¶å¾¡ãæ£å¸¸ã«åãã¦ããããªã©ã®ãã¹ãã«ã使ããã¨æãã¾ãã
å®è£ ã¯ãã¡ã¢ãªãããã¯ããã¤ã¹ãã©ã¤ãã¨ãªã£ã¦ãã¾ããå é¨çã«ã¯ãã¢ãã¬ã¹ããã¼ã¨ãã rb-tree æ§é ã 2 ã¤ä½¿ã£ã¦æ°¸ç¶åæ¸ã¿ã§ãªããã¼ã¿ã¨æ°¸ç¶åæ¸ã¿ã®ãã¼ã¿ãåãã¦ä¿æããæ°¸ç¶åæ¸ã¿ã§ã¯ãªããã¼ã¿ãæ¨ã¦ããã¨ã§ã¯ã©ãã·ã¥æ¨¡æ¬ãå®ç¾ãã¦ãã¾ããã¾ããã¬ã¹ãã³ã¹ã¿ã¤ã ã調æ´ããããã«ãdelayed workqueue ãå©ç¨ãã¦ãã¾ããrb-tree ã delayed workqueue 㯠Linux ã«ã¼ãã«å ã®éå ·ã¨ãã¦ç¨æããã¦ãããWalB ã«ã¼ãã«ãã©ã¤ãã®éçºçµé¨ããã£ãã®ã§ãcrashblk ãå®è£ ããã®ã¯æ¯è¼çç°¡åã§ããã
crashblk ã¨ä¸å ·å調æ»ãå·¡ããã©ã
å®ã¯ãæåã« crashblk ãä½ã£ãã®ã¯ 2014 å¹´ã§ãWalB ã«ã¼ãã«ãã©ã¤ãããã¹ãããè¦ã¤ãã£ãä¸å ·åãä¿®æ£ãã¦ãããã§æºè¶³ãã¦ãã¾ããããããã å æ¥ã®è¨äºã®ã²ã¨ã¤ç®ã®ä¸å ·åã¯ã WalB ã«ã¼ãã«ãã©ã¤ãã® flush (æ°¸ç¶å)ã«é¢ãããã®ã ã£ãã«ãé¢ããããcrashblk ã«ãããã¹ãã§çºè¦ãããã¨ãåºæ¥ã¦ãã¾ããã§ããã
ãã®çç±ã¯ãcrashblk ã® IO å¦çæ¹æ³ãå®å¨ã®ã¹ãã¬ã¼ã¸ã«ããã IO æåã«æ¯ã¹ãã¨åç´ããããã¨ã§ããä¸è¬ã«ã¹ãã¬ã¼ã¸ããã¤ã¹ã¯ãIO ãã¹ã±ã¸ã¥ã¼ãªã³ã°ãå®è¡é åºã並ã³æãããã¨ã許ããã¦ãããIO ã submit ããã¦ãããå®éã«å¦çãè¡ããcompletion ãè¿ãã¾ã§ã®æéå¹ ãããã¾ããè¤æ° IO ã®å®è¡æéã¯éè¤ãå¾ãã®ã§ãã
以ä¸ã®å³ãè¦ã¦ãã ããã
Write A
ãå®äºããåã« submit ãããå·¦å´ã® Flush
ã¯ãA
ãæ°¸ç¶åãã責任ãããã¾ããããå³å´ã® Flush
㯠A
ãæ°¸ç¶åãã責任ãããã¾ãã件ã®ä¸å
·åã¯ãå·¦å´ã® Flush
㧠A
ãæ°¸ç¶åããããã®ã ã¨åéããã¦ãããå®è£
ããããã¦ãããã¨ãåå ã§ãããå®éã«è©ä¾¡ã«ä½¿ã£ãã¹ãã¬ã¼ã¸ã¯ã¾ãã«ãã®éããåºããã¨ã®ããæ§è½ç¹æ§ãæã£ã¦ããã®ã§ãã
ããã¾ã§ã® crashblk 㯠IO ãç´åã«å®è¡ãã¦ãã¾ãã®ã§ãè¤æ° IO å®è¡æéãéè¤ããã¨ããæåã模æ¬ã§ãã¦ãã¾ããã§ãããããã«é¢é£ãã¦èµ·ããä¸å ·åããå½ç¶åç¾ãããã¨ã¯åºæ¥ãªãã£ãã¨ãããã¨ã«ãªãã¾ãããããã¾ãã«ä»¶ã®ä¸å ·åã ã£ãã®ã§ãã
å ç¨ç´¹ä»ãã 3 çªç®ã®ãã¬ã¹ãã³ã¹ã¿ã¤ã è¨å®ãæ©è½ã¯ã件ã®ä¸å ·åãçºè¦ã§ããªãã£ãåçãããæ¨å¹´æ«ã«éå¬ããã社å ããã«ã½ã³(ãã¡ãã®è¨äºãåç §)ã§ãå®è£ ãã¾ããããã®æ©è½ã使ããã¨ã«ãããä¸å ·åã容æã«åç¾åºæ¥ããã¨ã確èªãã¾ããã
以ä¸ã®å³ããããã«ã½ã³åå¾ã® IO å¦çããã¼ã示ãããã®ã«ãªãã¾ãã é常ã®ãã¥ã¼ã§ã¯ãªããã©ã³ãã æéå¾ ã£ã¦ã¿ã¹ã¯ãå®è¡ãã delayed queue ãå©ç¨ãããã¨ã§ãIO é åºã®å ¥ãæ¿ãã表ç¾ããè¤æ° IO ã®éè¤ã模æ¬ã§ããããã«ãªãã¾ããã
å æ¥ã®è¨äºã§ã¯ã件ã®ä¸å ·åãå«ã 2 ã¤ã®ä¸å ·åãçºè¦ãããæ¨ãç´¹ä»ãã¦ãã¾ãããå®ã¯ 3 ã¤ç®ã®ä¸å ·åããWalB ã®ã¦ã¼ã¶ã¼ã©ã³ããã¼ã«ã«åå¨ãã¦ãã¾ãããããã 3 ã¤ã®ä¸å ·åã¯å ¨ã¦ invalid logpack ã¨ããåãç¾è±¡ã¨ãã¦è¦³æ¸¬ãããã®ã§ãè¦å´ãã¦ä¸å ·åãç´ãã¦ããæ®ã£ã¦ããä¸å ·åèµ·å ã§ç¾è±¡ãåç¾ãããã¨ããæªå¤¢ã 2 åãèµ·ãããã¨ã«ãªãã¾ããå¿ãæãããã«ãªã£ã¦æ給ä¼æã使ãã¾ãã£ã¦ãä»æ¹ãªãã§ãã(^^;
ä»ã® 2 ã¤ã«æ¯ã¹ã¦åå ç¹å®ã¾ã§ã®æéãçãã£ããããå æ¥ã®è¨äºã§ã¯çç¥ããã¦ãã¾ããã3 ã¤ç®ã®ä¸å ·ååç¾é »åº¦ã 3 æ¥ã« 1 åãã 30 åã« 1 åã¨ã2 ã±ã¿ä¸æããããã¨ãåºæ¥ãåå ç¹å®ã¾ã§ã®æéãæ©ãã¦ãããã®ã¯ãæ¹è¯çã® crashblk ã§ããããããã¨ããcrashblkãé å¼µã£ãã俺ã
ã¾ã¨ã
ä»åãªã¼ãã³ã½ã¼ã¹åãã crashblk ã®ç´¹ä»ãããã¦ããã ãã¾ãããããã使ããããªãæ¹ã¯å°ãªãããç¥ãã¾ããããèå³ã®ããæ¹ã¯æ¯é触ã£ã¦ã¿ã¦ãã ãããæ¯è¼çåç´ãªä½ãã«ãªã£ã¦ãã¾ãã®ã§ãLinux ã«ã¼ãã«ã®ãããã¯ããã¤ã¹ãã©ã¤ããä½ã£ã¦ã¿ããã¨ããæ¹ã®åå¼·ç¨ã¨ãã¦ããªã¹ã¹ã¡ã§ãã