Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e366988
test: add append visibility test for Latest cursor
XTLine Jul 30, 2026
793466e
perf(storage): publish LAC via ArcSwap and drop ledger content locks
XTLine Jul 30, 2026
29614f1
Remove unneeded mut binding
XTLine Jul 31, 2026
bd8fe06
perf(storage): cap RocksDB memory usage
XTLine Aug 12, 2026
15b4303
perf storage leak between scenarios
XTLine Jul 29, 2026
dba75f2
test: increase stress test offered load
XTLine Jul 30, 2026
21f9e3a
test: Add perf log parsing and E2E diagnostics tests
XTLine Jul 31, 2026
1d63ef7
Refactor perf parsing and error reporting
XTLine Jul 31, 2026
9867496
feat: add external broker backend and local cgroup limits
XTLine Aug 4, 2026
15fca7f
Monitor external broker via systemd unit and cgroup
XTLine Aug 7, 2026
1834646
Update perf stress scripts for external broker runs
XTLine Aug 13, 2026
7137100
Add TODO comment in read_position
XTLine Aug 4, 2026
55906cd
fix(broker): bound shared dispatcher memory with unacked gate and mer…
XTLine Aug 6, 2026
1534a36
perf(broker): switch to jemalloc to avoid glibc arena memory retention
XTLine Aug 6, 2026
bd3bf6d
style: cargo fmt
XTLine Aug 21, 2026
180470e
feat(proto): extract pulsar binary protocol into pulsar-lite-proto crate
XTLine Aug 8, 2026
2c73988
refactor(broker): remove duplicated protocol/storage modules from mai…
XTLine Aug 8, 2026
407b697
fix(broker): resolve orphan-rule violation via ConsumerMessage newtyp…
XTLine Aug 8, 2026
11c4f26
refactor(broker): migrate imports to extracted pulsar-lite-proto and …
XTLine Aug 8, 2026
e5213af
style: cargo fmt workspace formatting
XTLine Aug 8, 2026
5da74d6
perf(broker): decouple dispatch from send-receipt path
XTLine Aug 12, 2026
87bdd4c
perf(broker): remove locks from persistent enqueue hot path
XTLine Aug 12, 2026
6e5af16
perf(storage): coalesce individual acks into ranges
XTLine Aug 12, 2026
b3f244b
debug(broker): add TEMP DIAG file-based probes for ack pipeline
XTLine Aug 12, 2026
aa8b6d8
fix(broker): pass persistent_appender in test connection builder
XTLine Aug 12, 2026
c5c16e1
Fix permit accounting and backpressure in broker dispatch
XTLine Aug 13, 2026
cc4b065
Add pending publish byte limits and connection write-state config
XTLine Aug 13, 2026
970e76b
chore(broker): remove TEMP DIAG instrumentation probes
XTLine Aug 13, 2026
6acc438
style: cargo fmt and clippy 1.98 fixes (while-let loop in cursor)
XTLine Aug 21, 2026
b4dc1c2
fix(broker): restore persistent_appender arg and drop redundant u32 c…
XTLine Aug 21, 2026
3acae83
fix(broker): apply flow permits synchronously under the subscription …
XTLine Aug 21, 2026
6a9a8eb
fix(broker): enable TCP_NODELAY on accepted sockets
XTLine Aug 18, 2026
8daa9e9
perf(broker): ordered batched fan-out worker for non-persistent publish
XTLine Aug 18, 2026
21238db
chore(broker): demote per-Flow log to debug
XTLine Aug 18, 2026
3e84dc5
perf(broker): batch persistent send receipts into single flushes
XTLine Aug 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"storage/resources",
"storage/managed-ledger",
"storage/managed-ledger-rocksdb",
"proto",
]
resolver = "2"

Expand All @@ -21,6 +22,8 @@ thiserror = "1.0"
tokio = { version = "1.35", features = ["full"] }
anyhow = "1.0"
log = "0.4"
tikv-jemallocator = { version = "0.6", features = ["unprefixed_malloc_on_supported_platforms"] }
tikv-jemalloc-sys = { version = "0.6", features = ["profiling", "unprefixed_malloc_on_supported_platforms"] }

[package]
name = "pulsar-lite"
Expand All @@ -45,6 +48,7 @@ pulsar-lite-storage-metadata = { path = "storage/metadata" }
pulsar-lite-storage-resources = { path ="storage/resources" }
pulsar-lite-storage-managed-ledger = { path = "storage/managed-ledger" }
pulsar-lite-storage-managed-ledger-rocksdb = { path = "storage/managed-ledger-rocksdb", optional = true }
pulsar-lite-proto = { path = "proto" }

# 异步运行时
tokio = { version = "1.35", features = ["full"] }
Expand Down Expand Up @@ -82,6 +86,10 @@ uuid = { version = "1.6", features = ["v4"] }
tokio-stream = "0.1"
futures = "0.3"

# 内存分配器:jemalloc(缓解 glibc arena 内存滞留导致的 RSS 高水位)
tikv-jemallocator.workspace = true
tikv-jemalloc-sys.workspace = true

[build-dependencies]
prost-build = "0.13"

Expand Down
14 changes: 14 additions & 0 deletions rust/proto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "pulsar-lite-proto"
version = "0.1.0"
edition = "2021"

[dependencies]
# Protobuf
prost = "0.13"
prost-types = "0.13"
bytes = "1.5"
tokio-util = { version = "0.7", features = ["codec"] }

[build-dependencies]
prost-build = "0.13"
5 changes: 1 addition & 4 deletions rust/build.rs → rust/proto/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
prost_build::Config::new()
.out_dir(&out_dir)
.protoc_arg("--experimental_allow_proto3_optional")
.compile_protos(
&["proto/PulsarApi.proto", "proto/MLDataFormats.proto"],
&["proto"],
)?;
.compile_protos(&["PulsarApi.proto", "MLDataFormats.proto"], &["proto"])?;

Ok(())
}
29 changes: 3 additions & 26 deletions rust/src/protocol/codec.rs → rust/proto/src/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pub mod proto {

// Import ServerCommand from command module
use super::command::ServerCommand;
use crate::broker::service::PendingMessage;

/// Magic number for checksum verification (0x0e01)
const MAGIC_NUMBER: u16 = 0x0e01;
Expand Down Expand Up @@ -305,31 +304,9 @@ impl Encoder<ServerCommand> for PulsarFrameCodec {
}
}

impl Encoder<(u64, PendingMessage)> for PulsarFrameCodec {
type Error = io::Error;

fn encode(
&mut self,
item: (u64, PendingMessage),
dst: &mut BytesMut,
) -> Result<(), Self::Error> {
let (consumer_id, msg) = item;
self.encode_message(
consumer_id,
msg.message_id.ledger,
msg.message_id.entry,
msg.message_id.partition,
&msg.metadata,
&msg.payload,
msg.redelivery_count,
dst,
)
}
}

impl PulsarFrameCodec {
/// Encode a Message command with payload
fn encode_message(
pub fn encode_message(
&self,
consumer_id: u64,
ledger_id: u64,
Expand Down Expand Up @@ -360,9 +337,9 @@ impl PulsarFrameCodec {

#[cfg(test)]
mod tests {
use super::proto::pulsar::{BaseCommand, CompressionType, KeyValue, MessageMetadata};
use super::*;
use crate::protocol::command::ServerCommand;
use crate::codec::proto::pulsar::{BaseCommand, CompressionType, KeyValue, MessageMetadata};
use crate::command::ServerCommand;
use bytes::Bytes;
use prost::Message;

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion rust/src/broker/broker_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::broker::service::topic::{
PartitionedTopic, PartitionedTopicStats, SharedPartitionedTopic, Topic, TopicPublishRate,
TopicStats,
};
use crate::storage::Storage;
use pulsar_lite_storage::Storage;
use std::collections::HashMap;
use std::sync::Arc;
use tokio::sync::{Mutex, RwLock};
Expand Down
2 changes: 1 addition & 1 deletion rust/src/broker/dispatcher/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::{ExclusiveDispatcher, FailoverDispatcher, KeySharedDispatcher, Shared
use crate::broker::dispatcher::redelivery_controller::RedeliveryEntry;
use crate::broker::service::topic::{KeySharedPolicy, SubscriptionType};
use crate::broker::service::{Consumer, SharedStorage};
use crate::storage::{ManagedLedgerPosition, MessageId};
use pulsar_lite_storage_managed_ledger::{ManagedLedgerPosition, MessageId};
use std::sync::Arc;

/// Dispatcher enum - holds the concrete dispatcher implementation
Expand Down
2 changes: 1 addition & 1 deletion rust/src/broker/dispatcher/exclusive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use super::read_position::{commit_read_position, next_unacked_candidate};
use crate::broker::dispatcher::Dispatcher;
use crate::broker::service::topic::SubscriptionType;
use crate::broker::service::{Consumer, SharedStorage};
use crate::storage::ManagedLedgerPosition;
use pulsar_lite_storage_managed_ledger::ManagedLedgerPosition;
use std::sync::atomic::{AtomicU32, Ordering};
use std::sync::{Arc, RwLock};

Expand Down
4 changes: 2 additions & 2 deletions rust/src/broker/dispatcher/failover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use super::rewind_read_position;
use crate::broker::dispatcher::Dispatcher;
use crate::broker::service::topic::SubscriptionType;
use crate::broker::service::{Consumer, SharedStorage};
use crate::storage::ManagedLedgerPosition;
use pulsar_lite_storage_managed_ledger::ManagedLedgerPosition;
use std::sync::atomic::{AtomicU32, Ordering};
use std::sync::{Arc, RwLock};

Expand Down Expand Up @@ -325,7 +325,7 @@ impl Dispatcher for FailoverDispatcher {
mod tests {
use super::*;
use crate::broker::service::topic::Subscription;
use crate::storage::Storage;
use pulsar_lite_storage::Storage;
use std::path::Path;
use tokio::sync::{mpsc, Mutex, RwLock};

Expand Down
Loading