FoundationDB

Why doesn’t proxy get read version directly from master, but need to broadcast all other proxies?


(Coder0718) #1

Why doesn’t proxy get read version directly from master, but need to broadcast all other proxies?


(Daniil Gitelson) #2

My guess will be, because master is single for whole cluster and fdb needs to reduce the load on it. This way read-only transactions does not bother master at all, and for write transactions master is called only once per batch and not per single transaction.


(Evan Tschannen) #3

The proxy needs to give out a read version which is greater than or equal to the largest commit version that has been send to a client. This is needed so that a client will see the result of previous commits that have happened.

If proxy A commits a transaction, and then we ask proxy B for a read version, we need the read version to be larger than the version committed by proxy A. The only way to get this information is by asking proxy A for its largest committed version.

The master gives out versions to proxies to be committed, but the master does not know when the versions it gives out are durable on the transaction logs. Therefore it is not safe to do reads at the largest version the master has provided because that version might be rolled back in the event of a failure, so you could end up reading data that was never committed.