-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLecture 11 Cache Consistency Frangipani.srt
5077 lines (4225 loc) · 145 KB
/
Lecture 11 Cache Consistency Frangipani.srt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1
00:00:00,900 --> 00:00:16,359
今天的论文,我要讨论这个鸡蛋花,这是一个相当老的
today the paper I'm going to discuss
this frangipani this is a fairly old
2
00:00:16,359 --> 00:00:21,099
分布式文件系统文件之所以读取它的原因是因为它
distributed file system paper the reason
why were reading it though is because it
3
00:00:21,099 --> 00:00:25,829
与缓存一致性和
has a lot of interesting and good design
having to do with cache coherence and
4
00:00:25,829 --> 00:00:31,029
分布式事务和分布式崩溃恢复以及
distributed transactions and distributed
crash recovery as well as the
5
00:00:31,029 --> 00:00:35,500
他们之间的互动,那才是真正的想法
interactions between them so those are
those are the really the ideas behind
6
00:00:35,500 --> 00:00:42,699
这是我们要尝试挑出来的,所以这真的是我们很多
this that we're gonna try to tease out
so these are it's really a lot of our
7
00:00:42,699 --> 00:00:50,679
缓存一致性是我是否有缓存的想法
caching coherence is really the idea of
if I have something cached that
8
00:00:50,679 --> 00:00:54,370
但是,即使我有缓存,如果您修改它,您也会知道
nevertheless if you modify it despite me
having a cache you know something will
9
00:00:54,370 --> 00:00:58,809
发生,以便我可以看到您的修改,我们也有
happen so I can see your your
modifications and we also have
10
00:00:58,809 --> 00:01:06,910
将其内部需要的操作分发给文件系统,以便能够
distributed its actions which are needed
internally to file systems to be able to
11
00:01:06,910 --> 00:01:14,560
对文件系统的数据结构进行复杂的更新,因为文件
make complex updates to the file system
data structures and because the file
12
00:01:14,560 --> 00:01:19,270
系统本质上是由一堆服务器拆分而成的
system is essentially split up among a
bunch of servers it's critical to be
13
00:01:19,270 --> 00:01:30,130
能够从崩溃中恢复,那些服务器的整体设计成为了朋友
able to recover from crashes and those
servers the overall design a friend
14
00:01:30,130 --> 00:01:37,840
pammi这是一个旨在查找现有文件的网络文件系统
pammi it's a network file system it's
intended to look to existing
15
00:01:37,840 --> 00:01:41,050
旨在与UNIX等现有应用程序一起使用的应用程序
applications this is intended to work
with existing applications like UNIX
16
00:01:41,050 --> 00:01:47,620
我们在人的工作站上运行的普通UNIX程序
programs ordinary UNIX programs we're
running on people's workstations much
17
00:01:47,620 --> 00:01:53,500
像Athena的AFS一样,您可以在Athena主目录中找到各种
like Athena's AFS lets you get at your
Athena home directory and various
18
00:01:53,500 --> 00:01:58,690
任何Athena工作站的项目目录,总的来说
project directories from any Athena
workstation so the kind of overall
19
00:01:58,690 --> 00:02:06,010
图片是您有一堆用户,论文世界中的每个用户都是
picture is that you have a bunch of
users each user in the papers world is
20
00:02:06,010 --> 00:02:09,369
坐在工作站前面,你知道那不是笔记本电脑吗
sitting in front of a workstation which
is you know real not a laptop in those
21
00:02:09,369 --> 00:02:12,430
天,但有点像带键盘和鼠标显示的计算机,
days but sort of computer with a
keyboard and display in a mouse and
22
00:02:12,430 --> 00:02:14,490
Windows系统,所以每个人都坐着
Windows system at all so each one is
sitting
23
00:02:14,490 --> 00:02:19,260
在计算机工作站的前面,我要称呼您知道的工作站
front of a computer workstation I'm
gonna call the workstations you know
24
00:02:19,260 --> 00:02:27,600
工作站每个工作站再运行一个工作站
workstation one more station to each
workstation runs an instance of the
25
00:02:27,600 --> 00:02:32,930
素馨花服务器,我的意思是说,你知道的几乎所有
frangipani server I meant so a huge
amount of the you know almost all of the
26
00:02:32,930 --> 00:02:40,440
这篇论文中发生的事情在每个鸡蛋夹软件中都有
stuff that happens in this paper goes on
in the frangipani software in each
27
00:02:40,440 --> 00:02:44,490
工作站,所以也许他们坐在工作站前面,
workstation so maybe they're sitting in
front of a workstation and they might be
28
00:02:44,490 --> 00:02:48,540
运行普通程序,例如读取和写入文件的文本编辑器
running ordinary programs like a text
editor that's reading and writing files
29
00:02:48,540 --> 00:02:51,540
也许当他们完成源文件的编辑后,他们会通过
and maybe when they finished editing a
source file they run it through the
30
00:02:51,540 --> 00:02:57,570
这些普通程序制作文件时,Reiser源文件的编译器
compiler that the Reiser source file
when these ordinary programs make file
31
00:02:57,570 --> 00:03:08,040
内核中有一个系统调用,其中有一个素馨花模块,该模块实现了
system calls inside the kernel there's a
frangipani module that implements the
32
00:03:08,040 --> 00:03:15,690
所有这些工作站内部的文件系统互相复制,然后
file system inside of all of these
workstations each other on copy and then
33
00:03:15,690 --> 00:03:19,980
文件系统数据结构的真实存储,例如文件
the real storage of the file system data
structures things like certainly file
34
00:03:19,980 --> 00:03:24,120
内容,还有I节点和目录以及alissa文件,以及每个
contents but also I nodes and
directories and alissa file and each
35
00:03:24,120 --> 00:03:28,710
目录以及有关我所知道的信息和哪些块是免费的信息
directory and the information about what
I knows and what blocks are free all
36
00:03:28,710 --> 00:03:37,560
存储在称为花瓣的共享虚拟磁盘表面中,它位于单独的
that's stored in a shared virtual disk
surface called petal it's on a separate
37
00:03:37,560 --> 00:03:40,650
您知道的一组计算机可能是服务器计算机和一台计算机
set of machines that are you know
probably server machines and a machine
38
00:03:40,650 --> 00:03:45,090
房间,而不是人们桌子上的工作站
room rather than workstations on
people's desks pedal among many other
39
00:03:45,090 --> 00:03:48,510
东西会复制数据,因此您可以想到踏板服务器即将问世
things replicates data so you can sort
of think of pedal servers is coming in
40
00:03:48,510 --> 00:03:58,020
对和一次崩溃,我们仍然可以获取我们的数据,因此当素馨花时
pairs and one crashes we can still get
at our data and so when frangipani
41
00:03:58,020 --> 00:04:02,370
需要读取或写入一个您知道读取的目录或它发送远程内容的东西
needs to read or write a you know read a
directory or something it sends a remote
42
00:04:02,370 --> 00:04:06,360
程序调用正确的踏板服务器说得好,这是
procedure call off to the correct pedal
server to say well here's the block that
43
00:04:06,360 --> 00:04:10,650
我需要您知道,请为我阅读,然后将其退还给
I need you know please read it for me
please return that block and for the
44
00:04:10,650 --> 00:04:16,108
花瓣的大部分部分就像磁盘驱动器,您可以将其视为一种
most part petal is acting like a disk
drive you can think of it as a kind of
45
00:04:16,108 --> 00:04:25,800
作为一个共享磁盘驱动器共享,所有这些素馨花素的膝盖都在与之交谈,
shared as a shared disk drive that all
these frangipane knees talk to and it's
46
00:04:25,800 --> 00:04:28,700
称为虚拟磁盘
called a virtual disk
47
00:04:31,830 --> 00:04:35,440
从我们的角度来看,对于大多数讨论,我们只是想像
from our point of view for most of this
discussion we're just going to imagine
48
00:04:35,440 --> 00:04:39,580
踏板只是磁盘驱动器,所有这些都通过网络使用
pedal is just being a disk ride that's
used over the network by all these
49
00:04:39,580 --> 00:04:44,950
Handy's的朋友,所以您可以给它一个方块来读写
friends of Handy's and so it has you
read and write it by giving it a block
50
00:04:44,950 --> 00:04:47,919
磁盘上的数字或地址,似乎我想读取该块
number or an address on the disk and
seem like I'd like to read that block
51
00:04:47,919 --> 00:05:00,730
就像普通的硬盘一样,所以该文件的预期用途是
just like an ordinary hard drive okay so
the intended use for this file so the
52
00:05:00,730 --> 00:05:05,590
作者打算使用的用途实际上是
use that the authors intended is
actually reasonably important driver in
53
00:05:05,590 --> 00:05:10,690
设计他们想要的是支持自己的活动以及
the design what they wanted was to
support their own activities and what
54
00:05:10,690 --> 00:05:16,600
他们是某个研究实验室的成员,也许有50个人
they were were were members of a
research lab of maybe say 50 people in
55
00:05:16,600 --> 00:05:20,890
这个研究实验室,他们习惯于共享基础设施,例如时间
this research lab and they were used to
shared infrastructure things like time
56
00:05:20,890 --> 00:05:27,070
使用以前的网络文件系统共享机器或工作站以共享
sharing machines or workstations using
previous network file systems to share
57
00:05:27,070 --> 00:05:31,000
合作研究人员之间的文件,所以他们都希望他们
files among cooperating groups of
researchers so they both wanted they
58
00:05:31,000 --> 00:05:33,970
他们想要一个可以用来存储自己的主目录的文件系统
they wanted a file system that they
could use to store their own home
59
00:05:33,970 --> 00:05:39,550
目录以及存储共享的项目文件,因此这意味着
directories in as well as storing shared
project files and so that meant that if
60
00:05:39,550 --> 00:05:43,270
我编辑一个文件,我真的很希望其他人和我的其他人
I edit a file I'd really like the other
people my work and the other people I
61
00:05:43,270 --> 00:05:47,320
可以读取我刚刚编辑的文件,因此我们希望
work with to be able to read the file I
just edited so we want that kind of
62
00:05:47,320 --> 00:05:52,780
分享,此外,如果我能坐在我的任何工作站上也很棒
sharing and in addition it's great if I
can sit down at any workstation my
63
00:05:52,780 --> 00:05:57,550
工作站您的工作站是库中的公共工作站,仍然可以
workstation your workstation a public
workstation in the library and still get
64
00:05:57,550 --> 00:06:01,240
在我所有主目录的所有文件中
at all of the files of all my home
directory everything I need in my
65
00:06:01,240 --> 00:06:07,000
环境,因此他们对人类用户的共享文件系统非常感兴趣
environment so they're really interested
in a shared file system for human users
66
00:06:07,000 --> 00:06:12,820
在一个相对较小的组织中,规模很小,每个人都可以信任所有人
in a relatively small organization small
enough that everybody was trusted all
67
00:06:12,820 --> 00:06:16,810
人们所有的计算机,所以实际上设计几乎没有什么可做的
the people all the computers so really
the design has essentially nothing to
68
00:06:16,810 --> 00:06:21,820
说到安全性,实际上可以说在像这样的环境中是行不通的
say about security and indeed arguably
would not work in an environment like
69
00:06:21,820 --> 00:06:26,410
雅典娜,您无法真正信任用户或工作站,因此
Athena where you can't really trust the
users or the workstations so it's really
70
00:06:26,410 --> 00:06:34,450
就性能而言,非常适合其环境而设计
very much designed for their their
environment now as far as performance
71
00:06:34,450 --> 00:06:37,630
他们的环境也很重要,你知道事实证明,
their environment was also important you
know it turns out that the way most
72
00:06:37,630 --> 00:06:40,569
人们使用计算机是他们坐在前面的租赁工作站
people use computers are leased
workstations they sit in front of is
73
00:06:40,569 --> 00:06:44,679
他们主要是读写自己的文件,并且可能会读取一些共享的文件
that they mostly read and write their
own files and they may read some shared
74
00:06:44,679 --> 00:06:50,289
您知道程序或某些项目文件之类的文件,但大多数情况下
files you know programs or some project
files or something but most of the time
75
00:06:50,289 --> 00:06:53,770
我正在读写文件,而您正在读写文件
I'm reading and writing my files and
you're reading and writing your files on
76
00:06:53,770 --> 00:06:57,189
您的工作站,您知道这确实是我们积极参与的例外
your workstation and you know it's
really the exception that we're actively
77
00:06:57,189 --> 00:07:01,629
共享文件,因此能够以一种方式或
sharing files so it makes a huge amount
of sense to be able to one way or
78
00:07:01,629 --> 00:07:06,099
即使正式的文件的真实副本存储在此
another even though officially the real
copies of files are stored in this
79
00:07:06,099 --> 00:07:11,499
共享磁盘,如果我们可以进行某种缓存,那就太棒了,因此
shared disk it's fantastic if we can
have some kind of caching so that after
80
00:07:11,499 --> 00:07:15,610
我登录后将文件在本地缓存了一段时间,以便可以
I log in and I use my files for a while
they're locally cached here so they can
81
00:07:15,610 --> 00:07:20,169
被弄到,你知道微秒而不是毫秒,如果
be gotten gotten that and you know
microseconds instead of milliseconds if
82
00:07:20,169 --> 00:07:27,639
我们必须从文件服务器中获取它们,以便支持法国比利牛斯山脉
we have to fetch them from the file
servers ok so French Pyrenees supported
83
00:07:27,639 --> 00:07:33,849
这种缓存还不仅支持右向缓存
this this kind of caching furthermore it
supported right-back caching not only
84
00:07:33,849 --> 00:07:40,479
在每个工作站和每个素馨花服务器中缓存每个缓存
caching in each in each workstation and
each frangipani server we also have
85
00:07:40,479 --> 00:07:49,149
右后缓存,这意味着如果我要修改某些内容,
right back caching which means that if I
want to modify something if I modify a
86
00:07:49,149 --> 00:07:53,409
文件,甚至在目录中创建文件,或者删除文件或基本上
file or even create a file in a
directory or delete a file or basically
87
00:07:53,409 --> 00:07:57,939
只要没有其他工作站不需要看的其他任何操作
do any other operation as long as nobody
else no other workstation needs to see
88
00:07:57,939 --> 00:08:01,659
鸡蛋花与回写缓存一起使用
it
frangipani acts with a write back cache
89
00:08:01,659 --> 00:08:07,240
这意味着如果我在以下位置创建文件,我的写操作将仅保留在缓存中本地
and that means that my writes stay only
local in the cache if I create a file at
90
00:08:07,240 --> 00:08:11,740
至少最初有关新创建文件的信息表示新
least initially the information about
the newly created file said a newly
91
00:08:11,740 --> 00:08:16,809
用初始化的内容分配了索引节点,并且您知道添加了新条目
allocated inode with initialized
contents and you know a new entry added
92
00:08:16,809 --> 00:08:21,219
以新的名字对待我的主目录的所有这些修改
to a new name attitudes to my home
directory all those modifications
93
00:08:21,219 --> 00:08:25,389
最初只是在缓存中完成,因此创建文件之类的事情
initially are just done in the cache and
therefore things like creating a file
94
00:08:25,389 --> 00:08:30,300
可以非常快速地完成,他们只需要在此修改本地内存
can be done extremely rapidly they just
require modifying local memory in this
95
00:08:30,300 --> 00:08:34,630
机器的磁盘缓存,它们通常不会写回去兜售,直到
machine's disk cache and they're not
written back in general to peddle until
96
00:08:34,630 --> 00:08:39,519
之后,至少在最初,我们可以对文件进行各种修改
later so at least initially we can do
all kinds of modifications to the file
97
00:08:39,519 --> 00:08:44,889
系统,至少到我自己的目录,我自己的文件完全在本地,这就是
system at least to my own directories my
own files completely locally and that's
98
00:08:44,889 --> 00:08:48,639
对性能非常有帮助,就像您知道的千分之一
enormous ly helpful for performance it's
like a you know factor of a thousand
99
00:08:48,639 --> 00:08:52,149
能够修改本地存储器中的内容与具有
difference being able to modify
something in local memory versus having
100
00:08:52,149 --> 00:08:59,470
发送远程过程调用以立即发送服务器的一个严重后果是
to send a remote procedure calls to send
server now one serious consequence of
101
00:08:59,470 --> 00:09:06,130
这是这里体系结构的绝对决定因素
that it's extremely determinative of the
architecture here is that that meant
102
00:09:06,130 --> 00:09:11,860
文件系统的逻辑必须在每个工作站中才能使
that the logic of the file system has to
be in each workstation in order for my
103
00:09:11,860 --> 00:09:15,700
工作站能够执行诸如创建文件等操作
workstation to be able to implement
things like create a file just operating
104
00:09:15,700 --> 00:09:20,740
脱离其本地缓存,意味着文件的所有逻辑和所有智能
out of its local cache it means all the
logic all the intelligence for the file
105
00:09:20,740 --> 00:09:24,070
系统必须坐在我的工作站及其设计中
system has to be sitting here in my
workstation and in their design
106
00:09:24,070 --> 00:09:28,720
基本上与踏板共享存储系统知道的近似
basically to a first approximation the
pedal shared storage system knows
107
00:09:28,720 --> 00:09:34,450
绝对没有关于文件系统或文件或目录的所有逻辑
absolutely nothing about file systems or
files or directories all that logic this
108
00:09:34,450 --> 00:09:38,920
从某种意义上说,这是一个非常简单的简单系统,
is a very in a sense very
straightforward simple system and all
109
00:09:38,920 --> 00:09:46,089
每位客户的素馨花都在这里,这是非常复杂的
the complexity is here in the frangipani
in each client so it's a very kind of
110
00:09:46,089 --> 00:09:50,770
分散计划,原因之一是-因为那就是你
decentralized scheme and one of the
reasons is - because that's what you
111
00:09:50,770 --> 00:09:56,339
真正需要的或这些是他们可以想到的设计,以允许他们做
really need or these that was a design
they could think of to allow them to do
112
00:09:56,339 --> 00:10:00,610
纯粹在每个工作站本地进行修改,它确实具有不错的一面
modifications purely locally in each
workstation it does have the nice side
113
00:10:00,610 --> 00:10:05,470
效果虽然我是因为大多数复杂性和大部分CPU时间
effect though that I'm since most of the
complexity and most of the CPU time
114
00:10:05,470 --> 00:10:09,970
花费是在这里花费的,这意味着您在添加用户时将工作站添加到
spent is spent here it means that as you
add workstations as you add users to the
115
00:10:09,970 --> 00:10:16,870
系统会自动获得更多的CPU容量来运行这些新用户文件
system you automatically get more CPU
capacity to run those new users file
116
00:10:16,870 --> 00:10:21,550
系统操作,因为大多数文件系统操作仅发生在本地
system operations because most file
system operations happen just locally in
117
00:10:21,550 --> 00:10:25,690
占用CPU时间最多的工作站是在这里,因此系统会
the workstation that's most of the CPU
time is spent here so the system does
118
00:10:25,690 --> 00:10:30,550
每次添加工作站时,都具有一定程度的自然扩展可伸缩性
have a certain degree of natural scaling
scalability as you add workstations each
119
00:10:30,550 --> 00:10:33,459
新的工作站给新用户带来了更多负担,但同时也带来了更多负担
new workstation is a bit more load from
a new user but it's also a bit more
120
00:10:33,459 --> 00:10:38,260
用户运行文件系统的可用CPU时间
available CPU time to run that users
file system operations of course at some
121
00:10:38,260 --> 00:10:44,800
点,您将在中央存储系统中用完所有气体,然后您
point you're gonna run out of gas here
in the central storage system and you
122
00:10:44,800 --> 00:10:52,980
知道,那么您可能需要添加更多存储服务器
know then you may need to add more
storage servers to all right
123
00:10:54,830 --> 00:11:01,320
好吧,所以我们有在这里进行认真缓存的系统,此外
so okay so we have the system that does
serious caching here and furthermore
124
00:11:01,320 --> 00:11:06,750
在缓存中进行修改,实际上这些修改会立即
does the modifications in the cache that
actually these immediately to some
125
00:11:06,750 --> 00:11:11,670
设计中的严峻挑战,而设计主要是要解决
serious challenges in the design and the
design is mostly about solving the
126
00:11:11,670 --> 00:11:20,339
我要提出的挑战在很大程度上是
challenges I'm about to lay out these
are largely count challenges of that's
127
00:11:20,339 --> 00:11:28,380
来自缓存和这种分散式架构,其中大多数
come from caching and this sort of
decentralized architecture where most of
128
00:11:28,380 --> 00:11:43,220
情报掌握在客户中,所以第一个挑战是
the intelligence is sitting in the
clients so the first challenge is that
129
00:11:45,500 --> 00:11:55,890
假设工作站在您创建的文件中知道一个可能是/ aa new的文件
suppose workstation one creates a file
in you know maybe a file say /a a new
130
00:11:55,890 --> 00:12:01,380
文件/ a,最初它只是在其本地缓存中创建此文件,以便您知道
file /a and initially it just creates
this in its local cache so that you know
131
00:12:01,380 --> 00:12:05,010
首先,它可能需要从中获取slash目录的当前内容。
first it may need to fetch the current
contents of the slash directory from
132
00:12:05,010 --> 00:12:10,110
花瓣标称值,但是当它创建文件时,只需修改其缓存副本并
petal nom but then when it creates a
file just modifies its cached copy and
133
00:12:10,110 --> 00:12:14,459
不会立即将其发送回兜售,这是一个直接的问题
doesn't immediately send it back to
peddle then there's an immediate problem
134
00:12:14,459 --> 00:12:19,709
这里假设工作站2上的用户尝试获取目录的目录
here suppose the user on workstation 2
tries to get a directory listing of the
135
00:12:19,709 --> 00:12:24,720
目录斜杠,我们非常希望能够使该用户看到新的
directory slash right we'd really like
to be able to this user see the newly
136
00:12:24,720 --> 00:12:29,339
创建文件的权利,这就是用户的期望,用户将非常
created file right and that's what users
are gonna expect and users will be very
137
00:12:29,339 --> 00:12:33,420
如果您认识我旁边的人感到困惑,创建了一个文件并说哦
confused if you know person down the
hall from me created a file and said oh
138
00:12:33,420 --> 00:12:36,360
你知道我把所有这些有趣的信息放在这个新文件中/ a为什么
you know I put all this interesting
information in this new file /a why
139
00:12:36,360 --> 00:12:41,040
你不去读它,然后我试着去读它,它完全不存在,所以我们
don't you go read it and then I try to
read it and it's totally not there so we
140
00:12:41,040 --> 00:12:45,000
如果大厅里的人说他们已经
absolutely want very strong consistency
if the person down the hall says they've
141
00:12:45,000 --> 00:12:49,200
在文件系统中完成了某些操作,我应该能够看到它,如果我编辑了
done something in the file system I
should be able to see it and if I edit a
142
00:12:49,200 --> 00:12:54,330
文件放在一个工作站上,然后在另一台计算机上编译它
file on one work station and then maybe
compile it on a computer on another
143
00:12:54,330 --> 00:12:58,500
计算机,我希望编译器查看我对文件所做的修改
computer I want the compiler to see the
modifications I just made to my file
144
00:12:58,500 --> 00:13:05,540
这意味着文件系统必须做一些事情以确保读者能够看到
which means that the file system has to
do something to ensure that readers see
145
00:13:05,540 --> 00:13:11,279
甚至是最近的版权,所以我们一直在谈论这一点
even the most recent rights so we've
been talking about this as we've been
146
00:13:11,279 --> 00:13:15,740
称其为强先验性和线性化能力
calling this you know strong strong
consistency and linearize ability before
147
00:13:15,740 --> 00:13:20,850
这基本上是我们在缓存上下文中想要的,尽管像问题一样
and that's basically what we want in the
context of caches though like the issue
148
00:13:20,850 --> 00:13:24,480
这与存储服务器无关,实际上与事实有关
here is not really about the storage
server necessarily it's about the fact
149
00:13:24,480 --> 00:13:28,860
在这里有一个修改,现在需要在其他地方看到
that there was a modification here that
needs to be seen somewhere else and now
150
00:13:28,860 --> 00:13:38,790
由于历史原因,通常称为缓存一致性
for historical reasons that's usually
called cache coherence that is the
151
00:13:38,790 --> 00:13:43,649
缓存系统的属性,即使我有旧版本的东西
property of a caching system that even
if I have an old version of something
152
00:13:43,649 --> 00:13:48,269
如果其他人在其缓存中对其进行了修改,则该缓存将被缓存
cached if someone else modifies it in
their cache then my cache will
153
00:13:48,269 --> 00:13:53,550
自动反映其修改,因此我们需要此缓存
automatically reflect their
modifications so we want this cache
154
00:13:53,550 --> 00:14:01,889
一致性属性您遇到的另一个问题是,您了解所有一切
coherence property another issue you
have is that the you know everything all
155
00:14:01,889 --> 00:14:05,879
文件和目录是共享的,我们很容易遇到两种情况
the files and directories are shared we
could easily have a situation where two
156
00:14:05,879 --> 00:14:11,220
不同的工作站同时修改同一目录,因此
different workstations are modifying the
same directory at the same time so
157
00:14:11,220 --> 00:14:16,019
再次假设也许工作站上的用户想要创建一个文件
suppose again maybe the user one on
their workstation wants to create a file
158
00:14:16,019 --> 00:14:20,189
/ a是根目录中新目录中斜杠的新文件
/a which is a new file in the directory
slash in the new in the root directory
159
00:14:20,189 --> 00:14:27,209
并且同时用户两个想要创建一个称为斜杠B的新文件,因此在
and at the same time user two wants to
create a new file called slash B so at
160
00:14:27,209 --> 00:14:32,100
在某种程度上,您知道他们正在创建不同的文件a和B,但是它们
some level you know they're creating
different files alright a and B but they
161
00:14:32,100 --> 00:14:35,399
两者都需要修改根目录以向根目录添加新名称
both need to modify the root directory
to add a new name to the root directory
162
00:14:35,399 --> 00:14:40,920
所以问题是,即使他们同时执行此操作,您也知道要归档
and so the question is even if they do
this simultaneously you know to file
163
00:14:40,920 --> 00:14:44,339
创建不同名称的文件,但位于不同目录的同一目录中
creations of differently named files but
in the same directory from different
164
00:14:44,339 --> 00:14:51,029
工作站将使系统能够整理出这些并发的修改
workstations will the system be able to
sort out these concurrent modifications
165
00:14:51,029 --> 00:14:54,240
到同一目录,并得出一些合理的结果,当然
to the same directory and arrive at some
sensible result and of course the
166
00:14:54,240 --> 00:14:58,949
我们想要的明智结果是,a和B最终都存在,我们不想
sensible result we want is that both a
and B end up existing we don't want to
167
00:14:58,949 --> 00:15:04,230
最终遇到一些您知道的情况,其中只有一个最终存在
end up with some you know situation in
which only one of them ends up existing