You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Builds a update table info transaction, it expected the remote value equals the `current_current_table_info_value`./// It retrieves the latest value if the comparing failed.pub(crate)fn build_update_txn(&self,table_id:TableId,current_table_info_value:&TableInfoValue,new_table_info_value:&TableInfoValue,) -> Result<(Txn,implFnOnce(&Vec<TxnOpResponse>) -> Result<Option<TableInfoValue>>,)>{let key = TableInfoKey::new(table_id);let raw_key = key.as_raw_key();let raw_value = current_table_info_value.try_as_raw_value()?;let txn = Txn::new().when(vec![Compare::with_value(
raw_key.clone(),
CompareOp::Equal,
raw_value.clone(),
)]).and_then(vec![TxnOp::Put(
raw_key.clone(),
new_table_info_value.try_as_raw_value()?,
)]).or_else(vec![TxnOp::Get(raw_key.clone())]);
We retrieve the remote value from etcd, deserialize it into the TableInfoValue, and build the transaction with the TableInfoValue serialization value. However, we must ensure it during the serialization, the remote value without changes. This way is problematic, and it's better to build the transaction with the raw value directly.
Implementation challenges
No response
The text was updated successfully, but these errors were encountered:
What type of enhancement is this?
Refactor, Tech debt reduction
What does the enhancement do?
We retrieve the
remote value
from etcd, deserialize it into theTableInfoValue
, and build the transaction with theTableInfoValue
serialization value. However, we must ensure it during the serialization, theremote value
without changes. This way is problematic, and it's better to build the transaction with theraw value
directly.Implementation challenges
No response
The text was updated successfully, but these errors were encountered: