Bug 1284067

Summary: Data Tiering:Don't allow or reset the frequency threshold values to zero when record counter features.record-counter is turned off
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Nag Pavan Chilakam <nchilaka>
Component: tierAssignee: Joseph Elwin Fernandes <josferna>
Status: CLOSED DUPLICATE QA Contact: Nag Pavan Chilakam <nchilaka>
Severity: urgent Docs Contact:
Priority: urgent    
Version: rhgs-3.1CC: rcyriac, rhs-bugs, sankarshan, storage-qa-internal, vagarwal
Target Milestone: ---Keywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1286346 (view as bug list) Environment:
Last Closed: 2015-12-03 14:44:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1286346, 1287560    

Description Nag Pavan Chilakam 2015-11-20 17:23:33 UTC
Description of problem:
========================
When a user turns on record counter and changes the write and read freq to some value of his desire, say 3. It means the files will not be migrated until that many times file is accessed.

But now for some reason, if the user turns of the features.record-counter , then there will not be any more promotes/demotes as the db will not be recording the counts and as the threshold will never be hit, the promotes/demotes will never happen


Version-Release number of selected component (if applicable):
=========================================================
glusterfs-server-3.7.5-6.el7rhgs.x86_64

How reproducible:
====================
easily


Steps to Reproduce:
==================
1.create a tier setup
2.turn on features.record-counter 
3.now set the thresholds to some value(which by default are zero) say 3 as below:
cluster.write-freq-threshold: 3
cluster.read-freq-threshold: 3
hence files which are not read/written 3 times in a cycle will not be promoted and files read more than that will not be demoted.
4. Now turn off record-counter(this means the db will stop increasing the db tickers.

Actual results:
===================
Now this means, files will not be promoted/demoted till threshold is hit, but db would not be recording the counts, hence a file will never be migrated

Solution:
========
turn the theshold values to zero when counter is off.
Else, throw a warning to change the threshold values, while the user tries to turn off the counter

Comment 2 Nag Pavan Chilakam 2015-11-23 09:29:31 UTC
Possible Workaround be to document the limitation and suggest the user to change the threshold values whenever counter is turned off

Comment 3 Joseph Elwin Fernandes 2015-11-28 11:51:35 UTC
(In reply to nchilaka from comment #2)
> Possible Workaround be to document the limitation and suggest the user to
> change the threshold values whenever counter is turned off

upstream patch http://review.gluster.org/#/c/12780

1) if record-counters is set to off
   check if both the frequency thresholds are non-zero, then pop
   an error message, with volume set failed.
2) if record-counters is set to on
   check if both the frequency thresholds are zero, then pop
   an note, but volume set is not failed.
3) If any of the frequency thresholds are set to a non-zero value,
   switch record-counters on, if not already on
4) If both the frequency thresholds are set to zero,
   switch record-counters off, if not already off

Comment 4 Joseph Elwin Fernandes 2015-12-02 15:09:00 UTC
Fixed in https://code.engineering.redhat.com/gerrit/#/c/62812/