Skip to content

Check existence of inbox before cleaning when client connecting with CleanStart=True #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2025

Conversation

popduke
Copy link
Contributor

@popduke popduke commented Jul 17, 2025

The "CleanStart = true" with a non-empty client ID requires clearing the previous session, which may trigger a write to the inbox store regardless of whether a previous session actually exists. To reduce unnecessary overhead, we can first check for the existence of the session—a lightweight read—and only perform the clear operation if necessary. This approach can significantly reduce inbox store overhead in typical scenarios.

@popduke popduke changed the title Check existence of inbox before cleaning for when client connecting with CleanStart=True Check existence of inbox before cleaning when client connecting with CleanStart=True Jul 17, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 16337327511

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 61 unchanged lines in 10 files lost coverage.
  • Overall coverage increased (+0.04%) to 63.239%

Files with Coverage Reduction New Missed Lines %
org/apache/bifromq/basecluster/memberlist/AutoDropper.java 1 82.3%
org/apache/bifromq/basecluster/transport/TCPTransport.java 1 87.06%
org/apache/bifromq/basecrdt/core/internal/CausalCRDTInflater.java 1 93.07%
org/apache/bifromq/basecrdt/store/AntiEntropy.java 1 84.21%
org/apache/bifromq/dist/trie/TopicFilterIterator.java 1 70.23%
org/apache/bifromq/mqtt/handler/MQTTPersistentSessionHandler.java 1 74.57%
org/apache/bifromq/basecluster/fd/FailureDetector.java 2 88.16%
org/apache/bifromq/basecrdt/service/CRDTCluster.java 2 81.91%
org/apache/bifromq/basekv/raft/RaftNodeState.java 6 90.95%
org/apache/bifromq/mqtt/handler/MQTTConnectHandler.java 45 77.73%
Totals Coverage Status
Change from base Build 16309881962: 0.04%
Covered Lines: 23338
Relevant Lines: 35676

💛 - Coveralls

@popduke popduke requested a review from ZHANGSHUNLIN July 17, 2025 06:52
@ZHANGSHUNLIN ZHANGSHUNLIN merged commit ff8242f into apache:main Jul 17, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants