pancake_db_client/utils.rs
1use uuid::Uuid;
2
3/// Generates a new random correlation ID for use in read requests.
4///
5/// You must use the same correlation ID for all read segment column and
6/// read segment deletion requests of a single segment at a point in time,
7/// or else the data returned might not be consistent.
8/// Using the same correlation ID when reading different segments or the same
9/// segment at different points in time (e.g. separated by hours) can result
10/// in errors or inconsistent data.
11/// Therefore, calling this function once each time you need to read a segment
12/// is the best option.
13pub fn new_correlation_id() -> String {
14 Uuid::new_v4().to_string()
15}