Skip to content

Commit

Permalink
Update comment (#2903)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillFish8 authored Nov 9, 2023
1 parent 9fe59f8 commit 98e8dbb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion quickwit/quickwit-indexing/src/source/pulsar_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,16 @@ async fn create_pulsar_consumer(
fn msg_id_to_position(msg: &MessageIdData) -> Position {
// The order of these fields are important as they affect the sorting
// of the checkpoint positions.
// TODO: Confirm this layout is correct?
//
// The key parts of the ID used for ordering are:
// - The ledger ID which is a sequentially increasing ID.
// - The entry ID the unique ID of the message within the ledger.
// - The batch position for the current chunk of messages.
//
// The remaining keys are not required for sorting but are required
// in order to re-construct the message ID in order to send back to pulsar.
// The ledger_id, entry_id and the batch_index form a unique composite key which will
// prevent the remaining parts of the ID from interfering with the sorting.
let id_str = format!(
"{:0>20},{:0>20},{},{},{}",
msg.ledger_id,
Expand Down

0 comments on commit 98e8dbb

Please sign in to comment.