[
https://issues.apache.org/jira/browse/AURORA-137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15678964#comment-15678964
]
Stephan Erb commented on AURORA-137:
------------------------------------
Thinking about it, this might not even be necessary:
* {{offerManager.addOffer}} is thread-safe. It is not necessary to place it in
a write section. We just have to make sure it is only called once the
attributes have been handled.
* The call to
{{storeProvider.getAttributeStore().saveHostAttributes(attributes)}} will most
certainly only update attributes in very few cases as attributes are not
dynamic. We could therefore adopt some form of double-checked locking as you
have proposed in the other ticket.
> Save host attributes only when a task is being scheduled
> --------------------------------------------------------
>
> Key: AURORA-137
> URL: https://issues.apache.org/jira/browse/AURORA-137
> Project: Aurora
> Issue Type: Story
> Components: Scheduler
> Reporter: Bill Farner
> Priority: Minor
>
> The scheduler currently aggressively saves host attributes when handling
> {{resourceOffers}}, however it seems tractable for this to only happen when a
> task is actually scheduled. Context: the scheduler stores host attributes to
> satisfy scheduling constraints (like host/rack diversity). Doing this would
> allow us to avoid waiting for the storage write lock, and handle
> {{resourceOffers}} in a more deterministic time frame.
> One caveat with this approach is that the Offer would need to be plumbed into
> {{SchedulingFilterImpl}} in a way so as to ensure that the attributes are
> available for the offer being inspected. In other words, we need to avoid
> the chicken and egg of trying to read the attributes for a host when this is
> the first offer ever received for it.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)