Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

[fix][transaction] Handle some failures in transaction #1977

Merged

Conversation

gaoran10
Copy link
Contributor

@gaoran10 gaoran10 commented Jul 24, 2023

Modifications

Handle some failures while writing transaction logs and markers.

Documentation

Check the box below.

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

    (Please explain why)

  • doc

    (If this PR contains doc changes)

@github-actions github-actions bot added the no-need-doc This pr does not need any document label Jul 24, 2023
@codecov
Copy link

codecov bot commented Jul 24, 2023

Codecov Report

Merging #1977 (bc0b43a) into master (20e4886) will decrease coverage by 0.67%.
Report is 9 commits behind head on master.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1977      +/-   ##
============================================
- Coverage     17.72%   17.06%   -0.67%     
+ Complexity      752      728      -24     
============================================
  Files           195      191       -4     
  Lines         14174    14232      +58     
  Branches       1325     1332       +7     
============================================
- Hits           2512     2428      -84     
- Misses        11480    11628     +148     
+ Partials        182      176       -6     
Files Changed Coverage Δ
...pulsar/handlers/kop/KafkaServiceConfiguration.java 76.70% <0.00%> (ø)
...oordinator/transaction/TransactionCoordinator.java 0.00% <0.00%> (ø)
...r/transaction/TransactionMarkerChannelManager.java 0.00% <0.00%> (ø)
...sar/handlers/kop/storage/ProducerStateManager.java 0.00% <0.00%> (ø)

... and 14 files with indirect coverage changes

@gaoran10 gaoran10 force-pushed the handle_some_failures_in_transaction branch from 4ddb5fa to ff9cfdf Compare July 30, 2023 09:23
// do not cache failed futures
handlerFuture.exceptionally(error -> {
log.error("getChannel failed {} {}", socketAddress, error.getMessage(), error);
handlerMap.remove(socketAddress, handlerFuture);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the value in the map may cause Recursive update error.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is an example:

ConcurrentHashMap<String, String> map = new ConcurrentHashMap<>();
        map.computeIfAbsent("test", key -> {
            map.remove("test");
            return "test";
        });

@gaoran10 gaoran10 merged commit 0c9f946 into streamnative:master Aug 7, 2023
17 of 19 checks passed
@gaoran10 gaoran10 deleted the handle_some_failures_in_transaction branch August 7, 2023 07:36
Demogorgon314 pushed a commit to Demogorgon314/kop that referenced this pull request Oct 30, 2023
…1977)

### Modifications

Handle some failures while writing transaction logs and markers.

---------

Co-authored-by: Enrico Olivelli <[email protected]>
(cherry picked from commit 0c9f946)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants