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

FlakeIdGenerator advanced configuration #16278

Merged
merged 38 commits into from Jan 7, 2020
Merged

FlakeIdGenerator advanced configuration #16278

merged 38 commits into from Jan 7, 2020

Conversation

lukasherman
Copy link
Contributor

@lukasherman lukasherman commented Dec 17, 2019

Externalizes currently hardcoded id generator properties.
Rationale:
With the upcoming User Defined Services SPI removal it will be no longer possible to implement custom FlakeIdGenerator implementation. This PR addresses shortcomings of the current implementation.

Fixes #14150

@lukasherman lukasherman requested a review from a team as a code owner December 17, 2019 12:13
@devOpsHazelcast
Copy link
Collaborator

Can one of the admins verify this patch?

@mmedenjak
Copy link
Contributor

run-lab-run

@mmedenjak
Copy link
Contributor

Hi @lukasherman !

Thank you for your contribution.
Before we can merge, can you please follow the instructions to sign and send the Hazelcast Contributor Agreement?

@mmedenjak mmedenjak added this to the 4.0 milestone Dec 18, 2019
@sancar sancar self-requested a review December 26, 2019 12:27
lukasherman added a commit to lukasherman/hazelcast-client-protocol that referenced this pull request Dec 30, 2019
Copy link
Contributor Author

@lukasherman lukasherman left a comment

Choose a reason for hiding this comment

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

bitsTimestamp is now calculated field to fill in all remaining bits up to 63. Resulting max value mask is moved out of the generator code.

@sancar
Copy link
Contributor

sancar commented Jan 2, 2020

@lukasherman Sorry for inconvenience,there is conflict related to generated files since another pr has changed the protocol, you are gonna need to rebase both pr's and regenerate the codecs.

pveentjer and others added 11 commits January 2, 2020 13:53
Only when more than 8 cpu's are detected a smart client will
get 3+3 io threads. This will prevent performance regressions
on smaller boxes.
…roperties:

- epochStart
- bitsTimestamp
- bitsSequence
- bitsNodeId
- allowedFutureMillis

Fixes #14150
added sanity checks
removed no longer valid out of range check
added unit test for custom configuration
removed idOffset and bitsTimestamp fields from configuration
regenerated client protocol interfaces
…t-threadcount-for-fast-boxes

IO threadcount for smart client only when enough cpu's
@mmedenjak
Copy link
Contributor

run-lab-run

sancar and others added 5 commits January 6, 2020 12:33
After client has authenticated, we were sending
IsFailoverSupportedMessageTask (when newHazelcastFailoverClient is used)
to query if members have the support.

In this pr, we put this info to Authentication response
to avoid second step.

This was a different message task for backward compatibility reasons.
When client has connected to a member that feature is not available yet,
we wanted to get exception. Since there is no old server anymore,
a second message task is not needed.

related protocol change hazelcast/hazelcast-client-protocol#288
fixes #16336
It could happen that this connection is already closed and onConnectionClose()
is called even before the authentication handling logic is executed. In this
case, now we have a closed but registered connection in the client connection
manager. We do a final check to remove this connection if needed.

This check was already here before and removed with 3d897c2 because of wrong
reasoning.

Fixes #16288
Handle closed client connection after registration
@mmedenjak
Copy link
Contributor

@lukasherman sorry, the client protocol changed again. Can you rebase hazelcast/hazelcast-client-protocol#281 and regenerate classes for this PR?

lukasherman and others added 11 commits January 6, 2020 18:08
…roperties:

- epochStart
- bitsTimestamp
- bitsSequence
- bitsNodeId
- allowedFutureMillis

Fixes #14150
added sanity checks
removed no longer valid out of range check
added unit test for custom configuration
removed idOffset and bitsTimestamp fields from configuration
regenerated client protocol interfaces
@mmedenjak
Copy link
Contributor

run-lab-run

@mmedenjak mmedenjak merged commit 7119690 into hazelcast:master Jan 7, 2020
@mmedenjak
Copy link
Contributor

Merged, thank you for the contribution @lukasherman and the reviews everyone!

mdumandag pushed a commit to hazelcast/hazelcast-client-protocol that referenced this pull request Jan 7, 2020
* FlakeIdGeneratorConfig extensions
Core PR: hazelcast/hazelcast#16278

* Removed idOffset and bitsTimestamp fields from addFlakeIdGeneratorConfig
Core PR: hazelcast/hazelcast#16278

* Add hot restart ops definitions for MC client

* Add triggerPartitionAssingment message

related to hazelcast/hazelcast#16375

* Encode PagingPredicate into protocol and the query response returns anchor list (#274)

* Added the paging predicate to the paging predicate query responses so that the client can update its local anchor entry list.

* Updated the Map `valuesWithPagingPredicate` to return only a list of values data instead of entries.

* Updating the IMap paging predicate query codecs to serialize the PagingPredicate as a custom type and the responses return the updated anchor list.

* Added source field to DistributedObject event. (#284)

* Added `internal` field to DistributedObject request so that the ProxyManager internal registration to the distributed object listener can be differentiated from the user listeners. (#285)

Co-authored-by: Andrey Pechkurov <37772591+puzpuzpuz@users.noreply.github.com>
Co-authored-by: sancar <sancar@hazelcast.com>
Co-authored-by: ihsan demir <ihsan@hazelcast.com>
@viliam-durina
Copy link
Contributor

Summary of breaking changes:

  • the idOffset option removed from the config

@lukasherman lukasherman deleted the flakeidgenerator-advanced-configuration branch January 7, 2020 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FlakeIdGenerator advanced configuration