Skip to content
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

[feat][broker] PIP-180 Part VI: Add ShadowManagedLedgerImpl #12

Closed
wants to merge 183 commits into from

Conversation

Jason918
Copy link
Owner

This PR is for running tests for upstream PR apache#18265.

yuruguo and others added 28 commits October 31, 2022 17:09
…he#18252)

* [fix][broker] Fix if dynamicConfig item in ZK do not exist in broker cause NPE (apache#17705)

* [fix][Authorization] Modify authorization to update topic's properties

Co-authored-by: Lei Zhiyuan <[email protected]>
…pache#17847)

Master Issue: apache#16913

### Motivation

Implement an abortedTxnProcessor to handle the storage of the aborted transaction ID.
### Modifications
The structure overview: 
![image](https://user-images.githubusercontent.com/55571188/197683651-6ccb106d-1e71-4841-9da7-2644275a401a.png)

The main idea is to move the logic of the operation of checking and persistent aborted transaction IDs(take snapshots)  and the operation of updating maxReadPosition into the AbortedTxnProcessor.
And the AbortedTxnProcessor can be implemented in different designs.

**Add `persistentWorker` to handle snapshot persistenting** :
<img width="1003" alt="image" src="https://user-images.githubusercontent.com/55571188/198528131-3cde19bc-2034-4693-a8b1-4d6345e6db36.png">
The first four items below are the corresponding four tasks in the figure. The fifth item is not strictly a task, but a part of the first two tasks.
* takeSnapshotSegmentAsync -> writeSnapshotSegmentAsync
    * These two method is used to persist the snapshot segment.
* deleteSnapshotSegment
    * This method is used to delete the snapshot segment.

* updateIndexMetadataForTheLastSnapshot
    * Using to update index metadata (the latest snapshot).

* clearSnapshotSegmentAndIndexes
    * Delete all segments and then delete the index of this topic.


* updateSnapshotIndex
    * Called by the deleteSnapshotSegment and writeSnapshotSegmentAsync. Do update the index after writing snapshot segment.
    * Called by recovery as a compensation mechanism for updating the index.

### Documentation

<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->

- [x] `doc-not-needed` 
(Please explain why)


### Matching PR in the forked repository

PR in forked repository: liangyepianzhou#7
…mmandSender` (apache#18250)

change to `sendSuccessResponse` and `sendErrorResponse`
* fix some error

* Update site2/docs/functions-overview.md

Co-authored-by: tison <[email protected]>

Co-authored-by: tison <[email protected]>
…pache#18141)

* Move out some already stable test from flaky group.

* Assigned tests to some test group explicitly

* fix test

* Address comment
…on topic (apache#18212)

* [improve] [client] Add api to get producer/consumer stats for partition topic

* introduce partition topic stats interface
…ache#18289)

* [fix][test]fix flaky test SimpleProducerConsumerTestStreamingDispatcherTest.testSharedSamePriorityConsumer

* remove unnecessary change
…8278)

* [cleanup] Direct get lowest PositionImpl from TreeMap

change signature from Set<T> to NavigableSet<T>
which makes the caller to get lowest PositionImpl more efficient.

* change poll to first when call `NavigableSet`

* fix check style remove unused import

Co-authored-by: wangjinlong <[email protected]>
…he#18310)

Fixes apache#18230

### Motivation
`ManagedCursorImpl` has a known problem: when the `cursor.close` and the `cursor.switchLedger` are concurrent executing, a bad version exception is thrown. see: 

https://github.com/apache/pulsar/blob/0c3c175eb132d4ef0fb3a12842127dcb4fa1933d/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java#L2595-L2619

In this test, it hit this problem:

- `MlPendingAckStore.clearUselessLogData` will trigger `cursor.switchLedger` if it is the first execute `mard delete`.
- `MlPendingAckStore.close` will trigger `cursor.close`

### Modifications

if `MlPendingAckStore.close` fail, just retry, it will be ok
coderzc and others added 27 commits November 25, 2022 09:31
reason: https://lists.apache.org/thread/jcrq9q0k6kh9rvb71dwb9s3mvo5c5dk5

branch-2.9 has reset to commit `5ed247de3a5e0ff67f181b4805fd6140d8174994`, so close force-push

- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
…pache#18603)

This PR is a supplement to apache#18369.
- `AbstractTopic.isSameAddressProducersExceeded()`
- `AbstractBaseDispatcher.isConsumersExceededOnSubscription()`
- finish processSourceManagedLedgerInfo
- finish internalAsyncAddEntry
- ShadowTopicTest pass
- ShadowReplicatorTest pass

Add test cases
@Jason918 Jason918 closed this Dec 9, 2022
@Jason918 Jason918 deleted the pip-180-dev branch February 17, 2023 02:26
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.