You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@yunikorn.apache.org by wi...@apache.org on 2023/11/29 04:13:21 UTC

(yunikorn-core) branch master updated: [YUNIKORN-809] Remove deprecated policy inheritance (#737)

This is an automated email from the ASF dual-hosted git repository.

wilfreds pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 84aac672 [YUNIKORN-809] Remove deprecated policy inheritance (#737)
84aac672 is described below

commit 84aac6726c7f4f6d5dd57b4fc96a2d4ddbeba704
Author: Kuan-Po Tseng <br...@gmail.com>
AuthorDate: Wed Nov 29 15:10:02 2023 +1100

    [YUNIKORN-809] Remove deprecated policy inheritance (#737)
    
    Remove deprecated behaviour that dynamic queues can inherit
    application.sort.policy from their parent via properties.
    
    The child template should be used for this.
    
    Closes: #737
    
    Signed-off-by: Wilfred Spiegelenburg <wi...@apache.org>
---
 pkg/scheduler/objects/queue.go      | 12 +-----------
 pkg/scheduler/objects/queue_test.go |  9 ---------
 2 files changed, 1 insertion(+), 20 deletions(-)

diff --git a/pkg/scheduler/objects/queue.go b/pkg/scheduler/objects/queue.go
index afe9fad6..de02b35f 100644
--- a/pkg/scheduler/objects/queue.go
+++ b/pkg/scheduler/objects/queue.go
@@ -919,23 +919,13 @@ func (sq *Queue) addChildQueue(child *Queue) error {
 		if child.isManaged {
 			return nil
 		}
-		// this is a story about compatibility. the template is a new feature, and we want to keep old behavior.
-		// 1) try to use template if it is not nil
-		// 2) otherwise, child leaf copy the configs.ApplicationSortPolicy from parent (old behavior)
+		// try to use template if it is not nil
 		if sq.template != nil {
 			log.Log(log.SchedQueue).Debug("applying child template to new leaf queue",
 				zap.String("child queue", child.QueuePath),
 				zap.String("parent queue", sq.QueuePath),
 				zap.Any("template", sq.template))
 			child.applyTemplate(sq.template)
-		} else {
-			policyValue, ok := sq.properties[configs.ApplicationSortPolicy]
-			if ok {
-				log.Log(log.Deprecation).Warn("inheriting application sort policy is deprecated, use child templates",
-					zap.String("child queue", child.QueuePath),
-					zap.String("parent queue", sq.QueuePath))
-				child.properties[configs.ApplicationSortPolicy] = policyValue
-			}
 		}
 		return nil
 	}
diff --git a/pkg/scheduler/objects/queue_test.go b/pkg/scheduler/objects/queue_test.go
index 5d390db3..6044005f 100644
--- a/pkg/scheduler/objects/queue_test.go
+++ b/pkg/scheduler/objects/queue_test.go
@@ -1524,15 +1524,6 @@ func TestQueueProps(t *testing.T) {
 	assert.Assert(t, leaf.isLeaf && leaf.isManaged, "leaf queue is not marked as managed leaf")
 	assert.Equal(t, len(leaf.properties), 2, "leaf queue properties size incorrect")
 
-	props = map[string]string{"first": "not inherited", configs.ApplicationSortPolicy: "stateaware"}
-	parent, err = createManagedQueueWithProps(root, "parent2", true, nil, props)
-	assert.NilError(t, err, "failed to create parent queue")
-	assert.Equal(t, len(parent.properties), 2, "parent queue properties size incorrect")
-	leaf, err = createDynamicQueue(parent, "leaf", false)
-	assert.NilError(t, err, "failed to create leaf queue")
-	assert.Assert(t, leaf.isLeaf && !leaf.isManaged, "leaf queue is not marked as unmanaged leaf")
-	assert.Equal(t, leaf.properties[configs.ApplicationSortPolicy], "stateaware", "leaf queue property value not as expected")
-
 	props = map[string]string{}
 	leaf, err = createManagedQueueWithProps(parent, "leaf", false, nil, props)
 	assert.NilError(t, err, "failed to create leaf queue")


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: issues-help@yunikorn.apache.org