📄 libtp_usenix.ps
字号:
3241(using)X3443(transactions.)X3895(Source)X4147(code)X555 4716(control)N805(systems,)X1101(such)X1271(as)X1361(RCS)X1534(and)X1673(SCCS,)X1910(should)X2146(use)X2276(transaction)X2651(semantics)X2990(to)X3075(allow)X3276(the)X3397(``checking)X3764(in'')X3903(of)X3992(groups)X4232(of)X555 4806(related)N801(\256les.)X1001(In)X1095(this)X1237(way,)X1418(if)X1493(the)X1617 0.2841(``check-in'')AX2028(fails,)X2212(the)X2336(transaction)X2714(may)X2878(be)X2980(aborted,)X3267(backing)X3547(out)X3675(the)X3799(partial)X4030(``check-)X555 4896(in'')N691(leaving)X947(the)X1065(source)X1295(repository)X1640(in)X1722(a)X1778(consistent)X2118(state.)X755 5019(A)N842(second)X1094(situation)X1398(where)X1624(transactions)X2036(can)X2177(be)X2282(used)X2458(to)X2549(replace)X2811(current)X3068(ad-hoc)X3316(mechanisms)X3741(is)X3822(in)X3912(applications)X555 5109(where)N776(concurrent)X1144(updates)X1413(to)X1499(a)X1559(shared)X1793(\256le)X1919(are)X2042(desired,)X2318(but)X2444(there)X2629(is)X2706(logical)X2948(consistency)X3345(of)X3435(the)X3556(data)X3713(which)X3932(needs)X4138(to)X4223(be)X555 5199(preserved.)N928(For)X1059(example,)X1371(when)X1565(the)X1683(password)X2006(\256le)X2128(is)X2201(updated,)X2495(\256le)X2617(locking)X2877(is)X2950(used)X3117(to)X3199(disallow)X3490(concurrent)X3854(access.)X4120(Tran-)X555 5289(saction)N804(semantics)X1142(on)X1244(the)X1364(password)X1689(\256les)X1844(would)X2066(allow)X2266(concurrent)X2632(updates,)X2919(while)X3119(preserving)X3479(the)X3598(logical)X3837(consistency)X4232(of)X555 5379(the)N681(password)X1012(database.)X1357(Similarly,)X1702(UNIX)X1930(utilities)X2196(which)X2419(rewrite)X2674(\256les)X2834(face)X2996(a)X3059(potential)X3366(race)X3528(condition)X3857(between)X4152(their)X555 5469(rewriting)N871(a)X929(\256le)X1053(and)X1191(another)X1453(process)X1715(reading)X1977(the)X2096(\256le.)X2259(For)X2391(example,)X2704(the)X2823(compiler)X3129(\(more)X3342(precisely,)X3673(the)X3792(assembler\))X4161(may)X8 s10 f555 5541(hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh)N5 s1 f727 5619(1)N8 s763 5644(To)N850(appear)X1035(in)X1101(the)X2 f1195(Proceedings)X1530(of)X1596(the)X1690(1992)X1834(Winter)X2024(Usenix)X1 f2201(,)X2233(San)X2345(Francisco,)X2625(CA,)X2746(January)X2960(1992.)X2 p%%Page: 2 28 s 8 xH 0 xS 1 f10 s3 f1 f555 630(have)N737(to)X829(rewrite)X1087(a)X1152(\256le)X1283(to)X1374(which)X1599(it)X1672(has)X1808(write)X2002(permission)X2382(in)X2473(a)X2538(directory)X2857(to)X2948(which)X3173(it)X3246(does)X3422(not)X3553(have)X3734(write)X3928(permission.)X555 720(While)N779(the)X904(``.o'')X1099(\256le)X1228(is)X1308(being)X1513(written,)X1787(another)X2055(utility)X2272(such)X2446(as)X3 f2540(nm)X1 f2651(\(1\))X2772(or)X3 f2866(ar)X1 f2942(\(1\))X3063(may)X3228(read)X3394(the)X3519(\256le)X3648(and)X3791(produce)X4077(invalid)X555 810(results)N790(since)X981(the)X1105(\256le)X1233(has)X1366(not)X1494(been)X1672(completely)X2054(written.)X2347(Currently,)X2700(some)X2895(utilities)X3160(use)X3293(special)X3542(purpose)X3821(code)X3998(to)X4085(handle)X555 900(such)N722(cases)X912(while)X1110(others)X1326(ignore)X1551(the)X1669(problem)X1956(and)X2092(force)X2278(users)X2463(to)X2545(live)X2685(with)X2847(the)X2965(consequences.)X755 1023(In)N845(this)X983(paper,)X1205(we)X1322(present)X1577(a)X1635(simple)X1870(library)X2106(which)X2324(provides)X2622(transaction)X2996(semantics)X3334(\(atomicity,)X3705(consistency,)X4121(isola-)X555 1113(tion,)N720(and)X857(durability\).)X1236(The)X1382(4.4BSD)X1658(database)X1956(access)X2182(methods)X2473(have)X2645(been)X2817(modi\256ed)X3121(to)X3203(use)X3330(this)X3465(library,)X3719(optionally)X4063(provid-)X555 1203(ing)N682(shared)X917(buffer)X1139(management)X1574(between)X1867(applications,)X2298(locking,)X2582(and)X2722(transaction)X3098(semantics.)X3478(Any)X3640(UNIX)X3865(program)X4161(may)X555 1293(transaction)N930(protect)X1176(its)X1274(data)X1430(by)X1532(requesting)X1888(transaction)X2262(protection)X2609(with)X2773(the)X3 f2893(db)X1 f2981(\(3\))X3097(library)X3333(or)X3422(by)X3524(adding)X3764(appropriate)X4152(calls)X555 1383(to)N646(the)X773(transaction)X1154(manager,)X1480(buffer)X1706(manager,)X2032(lock)X2199(manager,)X2525(and)X2670(log)X2801(manager.)X3147(The)X3301(library)X3543(routines)X3829(may)X3995(be)X4099(linked)X555 1473(into)N708(the)X834(host)X995(application)X1379(and)X1523(called)X1743(by)X1851(subroutine)X2217(interface,)X2547(or)X2642(they)X2808(may)X2974(reside)X3194(in)X3284(a)X3348(separate)X3640(server)X3865(process.)X4174(The)X555 1563(server)N772(architecture)X1172(provides)X1468(for)X1582(network)X1865(access)X2091(and)X2227(better)X2430(protection)X2775(mechanisms.)X3 f555 1749(2.)N655(Related)X938(Work)X1 f755 1872(There)N1000(has)X1164(been)X1373(much)X1608(discussion)X1998(in)X2117(recent)X2371(years)X2597(about)X2831(new)X3021(transaction)X3429(models)X3716(and)X3888(architectures)X555 1962 0.1172([SPEC88][NODI90][CHEN91][MOHA91].)AN2009(Much)X2220(of)X2310(this)X2448(work)X2636(focuses)X2900(on)X3003(new)X3160(ways)X3348(to)X3433(model)X3656(transactions)X4062(and)X4201(the)X555 2052(interactions)N953(between)X1245(them,)X1449(while)X1651(the)X1772(work)X1960(presented)X2291(here)X2453(focuses)X2717(on)X2820(the)X2941(implementation)X3466(and)X3605(performance)X4035(of)X4125(tradi-)X555 2142(tional)N757(transaction)X1129(techniques)X1492(\(write-ahead)X1919(logging)X2183(and)X2319(two-phase)X2669(locking\))X2956(on)X3056(a)X3112(standard)X3404(operating)X3727(system)X3969(\(UNIX\).)X755 2265(Such)N947(traditional)X1308(operating)X1643(systems)X1928(are)X2059(often)X2256(criticized)X2587(for)X2713(their)X2892(inability)X3190(to)X3283(perform)X3573(transaction)X3956(processing)X555 2355(adequately.)N971([STON81])X1342(cites)X1517(three)X1706(main)X1894(areas)X2088(of)X2183(inadequate)X2559(support:)X2849(buffer)X3074(management,)X3532(the)X3658(\256le)X3788(system,)X4058(and)X4201(the)X555 2445(process)N823(structure.)X1191(These)X1410(arguments)X1771(are)X1897(summarized)X2316(in)X2405(table)X2587(one.)X2769(Fortunately,)X3184(much)X3388(has)X3521(changed)X3815(since)X4006(1981.)X4232(In)X555 2535(the)N683(area)X848(of)X945(buffer)X1172(management,)X1632(most)X1817(UNIX)X2048(systems)X2331(provide)X2606(the)X2734(ability)X2968(to)X3060(memory)X3357(map)X3525(\256les,)X3708(thus)X3870(obviating)X4201(the)X555 2625(need)N734(for)X855(a)X918(copy)X1101(between)X1396(kernel)X1624(and)X1766(user)X1926(space.)X2171(If)X2251(a)X2313(database)X2616(system)X2864(is)X2943(going)X3151(to)X3239(use)X3372(the)X3496(\256le)X3624(system)X3872(buffer)X4095(cache,)X555 2715(then)N719(a)X781(system)X1029(call)X1171(is)X1250(required.)X1584(However,)X1924(if)X1998(buffering)X2322(is)X2400(provided)X2710(at)X2793(user)X2952(level)X3133(using)X3331(shared)X3566(memory,)X3878(as)X3970(in)X4057(LIBTP,)X555 2805(buffer)N776(management)X1210(is)X1287(only)X1452(as)X1542(slow)X1716(as)X1806(access)X2035(to)X2120(shared)X2353(memory)X2643(and)X2782(any)X2921(replacement)X3337(algorithm)X3671(may)X3832(be)X3931(used.)X4121(Since)X555 2895(multiple)N849(processes)X1185(can)X1325(access)X1559(the)X1685(shared)X1923(data,)X2105(prefetching)X2499(may)X2665(be)X2769(accomplished)X3238(by)X3346(separate)X3638(processes)X3973(or)X4067(threads)X555 2985(whose)N782(sole)X932(purpose)X1207(is)X1281(to)X1364(prefetch)X1649(pages)X1853(and)X1990(wait)X2149(on)X2250(them.)X2471(There)X2680(is)X2754(still)X2894(no)X2995(way)X3150(to)X3233(enforce)X3496(write)X3682(ordering)X3975(other)X4161(than)X555 3075(keeping)N829(pages)X1032(in)X1114(user)X1268(memory)X1555(and)X1691(using)X1884(the)X3 f2002(fsync)X1 f2180(\(3\))X2294(system)X2536(call)X2672(to)X2754(perform)X3033(synchronous)X3458(writes.)X755 3198(In)N845(the)X966(area)X1124(of)X1214(\256le)X1339(systems,)X1635(the)X1756(fast)X1895(\256le)X2020(system)X2265(\(FFS\))X2474([MCKU84])X2871(allows)X3103(allocation)X3442(in)X3527(units)X3704(up)X3806(to)X3890(64KBytes)X4232(as)X555 3288(opposed)N846(to)X932(the)X1054(4KByte)X1327(and)X1466(8KByte)X1738(\256gures)X1979(quoted)X2220(in)X2305([STON81].)X2711(The)X2859(measurements)X3341(in)X3426(this)X3564(paper)X3766(were)X3946(taken)X4143(from)X555 3378(an)N655(8KByte)X928(FFS,)X1104(but)X1230(as)X1320(LIBTP)X1565(runs)X1726(exclusively)X2114(in)X2199(user)X2356(space,)X2578(there)X2762(is)X2838(nothing)X3105(to)X3190(prevent)X3454(it)X3521(from)X3700(being)X3901(run)X4031(on)X4134(other)X555 3468(UNIX)N776(compatible)X1152(\256le)X1274(systems)X1547(\(e.g.)X1710(log-structured)X2180([ROSE91],)X2558(extent-based,)X3004(or)X3091(multi-block)X3484([SELT91]\).)X755 3591(Finally,)N1029(with)X1199(regard)X1433(to)X1523(the)X1648(process)X1916(structure,)X2244(neither)X2494(context)X2757(switch)X2993(time)X3162(nor)X3296(scheduling)X3670(around)X3920(semaphores)X555 3681(seems)N785(to)X881(affect)X1099(the)X1231(system)X1487(performance.)X1968(However,)X2317(the)X2449(implementation)X2984(of)X3084(semaphores)X3496(can)X3641(impact)X3892(performance)X555 3771(tremendously.)N1051(This)X1213(is)X1286(discussed)X1613(in)X1695(more)X1880(detail)X2078(in)X2160(section)X2407(4.3.)X755 3894(The)N908(Tuxedo)X1181(system)X1431(from)X1615(AT&T)X1861(is)X1941(a)X2004(transaction)X2383(manager)X2687(which)X2910(coordinates)X3307(distributed)X3676(transaction)X4055(commit)X555 3984(from)N738(a)X801(variety)X1051(of)X1145(different)X1449(local)X1632(transaction)X2011(managers.)X2386(At)X2493(this)X2634(time,)X2822(LIBTP)X3070(does)X3243(not)X3371(have)X3549(its)X3650(own)X3814(mechanism)X4205(for)X555 4074(distributed)N942(commit)X1231(processing,)X1639(but)X1786(could)X2009(be)X2130(used)X2322(as)X2434(a)X2515(local)X2716(transaction)X3113(agent)X3331(by)X3455(systems)X3752(such)X3943(as)X4054(Tuxedo)X555 4164([ANDR89].)N10 f863 4393(i)N870(iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii)X1 f903 4483(Buffer)N1133(Management)X10 f1672(g)X1 f1720(Data)X1892(must)X2067(be)X2163(copied)X2397(between)X2685(kernel)X2906(space)X3105(and)X3241(user)X3395(space.)X10 f1672 4573(g)N1 f1720(Buffer)X1950(pool)X2112(access)X2338(is)X2411(too)X2533(slow.)X10 f1672 4663(g)N1 f1720(There)X1928(is)X2001(no)X2101(way)X2255(to)X2337(request)X2589(prefetch.)X10 f1672 4753(g)N1 f1720(Replacement)X2159(is)X2232(usually)X2483(LRU)X2663(which)X2879(may)X3037(be)X3133(suboptimal)X3508(for)X3622(databases.)X10 f1672 4843(g)N1 f1720(There)X1928(is)X2001(no)X2101(way)X2255(to)X2337(guarantee)X2670(write)X2855(ordering.)X10 f863 4853(i)N870(iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii)X1 f903 4943(File)N1047(System)X10 f1672(g)X1 f1720(Allocation)X2078(is)X2151(done)X2327(in)X2409(small)X2602(blocks)X2831(\(usually)X3109(4K)X3227(or)X3314(8K\).)X10 f1672 5033(g)N1 f1720(Logical)X1985(organization)X2406(of)X2493(\256les)X2646(is)X2719(redundantly)X3122(expressed.)X10 f863 5043(i)N870(iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii)X1 f903 5133(Process)N1168(Structure)X10 f1672(g)X1 f1720(Context)X1993(switching)X2324(and)X2460(message)X
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -