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

don't use UUID in worker storage. #3360

Closed
wants to merge 3 commits into from

Conversation

awildturtok
Copy link
Collaborator

If possible, use hostname for workerName

If possible, use hostname for workerName
@awildturtok awildturtok requested a review from thoniTUB March 27, 2024 13:53
@awildturtok
Copy link
Collaborator Author

@SebChmie das ist eine sehr softe Implementierung der lesbaren Namen. Ich habe mich beim implementieren selber etwas verfahren und eine deutlich sauberere aber intensivere Lösung geschrieben: #3361 Ich habe aber keine Zeit das durchzuziehen.

…rkers, to handle NonPersistentStorage case for non-unique storage names
Comment on lines +26 to +36

Wait.builder()
.stepTime(Duration.ofMillis(5))
.total(Duration.ofSeconds(10))
.build()
.until(()->getShardNode(context) != null);

.until(() -> getShardNode(context) != null);

ShardNodeInformation node = getShardNode(context);

if(node == null) {
throw new IllegalStateException("Could not find the slave "+context.getRemoteAddress()+" to register worker "+info.getId());
throw new IllegalStateException("Could not find the shard %s to register worker %s".formatted(context.getRemoteAddress(), info.getId()));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ouh wie hat das vorher nur funktioniert?

int entityBucketSize,
ObjectMapper persistenceMapper,
ObjectMapper communicationMapper, int secondaryIdSubPlanLimit) {
public static Worker newWorker(@NonNull Dataset dataset, @NonNull ThreadPoolDefinition queryThreadPoolDefinition, @NonNull ExecutorService jobsExecutorService, @NonNull StoreFactory config, @NonNull String directory, @NonNull Validator validator, boolean failOnError, int entityBucketSize, ObjectMapper persistenceMapper, ObjectMapper communicationMapper, int secondaryIdSubPlanLimit) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Gerne wieder zu einer Liste machen

Comment on lines +108 to +109
//The UUID suffix is necessary for shards running on the same hostname.
return InetAddress.getLocalHost().getHostName() + "#" + uuid;
Copy link
Collaborator

Choose a reason for hiding this comment

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

War die Directory anstatt der UUID nicht ausreichend, die sollte doch den Shard Namen inne haben und somit pro dataset eindeutig sein

dataset2Worker.put(worker.getStorage().getDataset().getId(), worker);
final DatasetId datasetId = worker.getStorage().getDataset().getId();
if (workers.put(datasetId, worker) != null) {
log.warn("Already have a worker for dataset {}: {}", datasetId, worker);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Illegalstate? Oder informieren, dass die referenz überschireben wurde

@awildturtok awildturtok closed this Aug 1, 2024
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.

2 participants