PGDCA, BCA, B-Tech, MCA, M-Tech, B.Sc computer science राजस्थान सूचना सहायक व कंप्यूटर शिक्षक विशेष नोट्स: इस अध्याय में हम Timestamp Ordering Concurrency Protocol and Thomas Write Rule (टाइमस्टैम्प ऑर्डरिंग प्रोटोकॉल और थॉमस राइट रूल) की संपूर्ण थ्योरी, मुख्य तकनीकी बिंदु, तुलनात्मक तालिका और विगत परीक्षाओं के पैटर्न पर आधारित 20 अति-महत्वपूर्ण बहुविकल्पीय प्रश्न (MCQs) विस्तृत हिंदी व अंग्रेजी व्याख्या सहित पढ़ेंगे।
Overview: The Timestamp Ordering (TO) protocol assigns each transaction a unique monotonically increasing timestamp TS(Ti) upon entry and enforces conflict serializability without locks by validating every read and write against item timestamps R-TS(Q) and W-TS(Q). Thomas Write Rule optimizes Basic TO by safely ignoring obsolete writes instead of aborting the transaction, achieving View Serializability beyond basic conflict serializability.
अध्याय सार: टाइमस्टैम्प ऑर्डरिंग (TO) प्रोटोकॉल प्रत्येक ट्रांज़ैक्शन को प्रवेश के समय एक अद्वितीय बढ़ता हुआ टाइमस्टैम्प TS(Ti) देता है और बिना लॉक का उपयोग किए R-TS(Q) व W-TS(Q) की जांच से कॉन्फ्लिक्ट सीरियलाइजेबिलिटी लागू करता है। थॉमस राइट रूल (Thomas Write Rule) बेसिक TO में पुराने हो चुके राइट (Obsolete Write) को सुरक्षित रूप से अनदेखा कर देता है, जिससे ट्रांज़ैक्शन एबॉर्ट घटते हैं और व्यू सीरियलाइजेबिलिटी प्राप्त होती है।
Timestamp Ordering Concurrency Protocol and Thomas Write Rule: Detailed Notes & Architecture (टाइमस्टैम्प ऑर्डरिंग प्रोटोकॉल और थॉमस राइट रूल)
1. Transaction Timestamps and Data-Item Metadata (R-TS and W-TS) (ट्रांज़ैक्शन टाइमस्टैम्प और डेटा-आइटम मेटाडेटा (R-TS, W-TS))
[EN] Unlike locking protocols, Timestamp Ordering (TO) uses no locks and determines serialization order upfront when transactions start. Every transaction Ti receives a unique fixed timestamp TS(Ti) from a system clock or logical counter, where older transactions hold smaller values (if Ti arrives before Tj, TS(Ti) < TS(Tj)). Each data item Q stores two timestamps: W-TS(Q), the largest timestamp of any transaction that successfully executed write(Q), and R-TS(Q), the largest timestamp of any transaction that successfully executed read(Q).
[HI] लॉकिंग के विपरीत, टाइमस्टैम्प ऑर्डरिंग (TO) बिना लॉक के पहले से ही सीरियलाइजेशन क्रम तय कर देता है। प्रत्येक ट्रांज़ैक्शन Ti को शुरुआत में सिस्टम घड़ी या काउंटर से अद्वितीय टाइमस्टैम्प TS(Ti) मिलता है (पुराने ट्रांज़ैक्शन का TS छोटा होता है)। प्रत्येक डेटा आइटम Q पर दो मान रखे जाते हैं: W-TS(Q) (सफल write करने वाले सबसे बड़े TS वाला मान) और R-TS(Q) (सफल read करने वाले सबसे बड़े TS वाला मान)।
2. Basic Timestamp Ordering (BTO) Read and Write Validation Rules (बेसिक टाइमस्टैम्प ऑर्डरिंग (BTO) के रीड व राइट नियम)
[EN] When Ti issues read(Q): if TS(Ti) < W-TS(Q), a younger transaction has already written a newer value of Q that Ti logically shouldn't see, so read(Q) is rejected and Ti aborts and restarts with a new larger timestamp; otherwise read(Q) succeeds and updates R-TS(Q) = max(R-TS(Q), TS(Ti)). When Ti issues write(Q): if TS(Ti) < R-TS(Q) (a younger transaction already read the older value) OR TS(Ti) < W-TS(Q) (a younger transaction already wrote a newer value), write(Q) is rejected and Ti aborts; otherwise write(Q) executes and W-TS(Q) = TS(Ti).
[HI] जब Ti read(Q) मांगता है: यदि TS(Ti) < W-TS(Q) हो, अर्थात कोई नया (छोटा) ट्रांज़ैक्शन Q पहले ही लिख चुका है, तो Ti को Abort कर नए बड़े टाइमस्टैम्प के साथ पुनरारंभ किया जाता है; अन्यथा रीड सफल होकर R-TS(Q) = max(R-TS(Q), TS(Ti)) अपडेट होता है। जब Ti write(Q) मांगता है: यदि TS(Ti) < R-TS(Q) या TS(Ti) < W-TS(Q) हो, तो Ti Abort होता है; अन्यथा राइट निष्पादित कर W-TS(Q) = TS(Ti) सेट होता है।
3. Thomas Write Rule Optimization and View Serializability (थॉमस राइट रूल सुधार और व्यू सीरियलाइजेबिलिटी)
[EN] Thomas Write Rule modifies only the write(Q) logic of Basic TO to avoid unnecessary rollbacks on obsolete writes. If Ti attempts write(Q) and TS(Ti) < R-TS(Q), Ti still MUST abort because a younger transaction already read the pre-write value. However, if TS(Ti) >= R-TS(Q) AND TS(Ti) < W-TS(Q), Ti is merely writing an obsolete value that a younger transaction Tj already overwrote—and nobody read Q in between! Thomas Write Rule safely ignores (skips) Ti's write without aborting Ti, allowing schedules that are View Serializable even when not Conflict Serializable.
[HI] थॉमस राइट रूल बेसिक TO के राइट नियम में एक चतुर सुधार करता है। यदि write(Q) के समय TS(Ti) < R-TS(Q) हो, तो Ti को अभी भी Abort करना होगा क्योंकि नया ट्रांज़ैक्शन पुराना मान पढ़ चुका है। किंतु यदि TS(Ti) >= R-TS(Q) और TS(Ti) < W-TS(Q) हो, तो इसका अर्थ है कि एक नया ट्रांज़ैक्शन पहले ही Q का नवीनतम मान लिख चुका है और बीच में किसी ने Q नहीं पढ़ा। इसलिए थॉमस राइट रूल Ti को Abort करने के बजाय उसके पुराने (Obsolete) राइट को चुपचाप अनदेखा (Ignore) कर देता है, जिससे View Serializable शेड्यूल प्राप्त होते हैं।
4. Deadlock Freedom vs Starvation and Cascading Rollback Risks (डेडलॉक से मुक्ति बनाम स्टार्वेशन और कैस्केडिंग रोलबैक)
[EN] Because Timestamp Ordering protocols never put transactions into lock wait queues, Deadlocks are strictly impossible. Nonetheless, Basic TO and Thomas Write Rule face two practical hazards: Starvation (if an older long-running transaction repeatedly collides with younger ones and keeps restarting with fresh timestamps) and Cascading Rollbacks (if T2 reads a value written by uncommitted T1 before T1 aborts). Cascading rollbacks are prevented by buffering writes until commit or pairing TO with commit-wait (Strict TO).
[HI] चूँकि टाइमस्टैम्प प्रोटोकॉल में ट्रांज़ैक्शन लॉक के लिए प्रतीक्षा नहीं करते, इसलिए इसमें Deadlock पूरी तरह असंभव है। हालांकि दो समस्याएँ बनी रहती हैं: (1) Starvation—यदि कोई लंबा ट्रांज़ैक्शन बार-बार टकराव से एबॉर्ट होकर नए टाइमस्टैम्प से रीस्टार्ट होता रहे, और (2) Cascading Rollback—यदि T1 के कमिट होने से पहले ही T2 उसका लिखा मान पढ़ ले। इसे रोकने हेतु डेटा राइट को कमिट तक बफर किया जाता है।
Syntax, Formula & Technical Example (Timestamp Ordering Concurrency Protocol and Thomas Write Rule)
-- Trace: T1 (TS=10), T2 (TS=20); Initially R-TS(X)=0, W-TS(X)=0
T1 (TS=10): read(X) --> 10 >= W-TS(0) OK | R-TS(X)=10, W-TS(X)=0
T2 (TS=20): write(X) --> 20 >= R-TS(10) & 20 >= W-TS(0) OK | W-TS(X)=20
T1 (TS=10): write(X) --> Check 1: 10 >= R-TS(10) [Safe: no younger read]
--> Check 2: 10 < W-TS(20) [Obsolete write!]
* Basic TO Rule : ABORT T1 and restart with new timestamp (e.g. TS=30)
* Thomas Write Rule : IGNORE T1's write(X); update nothing; T1 continues!
Timestamp Ordering Concurrency Protocol and Thomas Write Rule Quick Reference & Comparison Table
| Timestamp Rule / Property | Timestamp Condition & Action | Serializability & Concurrency Effect |
|---|---|---|
| BTO Read Rule | Reject read(Q) if TS(Ti) < W-TS(Q); else set R-TS=max(R-TS,TS) | Prevents reading future values written by younger transactions |
| BTO Write Rule | Reject write(Q) if TS(Ti) < R-TS(Q) or TS(Ti) < W-TS(Q) | Enforces strict conflict serializability in TS order |
| Thomas Write Rule | Ignore write(Q) when TS(Ti) < W-TS(Q) and TS(Ti) >= R-TS(Q) | Skips obsolete writes; achieves View Serializability with fewer aborts |
| Lock-Free Execution | Abort and reassign a newer timestamp on conflict instead of waiting | 100% Deadlock-free, though vulnerable to starvation and cascading aborts |
Timestamp Ordering Concurrency Protocol and Thomas Write Rule Top 20 Bilingual MCQs with Answers
Q1. In Timestamp Ordering, what does W-TS(Q) represent for data item Q?
(टाइमस्टैम्प ऑर्डरिंग प्रोटोकॉल में किसी डेटा आइटम Q के लिए W-TS(Q) क्या दर्शाता है?)
(A) The smallest timestamp of any transaction that read Q
(B) The current wait queue length on Q
(C) The physical disk sector address of Q
(D) The largest timestamp of any transaction that successfully executed write(Q)
Correct Answer: (D)
[EN] W-TS(Q) records the highest timestamp among all transactions whose write(Q) operation succeeded.
[HI] W-TS(Q) उन सभी ट्रांज़ैक्शन में से सबसे बड़ा टाइमस्टैम्प रखता है जिन्होंने Q पर सफलतापूर्वक write(Q) किया है।
Q2. Under Basic Timestamp Ordering (BTO), when must a read(Q) request by transaction Ti be rejected and Ti aborted?
(बेसिक टाइमस्टैम्प ऑर्डरिंग (BTO) में ट्रांज़ैक्शन Ti का read(Q) अनुरोध कब अस्वीकार कर Ti को एबॉर्ट किया जाता है?)
(A) When TS(Ti) > W-TS(Q)
(B) When TS(Ti) < R-TS(Q)
(C) When TS(Ti) < W-TS(Q)
(D) When TS(Ti) == R-TS(Q)
Correct Answer: (C)
[EN] If TS(Ti) < W-TS(Q), Q already contains a value written by a younger transaction, meaning Ti should have read the older value before that write.
[HI] यदि TS(Ti) < W-TS(Q) हो, तो इसका अर्थ है कि एक नया ट्रांज़ैक्शन पहले ही Q का नया मान लिख चुका है, अतः पुराने Ti को वह मान नहीं पढ़ना चाहिए।
Q3. Under Basic Timestamp Ordering (BTO), what two conditions cause write(Q) by Ti to be rejected?
(बेसिक टाइमस्टैम्प ऑर्डरिंग (BTO) में किन दो परिस्थितियों में Ti का write(Q) अनुरोध अस्वीकार किया जाता है?)
(A) TS(Ti) < R-TS(Q) OR TS(Ti) < W-TS(Q)
(B) TS(Ti) > W-TS(Q) AND R-TS(Q) == 0
(C) TS(Ti) > R-TS(Q) AND TS(Ti) > W-TS(Q)
(D) TS(Ti) == R-TS(Q) only
Correct Answer: (A)
[EN] Writing fails in BTO if either a younger transaction already read Q (TS < R-TS) or a younger transaction already overwrote Q (TS < W-TS).
[HI] यदि Ti से बड़े टाइमस्टैम्प वाले ट्रांज़ैक्शन ने पहले ही Q पढ़ लिया हो (TS < R-TS) या लिख दिया हो (TS < W-TS), तो write अस्वीकृत हो जाता है।
Q4. Under Thomas Write Rule, when is Ti's write(Q) safely IGNORED instead of aborting Ti?
(थॉमस राइट रूल के तहत Ti को एबॉर्ट करने के बजाय उसका write(Q) किस स्थिति में सुरक्षित रूप से अनदेखा (Ignore) कर दिया जाता है?)
(A) When TS(Ti) >= R-TS(Q) AND TS(Ti) < W-TS(Q)
(B) Whenever TS(Ti) < R-TS(Q) regardless of W-TS(Q)
(C) When TS(Ti) > R-TS(Q) AND TS(Ti) > W-TS(Q)
(D) When TS(Ti) < R-TS(Q) AND TS(Ti) >= W-TS(Q)
Correct Answer: (A)
[EN] If no younger transaction read Q (TS >= R-TS) and a younger transaction already overwrote Q (TS < W-TS), Ti's write is obsolete and can be dropped.
[HI] जब कोई छोटा/नया ट्रांज़ैक्शन Q को पढ़ा न हो (TS >= R-TS) किंतु कोई नया ट्रांज़ैक्शन पहले ही लिख चुका हो (TS < W-TS), तो पुराना राइट अनदेखा किया जाता है।
Q5. Under Thomas Write Rule, what happens if Ti attempts write(Q) when TS(Ti) < R-TS(Q) and TS(Ti) < W-TS(Q)?
(थॉमस राइट रूल में यदि write(Q) के समय TS(Ti) < R-TS(Q) तथा TS(Ti) < W-TS(Q) दोनों सत्य हों, तो क्या होगा?)
(A) The write is silently ignored without aborting
(B) Ti MUST still abort and restart because a younger transaction already read the old value
(C) The write overwrites Q immediately
(D) R-TS(Q) is reset to zero
Correct Answer: (B)
[EN] Thomas Write Rule ONLY relaxes the TS < W-TS check; violating TS < R-TS always forces an abort because the younger reader missed Ti's value.
[HI] TS < R-TS की स्थिति में थॉमस राइट रूल भी एबॉर्ट ही करता है क्योंकि नया ट्रांज़ैक्शन पहले ही पुराना मान पढ़ चुका था।
Q6. What class of serializability does Thomas Write Rule achieve compared to Basic Timestamp Ordering?
(बेसिक टाइमस्टैम्प ऑर्डरिंग की तुलना में थॉमस राइट रूल किस श्रेणी की सीरियलाइजेबिलिटी सुनिश्चित करता है?)
(A) View Serializability (including schedules that are NOT Conflict Serializable)
(B) Only non-serializable blind writes
(C) Strict 2PL serializability only
(D) Strictly less schedules than Basic TO
Correct Answer: (A)
[EN] Ignoring obsolete blind writes breaks strict conflict-serializability order while preserving identical final values and read-from views (View Serializable).
[HI] पुराने राइट अनदेखे करने से ऐसे शेड्यूल भी वैध हो जाते हैं जो कॉन्फ्लिक्ट सीरियलाइजेबल नहीं होते हुए भी View Serializable होते हैं।
Q7. Why are Deadlocks completely impossible in Timestamp Ordering protocols?
(टाइमस्टैम्प ऑर्डरिंग प्रोटोकॉल में डेडलॉक (Deadlock) असंभव क्यों होते हैं?)
(A) Because no transaction ever waits for another transaction (conflicts trigger immediate abort/restart)
(B) Because R-TS and W-TS act as Exclusive locks that queue transactions
(C) Because all transactions share the same timestamp
(D) Because transactions never execute write operations
Correct Answer: (A)
[EN] Deadlocks require circular wait-for dependencies; since TO never blocks transactions waiting on locks, circular wait cannot form.
[HI] TO में कोई ट्रांज़ैक्शन दूसरे की प्रतीक्षा कतार में नहीं रुकता बल्कि टकराव पर तुरंत एबॉर्ट होता है, अतः चक्राकार प्रतीक्षा (Deadlock) नहीं बनती।
Q8. When a transaction Ti is aborted by the Timestamp Ordering protocol and restarted, what timestamp does it receive?
(जब TO प्रोटोकॉल द्वारा ट्रांज़ैक्शन Ti को एबॉर्ट कर पुनः चलाया जाता है, तो उसे कौन सा टाइमस्टैम्प मिलता है?)
(A) Zero (0)
(B) The minimum of R-TS(Q) and W-TS(Q)
(C) Its original starting timestamp
(D) A brand-new, larger timestamp
Correct Answer: (D)
[EN] Reusing the old timestamp would repeatedly trigger the same conflict; assigning a new larger timestamp lets the restarted transaction succeed as a younger transaction.
[HI] पुराना टाइमस्टैम्प रखने से फिर टकराव होगा, इसलिए पुनरारंभ होने पर Ti को एक नया व बड़ा टाइमस्टैम्प दिया जाता है।
Q9. Trace BTO with R-TS(A)=15, W-TS(A)=12. Transaction T1 (TS=14) calls read(A), then T2 (TS=18) calls write(A). What are the final (R-TS, W-TS)?
(मान लीजिए R-TS(A)=15, W-TS(A)=12 है। पहले T1 (TS=14) read(A) करता है और फिर T2 (TS=18) write(A) करता है। अंतिम (R-TS, W-TS) क्या होंगे?)
(A) T2 aborts on write(A); final (15, 12)
(B) T1 aborts on read(A); final (15, 18)
(C) R-TS(A) = 15, W-TS(A) = 18 (both operations succeed)
(D) R-TS(A) = 14, W-TS(A) = 18
Correct Answer: (C)
[EN] T1 read(A): TS(14) >= W-TS(12) succeeds; R-TS = max(15, 14) = 15. T2 write(A): TS(18) >= R-TS(15) and >= W-TS(12) succeeds; W-TS = 18.
[HI] T1 के लिए 14 >= 12 (सफल) और max(15,14)=15 रहेगा; फिर T2 के लिए 18 >= 15 व 18 >= 12 (सफल) जिससे W-TS(A)=18 हो जाएगा।
Q10. Under Basic TO, if R-TS(B)=25 and W-TS(B)=20, what happens when T3 with TS=22 executes write(B)?
(बेसिक TO में यदि R-TS(B)=25 और W-TS(B)=20 है, तो TS=22 वाला ट्रांज़ैक्शन T3 जब write(B) करेगा तब क्या होगा?)
(A) write(B) succeeds and sets W-TS(B)=22
(B) T3 is aborted and restarted with a new timestamp because TS(22) < R-TS(25)
(C) R-TS(B) drops down to 22
(D) write(B) is ignored via Basic TO
Correct Answer: (B)
[EN] Because TS(T3)=22 is smaller than R-TS(B)=25, a younger transaction (TS=25) already read B before T3 wrote it, forcing T3 to abort.
[HI] TS(22) < R-TS(25) होने से स्पष्ट है कि TS=25 वाला नया ट्रांज़ैक्शन पहले ही B पढ़ चुका है, अतः T3 एबॉर्ट होगा।
Q11. Which of the following is NOT true about Timestamp Ordering concurrency protocols?
(टाइमस्टैम्प ऑर्डरिंग प्रोटोकॉल के बारे में निम्नलिखित में से कौन सा कथन सत्य नहीं है?)
(A) Basic Timestamp Ordering automatically prevents starvation of long-running transactions
(B) Timestamp Ordering protocols are completely free of deadlocks
(C) Thomas Write Rule reduces aborts by ignoring obsolete writes
(D) Basic Timestamp Ordering guarantees conflict serializability in timestamp order
Correct Answer: (A)
[EN] Starvation is a known weakness of naive TO protocols when a long transaction repeatedly conflicts with newer ones and restarts.
[HI] TO प्रोटोकॉल में लंबे समय तक चलने वाले ट्रांज़ैक्शन बार-बार एबॉर्ट व रीस्टार्ट होकर Starvation का शिकार हो सकते हैं।
Q12. How does a Timestamp Ordering scheduler determine the equivalent serial order BEFORE transactions finish?
(टाइमस्टैम्प ऑर्डरिंग शेड्यूलर ट्रांज़ैक्शन के पूरा होने से पहले ही समतुल्य सीरियल क्रम कैसे तय कर लेता है?)
(A) By sorting transactions alphabetically at commit
(B) By waiting for all transactions to reach Lock Point
(C) By fixing the serialization order strictly to the ascending order of assigned TS(Ti) values
(D) By reading transaction commit logs backward
Correct Answer: (C)
[EN] Unlike 2PL (where Lock Points emerge dynamically), TO assigns serialization precedence statically at transaction birth via TS(Ti).
[HI] 2PL के विपरीत जहाँ Lock Point बाद में तय होता है, TO में जन्म के समय मिला TS(Ti) ही सीरियलाइजेशन क्रम निर्धारित कर देता है।
Q13. What happens to R-TS(Q) when transaction Ti with TS(Ti) = 12 successfully executes read(Q) while R-TS(Q) was already 30?
(यदि R-TS(Q) पहले से 30 है और TS(Ti)=12 वाला ट्रांज़ैक्शन सफलतापूर्वक read(Q) करता है, तो R-TS(Q) का मान क्या होगा?)
(A) R-TS(Q) becomes 42
(B) Ti is aborted because 12 < 30
(C) R-TS(Q) shrinks to 12
(D) R-TS(Q) remains 30 because R-TS(Q) = max(R-TS(Q), TS(Ti))
Correct Answer: (D)
[EN] Reading never conflicts with another read! Ti only checks TS(Ti) >= W-TS(Q), and R-TS keeps the maximum reader timestamp (max(30, 12) = 30).
[HI] रीड-रीड में टकराव नहीं होता; केवल W-TS जांचा जाता है और R-TS(Q) अधिकतम मान max(30, 12) = 30 ही बना रहता है।
Q14. Why can pure Basic Timestamp Ordering suffer from Cascading Rollbacks unless modified?
(बिना अतिरिक्त बदलाव के शुद्ध बेसिक टाइमस्टैम्प ऑर्डरिंग में Cascading Rollback क्यों हो सकता है?)
(A) Because a younger transaction may read an uncommitted value written by an older transaction that later aborts
(B) Because all reads are buffered until shutdown
(C) Because timestamps decrease over time
(D) Because Thomas Write Rule deletes committed logs
Correct Answer: (A)
[EN] Without waiting for writers to commit or buffering writes privately until commit, uncommitted writes become visible to younger readers.
[HI] यदि कमिट होने तक राइट बफर न किया जाए, तो कोई नया ट्रांज़ैक्शन अनकमिटेड मान पढ़ सकता है और लेखक के एबॉर्ट होने पर खुद भी एबॉर्ट होगा।
Q15. Which technique fixes Cascading Rollbacks in Timestamp Ordering without using locks?
(बिना लॉक का उपयोग किए टाइमस्टैम्प ऑर्डरिंग में Cascading Rollbacks को किस तकनीक से रोका जाता है?)
(A) Buffering writes in private workspace until commit (or delaying reads on uncommitted items via commit bits)
(B) Converting all transactions into DDL queries
(C) Lowering transaction timestamps on every restart
(D) Removing R-TS(Q) completely
Correct Answer: (A)
[EN] By keeping writes out of shared buffers until commit (or blocking readers until the writer commits), dirty reads and cascading rollbacks vanish.
[HI] प्रत्येक ट्रांज़ैक्शन के राइट को कमिट तक निजी बफर में रखने या कमिट-बिट जांचने से अनकमिटेड डेटा पढ़ना रुक जाता है।
Q16. Compare Basic 2PL vs Basic Timestamp Ordering: which statement accurately contrasts both?
(बेसिक 2PL और बेसिक टाइमस्टैम्प ऑर्डरिंग (BTO) की तुलना में कौन सा कथन सटीक अंतर बताता है?)
(A) Neither protocol guarantees conflict serializability
(B) Basic 2PL serializes by birth timestamp while Basic TO serializes by Lock Point
(C) Basic TO causes deadlocks while Basic 2PL is deadlock-free
(D) Basic 2PL relies on waiting (risking deadlocks), whereas Basic TO relies on aborts/restarts (zero deadlocks, risking restarts/starvation)
Correct Answer: (D)
[EN] 2PL uses pessimistic lock blocking (can deadlock); TO uses optimistic timestamp validation with aborts (deadlock-free, higher restart rate under high contention).
[HI] 2PL प्रतीक्षा (लॉक) पर चलता है जिसमें डेडलॉक संभव है, जबकि TO एबॉर्ट/रीस्टार्ट पर चलता है जिसमें डेडलॉक असंभव पर स्टार्वेशन संभव है।
Q17. Within Timestamp Ordering Concurrency Protocol and Thomas Write Rule, which timestamp rule / property directly maps to: "Reject read(Q) if TS(Ti) < W-TS(Q); else set R-TS=max(R-TS,TS)"?
(Timestamp Ordering Concurrency Protocol and Thomas Write Rule में कौन सा Timestamp Rule / Property सीधे "Reject read(Q) if TS(Ti) < W-TS(Q); else set R-TS=max(R-TS,TS)" से संबंधित है?)
(A) Thomas Write Rule
(B) Lock-Free Execution
(C) BTO Write Rule
(D) BTO Read Rule
Correct Answer: (D)
[EN] In Timestamp Ordering Concurrency Protocol and Thomas Write Rule, 'BTO Read Rule' handles 'Reject read(Q) if TS(Ti) < W-TS(Q); else set R-TS=max(R-TS,TS)' (Prevents reading future values written by younger transactions).
[HI] Timestamp Ordering Concurrency Protocol and Thomas Write Rule में 'BTO Read Rule' का कार्य/विवरण 'Reject read(Q) if TS(Ti) < W-TS(Q); else set R-TS=max(R-TS,TS)' (Prevents reading future values written by younger transactions) है।
Q18. Which option accurately describes 'BTO Write Rule' in Timestamp Ordering Concurrency Protocol and Thomas Write Rule?
(Timestamp Ordering Concurrency Protocol and Thomas Write Rule के संदर्भ में 'BTO Write Rule' की सही विशेषता कौन सी है?)
(A) Reject read(Q) if TS(Ti) < W-TS(Q); else set R-TS=max(R-TS,TS)
(B) Abort and reassign a newer timestamp on conflict instead of waiting
(C) Reject write(Q) if TS(Ti) < R-TS(Q) or TS(Ti) < W-TS(Q)
(D) Ignore write(Q) when TS(Ti) < W-TS(Q) and TS(Ti) >= R-TS(Q)
Correct Answer: (C)
[EN] 'BTO Write Rule' provides 'Reject write(Q) if TS(Ti) < R-TS(Q) or TS(Ti) < W-TS(Q)' — key point: Enforces strict conflict serializability in TS order.
[HI] 'BTO Write Rule' का मुख्य विवरण 'Reject write(Q) if TS(Ti) < R-TS(Q) or TS(Ti) < W-TS(Q)' है (Enforces strict conflict serializability in TS order)।
Q19. In Timestamp Ordering Concurrency Protocol and Thomas Write Rule, identify the correct parameter for the specification: "Ignore write(Q) when TS(Ti) < W-TS(Q) and TS(Ti) >= R-TS(Q)".
(Timestamp Ordering Concurrency Protocol and Thomas Write Rule में "Ignore write(Q) when TS(Ti) < W-TS(Q) and TS(Ti) >= R-TS(Q)" विवरण किस विकल्प के लिए सही है?)
(A) Lock-Free Execution
(B) Thomas Write Rule
(C) BTO Read Rule
(D) BTO Write Rule
Correct Answer: (B)
[EN] 'Thomas Write Rule' corresponds to 'Ignore write(Q) when TS(Ti) < W-TS(Q) and TS(Ti) >= R-TS(Q)' (Skips obsolete writes; achieves View Serializability with fewer aborts).
[HI] 'Thomas Write Rule' का संबंध 'Ignore write(Q) when TS(Ti) < W-TS(Q) and TS(Ti) >= R-TS(Q)' (Skips obsolete writes; achieves View Serializability with fewer aborts) से है।
Q20. Considering Timestamp Ordering Concurrency Protocol and Thomas Write Rule, what key behavior defines 'Lock-Free Execution'?
(Timestamp Ordering Concurrency Protocol and Thomas Write Rule में 'Lock-Free Execution' की मुख्य भूमिका या मान क्या है?)
(A) Ignore write(Q) when TS(Ti) < W-TS(Q) and TS(Ti) >= R-TS(Q)
(B) Reject write(Q) if TS(Ti) < R-TS(Q) or TS(Ti) < W-TS(Q)
(C) Reject read(Q) if TS(Ti) < W-TS(Q); else set R-TS=max(R-TS,TS)
(D) Abort and reassign a newer timestamp on conflict instead of waiting
Correct Answer: (D)
[EN] 'Lock-Free Execution' represents 'Abort and reassign a newer timestamp on conflict instead of waiting' (100% Deadlock-free, though vulnerable to starvation and cascading aborts).
[HI] 'Lock-Free Execution' का अर्थ/मान 'Abort and reassign a newer timestamp on conflict instead of waiting' है (100% Deadlock-free, though vulnerable to starvation and cascading aborts)।
Timestamp Ordering Concurrency Protocol and Thomas Write Rule — Exam FAQs
Q1: Does Thomas Write Rule ever cause inconsistent data by ignoring a write?
क्या थॉमस राइट रूल द्वारा किसी write(Q) को अनदेखा (Ignore) करने से डेटा असंगत हो सकता है?
[EN] No. It only ignores write(Q) when a younger transaction has already written a newer value and no intervening transaction read Q—matching the exact outcome of serial execution <Ti, Tj>.
[HI] नहीं। यह राइट तभी छोड़ा जाता है जब कोई नया ट्रांज़ैक्शन पहले ही नया मान लिख चुका हो और बीच में किसी ने Q पढ़ा न हो—परिणाम ठीक सीरियल क्रम <Ti, Tj> जैसा ही रहता है।
Q2: How are unique timestamps generated in distributed databases?
वितरित (Distributed) डेटाबेस में अद्वितीय टाइमस्टैम्प कैसे बनाए जाते हैं?
[EN] Systems combine a synchronized physical/logical clock (like Lamport clocks or TrueTime) with a unique Node/Site ID suffix as tie-breaker so no two transactions ever receive identical timestamps.
[HI] डिस्ट्रीब्यूटेड सिस्टम में लोकल लॉजिकल/लैम्पॉर्ट क्लॉक के अंत में यूनिक साइट/नोड ID जोड़ दी जाती है ताकि कभी दो ट्रांज़ैक्शन को समान टाइमस्टैम्प न मिले।
Q3: Why is Timestamp Ordering less common than Strict 2PL/MVCC in general-purpose OLTP engines?
सामान्य OLTP डेटाबेस में टाइमस्टैम्प ऑर्डरिंग की तुलना में Strict 2PL या MVCC अधिक लोकप्रिय क्यों हैं?
[EN] Under high contention on hot rows, pure TO repeatedly aborts and restarts transactions instead of briefly waiting on a lock, causing wasted CPU work and starvation.
[HI] एक ही पंक्ति पर भारी विवाद (High Contention) होने पर TO बार-बार ट्रांज़ैक्शन एबॉर्ट कर देता है जिससे CPU बर्बाद होता है, जबकि लॉक में केवल थोड़ी प्रतीक्षा करनी होती है।
Post a Comment
Post a Comment