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

[bookkeeper] Don't return DEFAULT_RACK if ZkBookieRackAffinityMapping can't resolve network location #5067

Merged
merged 1 commit into from
Aug 31, 2019

Conversation

sijie
Copy link
Member

@sijie sijie commented Aug 29, 2019

Motivation

Different placement policy has different default rack information. For example, the default rack for RackAware
is /default-rack and the default rack for RegionAware is /default-region/default-rack. If we return the
wrong default rack, it can potentially cause inconsistent network locations inserted to the network topology and
causing the following errors.

15:36:30.083 [BookKeeperClientScheduler-OrderedScheduler-0-0] ERROR org.apache.bookkeeper.net.NetworkTopologyImpl - Error: can't add leaf node <Bookie:1.1.1.2:3181> at depth 2 to topology:
Number of racks: 1
Expected number of leaves:1
/sh/rack1/1.1.1.1:3181

15:36:30.083 [BookKeeperClientScheduler-OrderedScheduler-0-0] ERROR org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl - Unexpected exception while handling joining bookie 1.1.1.2:3181
org.apache.bookkeeper.net.NetworkTopologyImpl$InvalidTopologyException: Invalid network topology. You cannot have a rack and a non-rack node at the same level of the network topology.

… can't resolve network location

*Motivation*

Different placement policy has different default rack information. For example, the default rack for `RackAware`
is `/default-rack` and the default rack for `RegionAware` is `/default-region/default-rack`. If we return the
wrong default rack, it can potentially cause inconsistent network locations inserted to the network topology and
causing the following errors.

```
15:36:30.083 [BookKeeperClientScheduler-OrderedScheduler-0-0] ERROR org.apache.bookkeeper.net.NetworkTopologyImpl - Error: can't add leaf node <Bookie:1.1.1.2:3181> at depth 2 to topology:
Number of racks: 1
Expected number of leaves:1
/sh/rack1/1.1.1.1:3181

15:36:30.083 [BookKeeperClientScheduler-OrderedScheduler-0-0] ERROR org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl - Unexpected exception while handling joining bookie 1.1.1.2:3181
org.apache.bookkeeper.net.NetworkTopologyImpl$InvalidTopologyException: Invalid network topology. You cannot have a rack and a non-rack node at the same level of the network topology.
```
@sijie sijie added type/bug The PR fixed a bug or issue reported a bug component/storage labels Aug 29, 2019
@sijie sijie added this to the 2.4.2 milestone Aug 29, 2019
@sijie sijie self-assigned this Aug 29, 2019
@sijie
Copy link
Member Author

sijie commented Aug 29, 2019

run cpp tests
run java8 tests

@sijie
Copy link
Member Author

sijie commented Aug 30, 2019

run java8 tests

@sijie sijie merged commit c993375 into apache:master Aug 31, 2019
@sijie sijie deleted the fix_default_path branch August 31, 2019 04:26
wolfstudy pushed a commit that referenced this pull request Nov 20, 2019
… can't resolve network location (#5067)

*Motivation*

Different placement policy has different default rack information. For example, the default rack for `RackAware`
is `/default-rack` and the default rack for `RegionAware` is `/default-region/default-rack`. If we return the
wrong default rack, it can potentially cause inconsistent network locations inserted to the network topology and
causing the following errors.

```
15:36:30.083 [BookKeeperClientScheduler-OrderedScheduler-0-0] ERROR org.apache.bookkeeper.net.NetworkTopologyImpl - Error: can't add leaf node <Bookie:1.1.1.2:3181> at depth 2 to topology:
Number of racks: 1
Expected number of leaves:1
/sh/rack1/1.1.1.1:3181

15:36:30.083 [BookKeeperClientScheduler-OrderedScheduler-0-0] ERROR org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl - Unexpected exception while handling joining bookie 1.1.1.2:3181
org.apache.bookkeeper.net.NetworkTopologyImpl$InvalidTopologyException: Invalid network topology. You cannot have a rack and a non-rack node at the same level of the network topology.
```

(cherry picked from commit c993375)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants