Skip to content

Persist currently started allocation IDs to index metadata#14964

Merged
ywelsch merged 2 commits intoelastic:masterfrom
ywelsch:feature/persist-allocid-indexmetadata
Dec 4, 2015
Merged

Persist currently started allocation IDs to index metadata#14964
ywelsch merged 2 commits intoelastic:masterfrom
ywelsch:feature/persist-allocid-indexmetadata

Conversation

@ywelsch
Copy link
Copy Markdown
Contributor

@ywelsch ywelsch commented Nov 24, 2015

These allocation IDs serve as candidates to decide future primary shards

Subtask of #14739

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should make this unmodifiable here at least?

@s1monw
Copy link
Copy Markdown
Contributor

s1monw commented Nov 24, 2015

left minor comments LGTM otherwise

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we call these "activeAllocationIds" ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

also we need those PER shard.. so the allocation ids for shard 0, alloc ids for shard 1 etc.

@bleskes
Copy link
Copy Markdown
Contributor

bleskes commented Nov 24, 2015

This looks good. I left some minor suggestion. Note the comment about storing allocation ids per shard in the meta data. I know the allocation Ids are unique so in theory we can throw them in one big pile, but I think it will be clearer in terms of code and API later on to have them separated.

@ywelsch
Copy link
Copy Markdown
Contributor Author

ywelsch commented Nov 25, 2015

Pushed a larger set of changes, please have another look @bleskes and @s1monw. I store the allocation ids now on a per shard id basis and introduced a new class that helps with the serialization / cluster diffs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if we should follow the OpenIntMap and call this StringMapDiff , just to key things shorter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cool. Thanks!

@bleskes
Copy link
Copy Markdown
Contributor

bleskes commented Nov 30, 2015

Nice one @ywelsch . Left some minor comments.

@ywelsch
Copy link
Copy Markdown
Contributor Author

ywelsch commented Nov 30, 2015

@bleskes Another set of changes:

  • Reworked DiffableTests so that it now parameterizes over the following:
    • map implementation type (JDK Map, ImmutableOpenMap, ImmutableOpenIntMap)
    • map value type (Diffable or non-diffable)
    • specific values that are added / removed. We now compare randomly-generated sets.
  • Moved value extraction from IndexMetaData constructor to its builder
  • supportsDiffableValues() is now applied after equals check
  • removed unnecessary builder methods

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

DiffablePrototypeValueReader -> DiffablePrototypeValue_Serializer_ for consistency

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The prototype is only used for the "reading" part, hence the name.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah, got it- just found it confusing.

@bleskes
Copy link
Copy Markdown
Contributor

bleskes commented Dec 1, 2015

LGTM. Left some minor suggestions (first on the commit - sorry for the noise). I would love it if @s1monw or @imotov will also look at the changes to the diff infra as the were involved in it as well.

@ywelsch
Copy link
Copy Markdown
Contributor Author

ywelsch commented Dec 1, 2015

pushed minor changes to address @bleskes's suggestions

  • check correctness of diffmap
  • randomize serialization

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we have some javadocs what that is?

@s1monw
Copy link
Copy Markdown
Contributor

s1monw commented Dec 2, 2015

I will look again this afternoon... sorry for the delay

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think write and read would be enough as method names? the Diff & To part is implicit from the args?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Makes sense to throw the To and From part away. I want to keep writeDiff and readDiff though. For readDiff, it's necessary as it has the same method signature as read (except return type). To keep things symmetric for write and make it more verbose in the code of the MapDiff implementation, I'll use writeDiff.

@s1monw
Copy link
Copy Markdown
Contributor

s1monw commented Dec 2, 2015

i left some cosmetic comments LGTM in general

@ywelsch ywelsch force-pushed the feature/persist-allocid-indexmetadata branch from 7aab1a5 to 601a119 Compare December 3, 2015 09:30
@s1monw
Copy link
Copy Markdown
Contributor

s1monw commented Dec 4, 2015

LGTM

Yannick Welsch added 2 commits December 4, 2015 11:24
- Supports ImmutableOpenIntMap besides java.util.Map and ImmutableOpenMap
- Map keys can be any value (not only String)
- Map values do not have to implement Diffable interface. In that case custom value serializer needs to be provided.
@ywelsch ywelsch force-pushed the feature/persist-allocid-indexmetadata branch from 601a119 to fef043a Compare December 4, 2015 10:32
ywelsch pushed a commit that referenced this pull request Dec 4, 2015
…etadata

Persist currently started allocation IDs to index metadata
@ywelsch ywelsch merged commit 0c2c7e7 into elastic:master Dec 4, 2015
@lcawl lcawl added :Distributed/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. and removed :Allocation labels Feb 13, 2018
@clintongormley clintongormley added :Distributed/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) and removed :Distributed/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) >enhancement v5.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants