You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by gk...@apache.org on 2025/10/18 09:51:03 UTC
(iggy) 01/01: feat(io_uring): fix errors
This is an automated email from the ASF dual-hosted git repository.
gkoszyk pushed a commit to branch fix_errors
in repository https://gitbox.apache.org/repos/asf/iggy.git
commit d2c9b645a36dcfbaa4038e550e36223e80c74508
Author: numminex <g....@gmail.com>
AuthorDate: Sat Oct 18 11:50:51 2025 +0200
feat(io_uring): fix errors
---
Cargo.lock | 292 +++++++++------------
core/bench/src/benchmarks/common.rs | 16 +-
core/common/src/error/iggy_error.rs | 51 ++--
core/integration/tests/server/general.rs | 1 -
.../tests/server/scenarios/concurrent_scenario.rs | 2 -
core/sdk/src/clients/consumer.rs | 3 +-
core/sdk/src/tcp/tcp_client.rs | 5 +-
core/server/src/http/error.rs | 5 -
core/server/src/shard/mod.rs | 3 -
core/server/src/shard/system/streams.rs | 4 +-
core/server/src/shard/system/topics.rs | 5 +-
core/server/src/shard/system/utils.rs | 25 +-
core/server/src/slab/topics.rs | 1 -
core/server/src/slab/traits_ext.rs | 23 --
core/server/src/streaming/partitions/partition2.rs | 1 -
core/server/src/streaming/partitions/storage2.rs | 30 +--
core/server/src/streaming/streams/storage2.rs | 2 +-
.../server/src/streaming/topics/consumer_group2.rs | 1 -
core/server/src/streaming/topics/storage2.rs | 12 +-
19 files changed, 179 insertions(+), 303 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 419b01320..8e8a5e223 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -223,15 +223,6 @@ dependencies = [
"syn 2.0.106",
]
-[[package]]
-name = "addr2line"
-version = "0.25.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b"
-dependencies = [
- "gimli",
-]
-
[[package]]
name = "adler2"
version = "2.0.1"
@@ -291,7 +282,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"
dependencies = [
"cfg-if",
- "getrandom 0.3.3",
+ "getrandom 0.3.4",
"once_cell",
"serde",
"version_check",
@@ -667,16 +658,15 @@ dependencies = [
[[package]]
name = "aws-lc-sys"
-version = "0.32.2"
+version = "0.32.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2b715a6010afb9e457ca2b7c9d2b9c344baa8baed7b38dc476034c171b32575"
+checksum = "107a4e9d9cab9963e04e84bb8dee0e25f2a987f9a8bad5ed054abd439caa8f8c"
dependencies = [
"bindgen",
"cc",
"cmake",
"dunce",
"fs_extra",
- "libloading",
]
[[package]]
@@ -812,21 +802,6 @@ dependencies = [
"tower-service",
]
-[[package]]
-name = "backtrace"
-version = "0.3.76"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6"
-dependencies = [
- "addr2line",
- "cfg-if",
- "libc",
- "miniz_oxide",
- "object",
- "rustc-demangle",
- "windows-link 0.2.1",
-]
-
[[package]]
name = "base64"
version = "0.21.7"
@@ -870,7 +845,7 @@ dependencies = [
"bench-report",
"charming",
"chrono",
- "getrandom 0.3.3",
+ "getrandom 0.3.4",
"gloo 0.11.0",
"js-sys",
"serde_json",
@@ -1191,9 +1166,9 @@ dependencies = [
[[package]]
name = "bzip2"
-version = "0.6.0"
+version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bea8dcd42434048e4f7a304411d9273a411f647446c1234a65ce0554923f4cff"
+checksum = "f3a53fac24f34a81bc9954b5d6cfce0c21e18ec6959f44f56e8e90e4bb7c346c"
dependencies = [
"libbz2-rs-sys",
]
@@ -1232,9 +1207,9 @@ dependencies = [
[[package]]
name = "cc"
-version = "1.2.40"
+version = "1.2.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1d05d92f4b1fd76aad469d46cdd858ca761576082cd37df81416691e50199fb"
+checksum = "ac9fe6cdbb24b6ade63616c0a0688e45bb56732262c158df3c0c4bea4ca47cb7"
dependencies = [
"find-msvc-tools",
"jobserver",
@@ -1259,9 +1234,9 @@ dependencies = [
[[package]]
name = "cfg-if"
-version = "1.0.3"
+version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9"
+checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
[[package]]
name = "cfg_aliases"
@@ -1334,9 +1309,9 @@ dependencies = [
[[package]]
name = "clap"
-version = "4.5.48"
+version = "4.5.49"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2134bb3ea021b78629caa971416385309e0131b351b25e01dc16fb54e1b5fae"
+checksum = "f4512b90fa68d3a9932cea5184017c5d200f5921df706d45e853537dea51508f"
dependencies = [
"clap_builder",
"clap_derive",
@@ -1344,9 +1319,9 @@ dependencies = [
[[package]]
name = "clap_builder"
-version = "4.5.48"
+version = "4.5.49"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2ba64afa3c0a6df7fa517765e31314e983f51dda798ffba27b988194fb65dc9"
+checksum = "0025e98baa12e766c67ba13ff4695a887a1eba19569aad00a472546795bd6730"
dependencies = [
"anstream",
"anstyle",
@@ -1357,18 +1332,18 @@ dependencies = [
[[package]]
name = "clap_complete"
-version = "4.5.58"
+version = "4.5.59"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75bf0b32ad2e152de789bb635ea4d3078f6b838ad7974143e99b99f45a04af4a"
+checksum = "2348487adcd4631696ced64ccdb40d38ac4d31cae7f2eec8817fcea1b9d1c43c"
dependencies = [
"clap",
]
[[package]]
name = "clap_derive"
-version = "4.5.47"
+version = "4.5.49"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c"
+checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671"
dependencies = [
"heck 0.5.0",
"proc-macro2",
@@ -1378,9 +1353,9 @@ dependencies = [
[[package]]
name = "clap_lex"
-version = "0.7.5"
+version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675"
+checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
[[package]]
name = "cmake"
@@ -1482,7 +1457,7 @@ dependencies = [
"paste",
"polling",
"slab",
- "socket2 0.6.0",
+ "socket2 0.6.1",
"windows-sys 0.60.2",
]
@@ -1555,7 +1530,7 @@ dependencies = [
"either",
"libc",
"once_cell",
- "socket2 0.6.0",
+ "socket2 0.6.1",
"widestring",
"windows-sys 0.60.2",
]
@@ -1598,7 +1573,7 @@ dependencies = [
"once_cell",
"scoped-tls",
"slab",
- "socket2 0.6.0",
+ "socket2 0.6.1",
"windows-sys 0.60.2",
]
@@ -1616,7 +1591,7 @@ dependencies = [
[[package]]
name = "compio-ws"
version = "0.1.0"
-source = "git+https://github.com/krishvishal/compio-ws?branch=main#b6e2b4c45a341228c54b9a8b1414da1cc785ca85"
+source = "git+https://github.com/krishvishal/compio-ws?branch=main#ca9240b6b0eb2206e8ae050580a053c5e9d0e877"
dependencies = [
"compio",
"compio-buf",
@@ -2106,7 +2081,7 @@ dependencies = [
"hyper",
"hyper-util",
"send_wrapper",
- "socket2 0.6.0",
+ "socket2 0.6.1",
"tokio",
"tower 0.5.2",
"tower-service",
@@ -2567,9 +2542,9 @@ dependencies = [
[[package]]
name = "env_filter"
-version = "0.1.3"
+version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0"
+checksum = "1bf3c259d255ca70051b30e2e95b5446cdb8949ac4cd22c0d7fd634d89f568e2"
dependencies = [
"log",
"regex",
@@ -2721,7 +2696,7 @@ version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18c1ddb9231d8554c2d6bdf4cfaabf0c59251658c68b6c95cd52dd0c513a912a"
dependencies = [
- "getrandom 0.3.3",
+ "getrandom 0.3.4",
"libm",
"rand 0.9.2",
"siphasher",
@@ -2765,9 +2740,9 @@ dependencies = [
[[package]]
name = "find-msvc-tools"
-version = "0.1.3"
+version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0399f9d26e5191ce32c498bebd31e7a3ceabc2745f0ac54af3f335126c3f24b3"
+checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127"
[[package]]
name = "flatbuffers"
@@ -3005,9 +2980,9 @@ dependencies = [
[[package]]
name = "generic-array"
-version = "0.14.7"
+version = "0.14.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
+checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2"
dependencies = [
"typenum",
"version_check",
@@ -3022,21 +2997,21 @@ dependencies = [
"cfg-if",
"js-sys",
"libc",
- "wasi 0.11.1+wasi-snapshot-preview1",
+ "wasi",
"wasm-bindgen",
]
[[package]]
name = "getrandom"
-version = "0.3.3"
+version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
+checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
dependencies = [
"cfg-if",
"js-sys",
"libc",
"r-efi",
- "wasi 0.14.7+wasi-0.2.4",
+ "wasip2",
"wasm-bindgen",
]
@@ -3067,12 +3042,6 @@ dependencies = [
"typed-builder",
]
-[[package]]
-name = "gimli"
-version = "0.32.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7"
-
[[package]]
name = "git2"
version = "0.20.2"
@@ -3094,15 +3063,15 @@ checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
[[package]]
name = "globset"
-version = "0.4.16"
+version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "54a1028dfc5f5df5da8a56a73e6c153c9a9708ec57232470703592a3f18e49f5"
+checksum = "eab69130804d941f8075cfd713bf8848a2c3b3f201a9457a11e6f87e1ab62305"
dependencies = [
"aho-corasick",
"bstr",
"log",
"regex-automata",
- "regex-syntax 0.8.6",
+ "regex-syntax 0.8.8",
]
[[package]]
@@ -3536,7 +3505,7 @@ dependencies = [
"futures-sink",
"futures-timer",
"futures-util",
- "getrandom 0.3.3",
+ "getrandom 0.3.4",
"hashbrown 0.15.5",
"nonzero_ext",
"parking_lot 0.12.5",
@@ -3560,7 +3529,7 @@ dependencies = [
"futures-sink",
"futures-util",
"http 0.2.12",
- "indexmap 2.11.4",
+ "indexmap 2.12.0",
"slab",
"tokio",
"tokio-util",
@@ -3579,7 +3548,7 @@ dependencies = [
"futures-core",
"futures-sink",
"http 1.3.1",
- "indexmap 2.11.4",
+ "indexmap 2.12.0",
"slab",
"tokio",
"tokio-util",
@@ -3905,7 +3874,7 @@ dependencies = [
"libc",
"percent-encoding",
"pin-project-lite",
- "socket2 0.6.0",
+ "socket2 0.6.1",
"tokio",
"tower-service",
"tracing",
@@ -4390,9 +4359,9 @@ dependencies = [
[[package]]
name = "ignore"
-version = "0.4.23"
+version = "0.4.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b"
+checksum = "81776e6f9464432afcc28d03e52eb101c93b6f0566f52aef2427663e700f0403"
dependencies = [
"crossbeam-deque",
"globset",
@@ -4417,7 +4386,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8a9aa791c7b5a71b636b7a68207fdebf171ddfc593d9c8506ec4cbc527b6a84"
dependencies = [
"implicit-clone-derive",
- "indexmap 2.11.4",
+ "indexmap 2.12.0",
]
[[package]]
@@ -4443,9 +4412,9 @@ dependencies = [
[[package]]
name = "indexmap"
-version = "2.11.4"
+version = "2.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5"
+checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f"
dependencies = [
"equivalent",
"hashbrown 0.16.0",
@@ -4678,7 +4647,7 @@ version = "0.1.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33"
dependencies = [
- "getrandom 0.3.3",
+ "getrandom 0.3.4",
"libc",
]
@@ -4859,12 +4828,12 @@ dependencies = [
[[package]]
name = "libloading"
-version = "0.8.8"
+version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667"
+checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55"
dependencies = [
"cfg-if",
- "windows-targets 0.53.5",
+ "windows-link 0.2.1",
]
[[package]]
@@ -5031,7 +5000,7 @@ dependencies = [
"lazy_static",
"proc-macro2",
"quote",
- "regex-syntax 0.8.6",
+ "regex-syntax 0.8.8",
"rustc_version",
"syn 2.0.106",
]
@@ -5179,14 +5148,14 @@ dependencies = [
[[package]]
name = "mio"
-version = "1.0.4"
+version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c"
+checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873"
dependencies = [
"libc",
"log",
- "wasi 0.11.1+wasi-snapshot-preview1",
- "windows-sys 0.59.0",
+ "wasi",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -5375,11 +5344,11 @@ dependencies = [
[[package]]
name = "nu-ansi-term"
-version = "0.50.1"
+version = "0.50.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399"
+checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
dependencies = [
- "windows-sys 0.52.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -5498,15 +5467,6 @@ dependencies = [
"objc2-core-foundation",
]
-[[package]]
-name = "object"
-version = "0.37.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe"
-dependencies = [
- "memchr",
-]
-
[[package]]
name = "octocrab"
version = "0.45.0"
@@ -5567,9 +5527,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381"
[[package]]
name = "openssl"
-version = "0.10.73"
+version = "0.10.74"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8"
+checksum = "24ad14dd45412269e1a30f52ad8f0664f0f4f4a89ee8fe28c3b3527021ebb654"
dependencies = [
"bitflags 2.9.4",
"cfg-if",
@@ -5608,9 +5568,9 @@ dependencies = [
[[package]]
name = "openssl-sys"
-version = "0.9.109"
+version = "0.9.110"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571"
+checksum = "0a9f0075ba3c21b09f8e8b2026584b1d18d49388648f2fbbf3c97ea8deced8e2"
dependencies = [
"cc",
"libc",
@@ -5730,12 +5690,12 @@ dependencies = [
[[package]]
name = "os_pipe"
-version = "1.2.2"
+version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db335f4760b14ead6290116f2427bf33a14d4f0617d49f78a246de10c1831224"
+checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967"
dependencies = [
"libc",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -5897,12 +5857,12 @@ checksum = "9555b1514d2d99d78150d3c799d4c357a3e2c2a8062cd108e93a06d9057629c5"
[[package]]
name = "pem"
-version = "3.0.5"
+version = "3.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38af38e8470ac9dee3ce1bae1af9c1671fffc44ddfd8bd1d0a3445bf349a8ef3"
+checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be"
dependencies = [
"base64 0.22.1",
- "serde",
+ "serde_core",
]
[[package]]
@@ -6401,7 +6361,7 @@ dependencies = [
"libc",
"once_cell",
"raw-cpuid",
- "wasi 0.11.1+wasi-snapshot-preview1",
+ "wasi",
"web-sys",
"winapi",
]
@@ -6429,7 +6389,7 @@ dependencies = [
"quinn-udp",
"rustc-hash",
"rustls",
- "socket2 0.6.0",
+ "socket2 0.6.1",
"thiserror 2.0.17",
"tokio",
"tracing",
@@ -6444,7 +6404,7 @@ checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31"
dependencies = [
"bytes",
"fastbloom",
- "getrandom 0.3.3",
+ "getrandom 0.3.4",
"lru-slab",
"rand 0.9.2",
"ring",
@@ -6468,7 +6428,7 @@ dependencies = [
"cfg_aliases",
"libc",
"once_cell",
- "socket2 0.6.0",
+ "socket2 0.6.1",
"tracing",
"windows-sys 0.60.2",
]
@@ -6550,7 +6510,7 @@ version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
dependencies = [
- "getrandom 0.3.3",
+ "getrandom 0.3.4",
]
[[package]]
@@ -6646,32 +6606,32 @@ dependencies = [
[[package]]
name = "regex"
-version = "1.11.3"
+version = "1.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b5288124840bee7b386bc413c487869b360b2b4ec421ea56425128692f2a82c"
+checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
- "regex-syntax 0.8.6",
+ "regex-syntax 0.8.8",
]
[[package]]
name = "regex-automata"
-version = "0.4.11"
+version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "833eb9ce86d40ef33cb1306d8accf7bc8ec2bfea4355cbdebb3df68b40925cad"
+checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c"
dependencies = [
"aho-corasick",
"memchr",
- "regex-syntax 0.8.6",
+ "regex-syntax 0.8.8",
]
[[package]]
name = "regex-lite"
-version = "0.1.7"
+version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "943f41321c63ef1c92fd763bfe054d2668f7f225a5c29f0105903dc2fc04ba30"
+checksum = "8d942b98df5e658f56f20d592c7f868833fe38115e65c33003d8cd224b0155da"
[[package]]
name = "regex-syntax"
@@ -6681,9 +6641,9 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
[[package]]
name = "regex-syntax"
-version = "0.8.6"
+version = "0.8.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001"
+checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
[[package]]
name = "rend"
@@ -6696,9 +6656,9 @@ dependencies = [
[[package]]
name = "reqwest"
-version = "0.12.23"
+version = "0.12.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d429f34c8092b2d42c7c93cec323bb4adeb7c67698f70839adec842ec10c7ceb"
+checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f"
dependencies = [
"base64 0.22.1",
"bytes",
@@ -6926,9 +6886,9 @@ dependencies = [
[[package]]
name = "rust_decimal"
-version = "1.38.0"
+version = "1.39.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c8975fc98059f365204d635119cf9c5a60ae67b841ed49b5422a9a7e56cdfac0"
+checksum = "35affe401787a9bd846712274d97654355d21b2a2c092a3139aabe31e9022282"
dependencies = [
"arrayvec",
"borsh",
@@ -6940,12 +6900,6 @@ dependencies = [
"serde_json",
]
-[[package]]
-name = "rustc-demangle"
-version = "0.1.26"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace"
-
[[package]]
name = "rustc-hash"
version = "2.1.1"
@@ -6976,9 +6930,9 @@ dependencies = [
[[package]]
name = "rustls"
-version = "0.23.32"
+version = "0.23.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd3c25631629d034ce7cd9940adc9d45762d46de2b0f57193c4443b92c6d4d40"
+checksum = "751e04a496ca00bb97a5e043158d23d66b5aabf2e1d5aa2a0aaebb1aafe6f82c"
dependencies = [
"aws-lc-rs",
"log",
@@ -6992,9 +6946,9 @@ dependencies = [
[[package]]
name = "rustls-native-certs"
-version = "0.8.1"
+version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3"
+checksum = "9980d917ebb0c0536119ba501e90834767bffc3d60641457fd84a1f3fd337923"
dependencies = [
"openssl-probe",
"rustls-pki-types",
@@ -7405,7 +7359,7 @@ dependencies = [
"chrono",
"hex",
"indexmap 1.9.3",
- "indexmap 2.11.4",
+ "indexmap 2.12.0",
"schemars 0.9.0",
"schemars 1.0.4",
"serde_core",
@@ -7432,7 +7386,7 @@ version = "0.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59e2dd588bf1597a252c3b920e0143eb99b0f76e4e082f4c92ce34fbc9e71ddd"
dependencies = [
- "indexmap 2.11.4",
+ "indexmap 2.12.0",
"itoa",
"libyml",
"memchr",
@@ -7533,7 +7487,7 @@ dependencies = [
"serial_test",
"sharded_queue",
"slab",
- "socket2 0.6.0",
+ "socket2 0.6.1",
"static-toml",
"strum",
"sysinfo 0.37.2",
@@ -7630,7 +7584,7 @@ version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c962f626b54771990066e5435ec8331d1462576cd2d1e62f24076ae014f92112"
dependencies = [
- "getrandom 0.3.3",
+ "getrandom 0.3.4",
"halfbrown",
"ref-cast",
"serde",
@@ -7728,12 +7682,12 @@ dependencies = [
[[package]]
name = "socket2"
-version = "0.6.0"
+version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807"
+checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881"
dependencies = [
"libc",
- "windows-sys 0.59.0",
+ "windows-sys 0.60.2",
]
[[package]]
@@ -7796,7 +7750,7 @@ dependencies = [
"futures-util",
"hashbrown 0.15.5",
"hashlink",
- "indexmap 2.11.4",
+ "indexmap 2.12.0",
"log",
"memchr",
"once_cell",
@@ -8160,7 +8114,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16"
dependencies = [
"fastrand",
- "getrandom 0.3.3",
+ "getrandom 0.3.4",
"once_cell",
"rustix",
"windows-sys 0.61.2",
@@ -8344,30 +8298,27 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
-version = "1.47.1"
+version = "1.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038"
+checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408"
dependencies = [
- "backtrace",
"bytes",
- "io-uring",
"libc",
"mio",
"parking_lot 0.12.5",
"pin-project-lite",
"signal-hook-registry",
- "slab",
- "socket2 0.6.0",
+ "socket2 0.6.1",
"tokio-macros",
"tracing",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
name = "tokio-macros"
-version = "2.5.0"
+version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
+checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5"
dependencies = [
"proc-macro2",
"quote",
@@ -8442,7 +8393,7 @@ version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8"
dependencies = [
- "indexmap 2.11.4",
+ "indexmap 2.12.0",
"serde_core",
"serde_spanned 1.0.3",
"toml_datetime 0.7.3",
@@ -8475,7 +8426,7 @@ version = "0.19.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421"
dependencies = [
- "indexmap 2.11.4",
+ "indexmap 2.12.0",
"toml_datetime 0.6.11",
"winnow 0.5.40",
]
@@ -8486,7 +8437,7 @@ version = "0.22.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
dependencies = [
- "indexmap 2.11.4",
+ "indexmap 2.12.0",
"serde",
"serde_spanned 0.6.9",
"toml_datetime 0.6.11",
@@ -8500,7 +8451,7 @@ version = "0.23.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6485ef6d0d9b5d0ec17244ff7eb05310113c3f316f2d14200d4de56b3cb98f8d"
dependencies = [
- "indexmap 2.11.4",
+ "indexmap 2.12.0",
"toml_datetime 0.7.3",
"toml_parser",
"winnow 0.7.13",
@@ -8624,7 +8575,7 @@ checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9"
dependencies = [
"futures-core",
"futures-util",
- "indexmap 2.11.4",
+ "indexmap 2.12.0",
"pin-project-lite",
"slab",
"sync_wrapper",
@@ -8991,7 +8942,7 @@ version = "1.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2"
dependencies = [
- "getrandom 0.3.3",
+ "getrandom 0.3.4",
"js-sys",
"rand 0.9.2",
"serde",
@@ -9118,15 +9069,6 @@ version = "0.11.1+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
-[[package]]
-name = "wasi"
-version = "0.14.7+wasi-0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c"
-dependencies = [
- "wasip2",
-]
-
[[package]]
name = "wasip2"
version = "1.0.1+wasi-0.2.4"
@@ -9910,7 +9852,7 @@ dependencies = [
"futures",
"gloo 0.10.0",
"implicit-clone",
- "indexmap 2.11.4",
+ "indexmap 2.12.0",
"js-sys",
"prokio",
"rustversion",
@@ -10117,9 +10059,9 @@ dependencies = [
"crc32fast",
"deflate64",
"flate2",
- "getrandom 0.3.3",
+ "getrandom 0.3.4",
"hmac",
- "indexmap 2.11.4",
+ "indexmap 2.12.0",
"lzma-rust2",
"memchr",
"pbkdf2",
diff --git a/core/bench/src/benchmarks/common.rs b/core/bench/src/benchmarks/common.rs
index 5aa2c4587..fb5bc1192 100644
--- a/core/bench/src/benchmarks/common.rs
+++ b/core/bench/src/benchmarks/common.rs
@@ -87,20 +87,10 @@ pub async fn init_consumer_groups(
"Creating test consumer group: name={}, stream={}, topic={}",
consumer_group_name, stream_name, topic_id
);
- match client
+ if let Err(err) = client
.create_consumer_group(&stream_id, &topic_id, &consumer_group_name)
- .await
- {
- Err(IggyError::ConsumerGroupIdAlreadyExists(_, _)) => {
- info!(
- "Consumer group with id {} already exists",
- consumer_group_id
- );
- }
- Err(err) => {
- error!("Error when creating consumer group {consumer_group_id}: {err}");
- }
- Ok(_) => {}
+ .await {
+ error!("Error when creating consumer group {consumer_group_id}: {err}");
}
}
Ok(())
diff --git a/core/common/src/error/iggy_error.rs b/core/common/src/error/iggy_error.rs
index eb6bbb84e..6939c38ba 100644
--- a/core/common/src/error/iggy_error.rs
+++ b/core/common/src/error/iggy_error.rs
@@ -205,13 +205,12 @@ pub enum IggyError {
CannotDeleteStream(u32) = 1007,
#[error("Failed to delete stream directory with ID: {0}")]
CannotDeleteStreamDirectory(u32) = 1008,
- //TODO: Fix the stream not found errors.
#[error("Stream with ID: {0} was not found.")]
- StreamIdNotFound(u32) = 1009,
+ StreamIdNotFound(Identifier) = 1009,
#[error("Stream with name: {0} was not found.")]
StreamNameNotFound(String) = 1010,
- #[error("Stream with ID: {0} already exists.")]
- StreamIdAlreadyExists(u32) = 1011,
+ #[error("Stream with directory {0} was not found.")]
+ StreamDirectoryNotFound(String) = 1011,
#[error("Stream with name: {0} already exists.")]
StreamNameAlreadyExists(String) = 1012,
#[error("Invalid stream name")]
@@ -225,9 +224,9 @@ pub enum IggyError {
)]
InvalidTopicSize(MaxTopicSize, IggyByteSize) = 1019,
#[error("Cannot create topics directory for stream with ID: {0}, Path: {1}")]
- CannotCreateTopicsDirectory(u32, String) = 2000,
+ CannotCreateTopicsDirectory(Identifier, String) = 2000,
#[error("Failed to create directory for topic with ID: {0} for stream with ID: {1}, Path: {2}")]
- CannotCreateTopicDirectory(u32, u32, String) = 2001,
+ CannotCreateTopicDirectory(usize, usize, String) = 2001,
#[error("Failed to create topic info file for topic with ID: {0} for stream with ID: {1}.")]
CannotCreateTopicInfo(u32, u32) = 2002,
#[error("Failed to update topic info for topic with ID: {0} for stream with ID: {1}.")]
@@ -245,13 +244,11 @@ pub enum IggyError {
#[error("Cannot poll topic")]
CannotPollTopic = 2009,
#[error("Topic with ID: {0} for stream with ID: {1} was not found.")]
- TopicIdNotFound(u32, u32) = 2010,
+ TopicIdNotFound(Identifier, Identifier) = 2010,
#[error("Topic with name: {0} for stream with ID: {1} was not found.")]
TopicNameNotFound(String, String) = 2011,
- #[error("Topic with ID: {0} for stream with ID: {1} already exists.")]
- TopicIdAlreadyExists(u32, u32) = 2012,
#[error("Topic with name: {0} for stream with ID: {1} already exists.")]
- TopicNameAlreadyExists(String, u32) = 2013,
+ TopicNameAlreadyExists(String, Identifier) = 2013,
#[error("Invalid topic name")]
InvalidTopicName = 2014,
#[error("Too many partitions")]
@@ -264,16 +261,18 @@ pub enum IggyError {
InvalidReplicationFactor = 2018,
#[error("Invalid partitions count")]
InvalidPartitionsCount = 2019,
+ #[error("Topic directory: {0} not found")]
+ TopicDirectoryNotFound(String) = 2020,
#[error("Cannot create partition with ID: {0} for stream with ID: {1} and topic with ID: {2}")]
- CannotCreatePartition(u32, u32, u32) = 3000,
+ CannotCreatePartition(usize, usize, usize) = 3000,
#[error(
"Failed to create directory for partitions for stream with ID: {0} and topic with ID: {1}"
)]
- CannotCreatePartitionsDirectory(u32, u32) = 3001,
+ CannotCreatePartitionsDirectory(usize, usize) = 3001,
#[error(
"Failed to create directory for partition with ID: {0} for stream with ID: {1} and topic with ID: {2}"
)]
- CannotCreatePartitionDirectory(u32, u32, u32) = 3002,
+ CannotCreatePartitionDirectory(usize, usize, usize) = 3002,
#[error("Cannot open partition log file")]
CannotOpenPartitionLogFile = 3003,
#[error("Cannot read partitions directories.")]
@@ -281,17 +280,17 @@ pub enum IggyError {
#[error(
"Failed to delete partition with ID: {0} for stream with ID: {1} and topic with ID: {2}"
)]
- CannotDeletePartition(u32, u32, u32) = 3005,
+ CannotDeletePartition(usize, Identifier, Identifier) = 3005,
#[error(
"Failed to delete partition directory with ID: {0} for stream with ID: {1} and topic with ID: {2}"
)]
- CannotDeletePartitionDirectory(u32, u32, u32) = 3006,
+ CannotDeletePartitionDirectory(usize, usize, usize) = 3006,
#[error("Partition with ID: {0} for topic with ID: {1} for stream with ID: {2} was not found.")]
- PartitionNotFound(u32, u32, u32) = 3007,
+ PartitionNotFound(usize, Identifier, Identifier) = 3007,
#[error("Topic with ID: {0} for stream with ID: {1} has no partitions.")]
- NoPartitions(u32, u32) = 3008,
+ NoPartitions(Identifier, Identifier) = 3008,
#[error("Cannot read partitions for topic with ID: {0} for stream with ID: {1}")]
- TopicFull(u32, u32) = 3009,
+ TopicFull(Identifier, Identifier) = 3009,
#[error("Failed to delete consumer offsets directory for path: {0}")]
CannotDeleteConsumerOffsetsDirectory(String) = 3010,
#[error("Failed to delete consumer offset file for path: {0}")]
@@ -309,7 +308,7 @@ pub enum IggyError {
#[error("Segment not found")]
SegmentNotFound = 4000,
#[error("Segment with start offset: {0} and partition with ID: {1} is closed")]
- SegmentClosed(u64, u32) = 4001,
+ SegmentClosed(u64, usize) = 4001,
#[error("Segment size is invalid")]
InvalidSegmentSize(u64) = 4002,
#[error("Failed to create segment log file for Path: {0}.")]
@@ -406,29 +405,27 @@ pub enum IggyError {
#[error("Invalid offset: {0}")]
InvalidOffset(u64) = 4100,
#[error("Consumer group with ID: {0} for topic with ID: {1} was not found.")]
- ConsumerGroupIdNotFound(u32, u32) = 5000,
- #[error("Consumer group with ID: {0} for topic with ID: {1} already exists.")]
- ConsumerGroupIdAlreadyExists(u32, u32) = 5001,
+ ConsumerGroupIdNotFound(Identifier, Identifier) = 5000,
#[error("Invalid consumer group ID")]
InvalidConsumerGroupId = 5002,
#[error("Consumer group with name: {0} for topic with ID: {1} was not found.")]
- ConsumerGroupNameNotFound(String, String) = 5003,
+ ConsumerGroupNameNotFound(String, Identifier) = 5003,
#[error("Consumer group with name: {0} for topic with ID: {1} already exists.")]
- ConsumerGroupNameAlreadyExists(String, u32) = 5004,
+ ConsumerGroupNameAlreadyExists(String, Identifier) = 5004,
#[error("Invalid consumer group name")]
InvalidConsumerGroupName = 5005,
#[error(
"Consumer group member with ID: {0} for group with ID: {1} for topic with ID: {2} was not found."
)]
- ConsumerGroupMemberNotFound(u32, u32, u32) = 5006,
+ ConsumerGroupMemberNotFound(usize, Identifier, Identifier) = 5006,
#[error(
"Failed to create consumer group info file for ID: {0} for topic with ID: {1} for stream with ID: {2}."
)]
- CannotCreateConsumerGroupInfo(u32, u32, u32) = 5007,
+ CannotCreateConsumerGroupInfo(usize, Identifier, Identifier) = 5007,
#[error(
"Failed to delete consumer group info file for ID: {0} for topic with ID: {1} for stream with ID: {2}."
)]
- CannotDeleteConsumerGroupInfo(u32, u32, u32) = 5008,
+ CannotDeleteConsumerGroupInfo(usize, Identifier, Identifier) = 5008,
#[error("Base offset is missing")]
MissingBaseOffsetRetainedMessageBatch = 6000,
#[error("Last offset delta is missing")]
diff --git a/core/integration/tests/server/general.rs b/core/integration/tests/server/general.rs
index 344b97d55..37e47d9b6 100644
--- a/core/integration/tests/server/general.rs
+++ b/core/integration/tests/server/general.rs
@@ -23,7 +23,6 @@ use iggy_common::TransportProtocol;
use serial_test::parallel;
use test_case::test_matrix;
-// TODO: Include other trasnsport protocols
#[test_matrix(
[quic(), tcp(), http(), websocket()],
[
diff --git a/core/integration/tests/server/scenarios/concurrent_scenario.rs b/core/integration/tests/server/scenarios/concurrent_scenario.rs
index e7a2831ef..3b6fc1bdf 100644
--- a/core/integration/tests/server/scenarios/concurrent_scenario.rs
+++ b/core/integration/tests/server/scenarios/concurrent_scenario.rs
@@ -465,9 +465,7 @@ fn validate_results(results: &[OperationResult], scenario_type: ScenarioType) {
matches!(
err,
IggyError::UserAlreadyExists
- | IggyError::StreamIdAlreadyExists(_)
| IggyError::StreamNameAlreadyExists(_)
- | IggyError::TopicIdAlreadyExists(_, _)
| IggyError::TopicNameAlreadyExists(_, _)
| IggyError::HttpResponseError(400, _)
),
diff --git a/core/sdk/src/clients/consumer.rs b/core/sdk/src/clients/consumer.rs
index 273f2cb8b..059236387 100644
--- a/core/sdk/src/clients/consumer.rs
+++ b/core/sdk/src/clients/consumer.rs
@@ -829,9 +829,10 @@ impl IggyConsumer {
{
if !create_consumer_group_if_not_exists {
error!("Consumer group does not exist and auto-creation is disabled.");
+ let topic_identifier = Identifier::from_identifier(&topic_id);
return Err(IggyError::ConsumerGroupNameNotFound(
name.to_owned(),
- topic_id.get_string_value().unwrap_or_default(),
+ topic_identifier,
));
}
diff --git a/core/sdk/src/tcp/tcp_client.rs b/core/sdk/src/tcp/tcp_client.rs
index ab299cc4c..bcb20c2ed 100644
--- a/core/sdk/src/tcp/tcp_client.rs
+++ b/core/sdk/src/tcp/tcp_client.rs
@@ -208,13 +208,10 @@ impl TcpClient {
) -> Result<Bytes, IggyError> {
if status != 0 {
// TEMP: See https://github.com/apache/iggy/pull/604 for context.
- if status == IggyErrorDiscriminants::TopicIdAlreadyExists as u32
- || status == IggyErrorDiscriminants::TopicNameAlreadyExists as u32
- || status == IggyErrorDiscriminants::StreamIdAlreadyExists as u32
+ if status == IggyErrorDiscriminants::TopicNameAlreadyExists as u32
|| status == IggyErrorDiscriminants::StreamNameAlreadyExists as u32
|| status == IggyErrorDiscriminants::UserAlreadyExists as u32
|| status == IggyErrorDiscriminants::PersonalAccessTokenAlreadyExists as u32
- || status == IggyErrorDiscriminants::ConsumerGroupIdAlreadyExists as u32
|| status == IggyErrorDiscriminants::ConsumerGroupNameAlreadyExists as u32
{
tracing::debug!(
diff --git a/core/server/src/http/error.rs b/core/server/src/http/error.rs
index 66b2a8342..8cbe70ae3 100644
--- a/core/server/src/http/error.rs
+++ b/core/server/src/http/error.rs
@@ -96,14 +96,9 @@ impl ErrorResponse {
IggyError::InvalidTopicName => Some("name".to_string()),
IggyError::TopicNameAlreadyExists(_, _) => Some("name".to_string()),
IggyError::InvalidStreamId => Some("stream_id".to_string()),
- IggyError::StreamIdAlreadyExists(_) => Some("stream_id".to_string()),
IggyError::InvalidTopicId => Some("topic_id".to_string()),
- IggyError::TopicIdAlreadyExists(_, _) => Some("topic_id".to_string()),
IggyError::InvalidOffset(_) => Some("offset".to_string()),
IggyError::InvalidConsumerGroupId => Some("consumer_group_id".to_string()),
- IggyError::ConsumerGroupIdAlreadyExists(_, _) => {
- Some("consumer_group_id".to_string())
- }
IggyError::ConsumerGroupNameAlreadyExists(_, _) => Some("name".to_string()),
IggyError::UserAlreadyExists => Some("username".to_string()),
IggyError::PersonalAccessTokenAlreadyExists(_, _) => Some("name".to_string()),
diff --git a/core/server/src/shard/mod.rs b/core/server/src/shard/mod.rs
index 76e5b21c2..9abf6835c 100644
--- a/core/server/src/shard/mod.rs
+++ b/core/server/src/shard/mod.rs
@@ -115,13 +115,10 @@ pub struct IggyShard {
shards: Vec<Shard>,
_version: SemanticVersion,
- // Heart transplant of the old streams structure.
pub(crate) streams2: Streams,
pub(crate) shards_table: EternalPtr<DashMap<IggyNamespace, ShardInfo>>,
- // TODO: Refactor.
pub(crate) state: FileState,
- // Temporal...
pub(crate) encryptor: Option<EncryptorKind>,
pub(crate) config: ServerConfig,
//TODO: This could be shared.
diff --git a/core/server/src/shard/system/streams.rs b/core/server/src/shard/system/streams.rs
index a67318f6c..df91f5d3e 100644
--- a/core/server/src/shard/system/streams.rs
+++ b/core/server/src/shard/system/streams.rs
@@ -115,8 +115,8 @@ impl IggyShard {
let stats = stream.stats();
self.metrics.decrement_streams(1);
- self.metrics.decrement_topics(0); // TODO: stats doesn't have topic count
- self.metrics.decrement_partitions(0); // TODO: stats doesn't have partition count
+ self.metrics.decrement_topics(0);
+ self.metrics.decrement_partitions(0);
self.metrics
.decrement_messages(stats.messages_count_inconsistent());
self.metrics
diff --git a/core/server/src/shard/system/topics.rs b/core/server/src/shard/system/topics.rs
index 32490badd..da10cbfb0 100644
--- a/core/server/src/shard/system/topics.rs
+++ b/core/server/src/shard/system/topics.rs
@@ -59,10 +59,7 @@ impl IggyShard {
topics::helpers::exists(&Identifier::from_str(&name).unwrap()),
);
if exists {
- return Err(IggyError::TopicNameAlreadyExists(
- name,
- numeric_stream_id as u32,
- ));
+ return Err(IggyError::TopicNameAlreadyExists(name, stream_id.clone()));
}
let config = &self.config.system;
diff --git a/core/server/src/shard/system/utils.rs b/core/server/src/shard/system/utils.rs
index 89135edd3..9cd9d7845 100644
--- a/core/server/src/shard/system/utils.rs
+++ b/core/server/src/shard/system/utils.rs
@@ -4,7 +4,6 @@ use crate::{
shard::IggyShard,
streaming::{
polling_consumer::PollingConsumer,
- streams::helpers::get_stream_id,
topics::{self},
},
};
@@ -12,7 +11,7 @@ use crate::{
impl IggyShard {
pub fn ensure_stream_exists(&self, stream_id: &Identifier) -> Result<(), IggyError> {
if !self.streams2.exists(stream_id) {
- return Err(IggyError::StreamIdNotFound(0));
+ return Err(IggyError::StreamIdNotFound(stream_id.clone()));
}
Ok(())
}
@@ -27,7 +26,10 @@ impl IggyShard {
.streams2
.with_topics(stream_id, topics::helpers::exists(topic_id));
if !exists {
- return Err(IggyError::TopicIdNotFound(0, 0));
+ return Err(IggyError::TopicIdNotFound(
+ stream_id.clone(),
+ topic_id.clone(),
+ ));
}
Ok(())
}
@@ -46,7 +48,10 @@ impl IggyShard {
topics::helpers::cg_exists(group_id),
);
if !exists {
- return Err(IggyError::ConsumerGroupIdNotFound(0, 0));
+ return Err(IggyError::ConsumerGroupIdNotFound(
+ group_id.clone(),
+ topic_id.clone(),
+ ));
}
Ok(())
}
@@ -83,16 +88,10 @@ impl IggyShard {
});
if !partition_exists {
- let numeric_stream_id = self.streams2.with_stream_by_id(stream_id, get_stream_id());
- let numeric_topic_id = self.streams2.with_topic_by_id(
- stream_id,
- topic_id,
- topics::helpers::get_topic_id(),
- );
return Err(IggyError::PartitionNotFound(
- partition_id as u32,
- numeric_topic_id as u32,
- numeric_stream_id as u32,
+ partition_id,
+ topic_id.clone(),
+ stream_id.clone(),
));
}
diff --git a/core/server/src/slab/topics.rs b/core/server/src/slab/topics.rs
index d66880a9e..307513e26 100644
--- a/core/server/src/slab/topics.rs
+++ b/core/server/src/slab/topics.rs
@@ -88,7 +88,6 @@ impl DeleteCell for Topics {
}
}
-//TODO: those from impls could use a macro aswell.
impl<'a> From<&'a Topics> for topic2::TopicRef<'a> {
fn from(value: &'a Topics) -> Self {
let root = value.root.borrow();
diff --git a/core/server/src/slab/traits_ext.rs b/core/server/src/slab/traits_ext.rs
index de4e11df9..377f85e3c 100644
--- a/core/server/src/slab/traits_ext.rs
+++ b/core/server/src/slab/traits_ext.rs
@@ -49,32 +49,9 @@ pub struct Borrow;
/// Marker type for component containers that use interior mutability.
pub struct InteriorMutability;
-// I think it's better to *NOT* use `Components` directly on the `with` methods.
-// Instead use the `Self::EntityRef` type directly.
-// This way we can auto implement the `with_by_id` method.
-// But on the other hand, we need to call `into_components` on the value returned by the `with` method.
-// So we lack the ability to immediately discard unnecessary components, which leads to less ergonomic API.
-// Damn tradeoffs.
pub type Components<T> = <T as IntoComponents>::Components;
pub type ComponentsById<'a, T> = <T as IntoComponentsById>::Output;
-// TODO:
-// I've figured there is actually and ergonomic improvement that can be made here.
-// Observe that the chain of constraints put on the `EntityRef` type is actually wrong.
-// We constraint the `EntityRef` to be IntoComponents + IntoComponentsById,
-// which from composability point of view is not ideal...
-// A better idea is to constraint the `IntoComponents::Output` of the `EntityRef` impl to `IntoComponentsById`, rather than entire `EntityRef`.
-// This way we can name the type inside of the `with_by_id` methods, without desolving into the tuple mapping madness.
-// in the `stream.rs` `topic.rs` `partitions.rs` files, we need to implement the `IntoComponentsById` trait for the output type of `IntoComponents` implementation, for `EntityRef`.
-// to make our life easier, we can create a type alias for those tuples and maybe even create a macro, to not repeat the type 3 times per entity (TupleEntityType, TupleEntityTypeRef, TupleEntityTypeRefByid).
-
-// TODO: Since those traits at impl site, all they do is call `f(self.into())`
-// we can blanket implement those for all types that implement `From` trait.
-
-// Maybe lets not go this way with the tuple mapping madness, it already is pretty difficult to distinguish between all of the different components,
-// and everytime we add a new component to an entity, we need to update the tuple type everywhere.
-// Better idea would be to use the `EntityRef` type directly inside of the `with_components_by_id` closure
-// -- f(components.into_components_by_id(id)) -> components.into_components_by_id(id) would return `EntityRef`, rather than the tuple.
pub trait EntityComponentSystem<T> {
type Idx;
type Entity: IntoComponents + EntityMarker;
diff --git a/core/server/src/streaming/partitions/partition2.rs b/core/server/src/streaming/partitions/partition2.rs
index 1b5480a5a..388aef4e5 100644
--- a/core/server/src/streaming/partitions/partition2.rs
+++ b/core/server/src/streaming/partitions/partition2.rs
@@ -231,7 +231,6 @@ impl PartitionRoot {
}
}
-// TODO: Create a macro to impl those PartitionRef/PartitionRefMut structs and it's traits.
pub struct PartitionRef<'a> {
root: &'a Slab<PartitionRoot>,
stats: &'a Slab<Arc<PartitionStats>>,
diff --git a/core/server/src/streaming/partitions/storage2.rs b/core/server/src/streaming/partitions/storage2.rs
index 42ff8698d..3376b24d1 100644
--- a/core/server/src/streaming/partitions/storage2.rs
+++ b/core/server/src/streaming/partitions/storage2.rs
@@ -29,9 +29,9 @@ pub async fn create_partition_file_hierarchy(
);
if !Path::new(&partition_path).exists() && create_dir_all(&partition_path).await.is_err() {
return Err(IggyError::CannotCreatePartitionDirectory(
- partition_id as u32,
- stream_id as u32,
- topic_id as u32,
+ partition_id,
+ stream_id,
+ topic_id,
));
}
@@ -45,9 +45,9 @@ pub async fn create_partition_file_hierarchy(
topic_id
);
return Err(IggyError::CannotCreatePartition(
- partition_id as u32,
- stream_id as u32,
- topic_id as u32,
+ partition_id,
+ stream_id,
+ topic_id,
));
}
@@ -63,9 +63,9 @@ pub async fn create_partition_file_hierarchy(
topic_id
);
return Err(IggyError::CannotCreatePartition(
- partition_id as u32,
- stream_id as u32,
- topic_id as u32,
+ partition_id,
+ stream_id,
+ topic_id,
));
}
@@ -82,9 +82,9 @@ pub async fn create_partition_file_hierarchy(
topic_id
);
return Err(IggyError::CannotCreatePartition(
- partition_id as u32,
- stream_id as u32,
- topic_id as u32,
+ partition_id,
+ stream_id,
+ topic_id,
));
}
@@ -109,11 +109,7 @@ pub async fn delete_partitions_from_disk(
) -> Result<(), IggyError> {
let partition_path = config.get_partition_path(stream_id, topic_id, partition_id);
remove_dir_all(&partition_path).await.map_err(|_| {
- IggyError::CannotDeletePartitionDirectory(
- stream_id as u32,
- topic_id as u32,
- partition_id as u32,
- )
+ IggyError::CannotDeletePartitionDirectory(stream_id, topic_id, partition_id)
})?;
shard_info!(
shard_id,
diff --git a/core/server/src/streaming/streams/storage2.rs b/core/server/src/streaming/streams/storage2.rs
index fde2e0b5f..302254a90 100644
--- a/core/server/src/streaming/streams/storage2.rs
+++ b/core/server/src/streaming/streams/storage2.rs
@@ -32,7 +32,7 @@ pub async fn delete_stream_from_disk(
let stream_id = stream.id();
let stream_path = config.get_stream_path(stream_id);
if !Path::new(&stream_path).exists() {
- return Err(IggyError::StreamIdNotFound(stream_id as u32));
+ return Err(IggyError::StreamDirectoryNotFound(stream_path));
}
// Gather all topic ids.
diff --git a/core/server/src/streaming/topics/consumer_group2.rs b/core/server/src/streaming/topics/consumer_group2.rs
index ca58d55fb..f5992fb15 100644
--- a/core/server/src/streaming/topics/consumer_group2.rs
+++ b/core/server/src/streaming/topics/consumer_group2.rs
@@ -94,7 +94,6 @@ impl IntoComponents for ConsumerGroup {
}
}
-// TODO: Create a macro to impl those ConsumerGroupRef/ConsumerGroupRefMut structs and it's traits.
pub struct ConsumerGroupRef<'a> {
root: &'a Slab<ConsumerGroupRoot>,
members: &'a Slab<ConsumerGroupMembers>,
diff --git a/core/server/src/streaming/topics/storage2.rs b/core/server/src/streaming/topics/storage2.rs
index c412d1dd3..bdf193ec3 100644
--- a/core/server/src/streaming/topics/storage2.rs
+++ b/core/server/src/streaming/topics/storage2.rs
@@ -20,9 +20,7 @@ pub async fn create_topic_file_hierarchy(
let partitions_path = config.get_partitions_path(stream_id, topic_id);
if !Path::new(&topic_path).exists() && create_dir_all(&topic_path).await.is_err() {
return Err(IggyError::CannotCreateTopicDirectory(
- topic_id as u32,
- stream_id as u32,
- topic_path,
+ topic_id, stream_id, topic_path,
));
}
shard_info!(
@@ -34,8 +32,7 @@ pub async fn create_topic_file_hierarchy(
if !Path::new(&partitions_path).exists() && create_dir_all(&partitions_path).await.is_err() {
return Err(IggyError::CannotCreatePartitionsDirectory(
- stream_id as u32,
- topic_id as u32,
+ stream_id, topic_id,
));
}
Ok(())
@@ -50,10 +47,7 @@ pub async fn delete_topic_from_disk(
let topic_path = config.get_topic_path(stream_id, topic.id());
let topic_id = topic.id();
if !Path::new(&topic_path).exists() {
- return Err(IggyError::TopicIdNotFound(
- topic_id as u32,
- stream_id as u32,
- ));
+ return Err(IggyError::TopicDirectoryNotFound(topic_path));
}
// First lets go over the partitions and it's logs and delete them from disk.
let ids = topic.root().partitions().with_components(|components| {