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

[Flex Counters] Reset flex counters delay flag on config DB when enable_counters script is called #8500

Merged
merged 6 commits into from
Sep 2, 2021
Merged

[Flex Counters] Reset flex counters delay flag on config DB when enable_counters script is called #8500

merged 6 commits into from
Sep 2, 2021

Conversation

shlomibitton
Copy link
Contributor

@shlomibitton shlomibitton commented Aug 17, 2021

Signed-off-by: Shlomi Bitton [email protected]

Why I did it

Reset flex counters delay flag on config DB when enable_counters script is called to allow enablement of flex counters in orchagent.

How I did it

Push to config DB 'false' value for delay indication when enable_counters script is called before enabling the counters.

How to verify it

Observe counters are created when enable_counters script is called.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

Shlomi Bitton and others added 3 commits August 17, 2021 11:10
…alled

This is to delay the flex counters even if the flex counters tables are present in the config DB json file.

Signed-off-by: Shlomi Bitton <[email protected]>
@liat-grozovik
Copy link
Collaborator

@shlomibitton should we set label to 202106?
@vaibhavhd can you please help to review?

@shlomibitton
Copy link
Contributor Author

@shlomibitton should we set label to 202106?
@vaibhavhd can you please help to review?

@liat-grozovik Yes we should, thanks.

@@ -17,6 +17,9 @@ def enable_counter_group(db, name):
info = {}
info['FLEX_COUNTER_STATUS'] = 'enable'
db.mod_entry("FLEX_COUNTER_TABLE", name, info)
else:
entry_info.update({"FLEX_COUNTER_DELAY_STATUS":"false"})
db.mod_entry("FLEX_COUNTER_TABLE", name, entry_info)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the disabling of delay status happen regardless of entry_info exists or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no reason too, if the entry not exist on the DB so we push it without the delay indicator and orchagent will start the flow normally.
Please check:
https://github.com/Azure/sonic-swss/blob/0febef7d167bc7ef77bf1c8b03ee91b88cb3e213/orchagent/flexcounterorch.cpp#L89

@@ -23,6 +23,13 @@ module sonic-flex_counter {
}
}

typedef flex_delay_status {
type enumeration {
enum true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is enumeration used instead of using type boolean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no special reason for it, changed to boolean

Comment on lines 26 to 31
typedef flex_delay_status {
type boolean {
boolean true;
boolean false;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think just type boolean should be enough. Can you confirm?

Suggested change
typedef flex_delay_status {
type boolean {
boolean true;
boolean false;
}
}
typedef flex_delay_status {
type boolean;
}

@liat-grozovik
Copy link
Collaborator

@vaibhavhd can you please sign-off?

@qiluo-msft qiluo-msft merged commit 112fda7 into sonic-net:master Sep 2, 2021
judyjoseph pushed a commit that referenced this pull request Sep 2, 2021
…le_counters script is called (#8500)

#### Why I did it
Reset flex counters delay flag on config DB when enable_counters script is called to allow enablement of flex counters in orchagent.

#### How I did it
Push to config DB 'false' value for delay indication when enable_counters script is called before enabling the counters.

#### How to verify it
Observe counters are created when enable_counters script is called.
@shlomibitton shlomibitton deleted the shlomi_new_fast_reboot_indication_master branch September 5, 2021 08:19
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.

5 participants