Bug 987455

Summary: Changelog - volume set encoding ascii still creates changelogs in binary format
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: M S Vishwanath Bhat <vbhat>
Component: geo-replicationAssignee: Venky Shankar <vshankar>
Status: CLOSED NOTABUG QA Contact: Sudhir D <sdharane>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.1CC: aavati, csaba, mzywusko, rhs-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-24 05:13:05 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:

Description M S Vishwanath Bhat 2013-07-23 12:14:32 UTC
Description of problem:
volume set encoding ascii still creates the  changelogs in the binary format.

Version-Release number of selected component (if applicable):
[root@mustang ~]# rpm -q glusterfs
glusterfs-3.4.0.12rhs.beta5-2.el6rhs.x86_64


How reproducible:
Always

Steps to Reproduce:
1. Create and start a volume 'hosdu'
2. gluster v set hosdu chanagelog-enabled on
3. gluster v set hosdu encoding ascii

Actual results:

[root@mustang ~]# gluster v i
 
Volume Name: hosa-master
Type: Distributed-Replicate
Volume ID: f1b5ef32-ad22-4985-8778-083c876bc394
Status: Started
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: spitfire:/rhs/bricks/brick1
Brick2: mustang:/rhs/bricks/brick2
Brick3: harrier:/rhs/bricks/brick3
Brick4: typhoon:/rhs/bricks/brick4
Options Reconfigured:
changelog.rollover-time: 20
changelog.encoding: ascii
diagnostics.latency-measurement: on
diagnostics.count-fop-hits: on
geo-replication.indexing: on



The changelog files created are still binary format

[root@mustang ~]# file /rhs/bricks/brick2/.glusterfs/changelogs/CHANGELOG
/rhs/bricks/brick2/.glusterfs/changelogs/CHANGELOG: data


[root@mustang ~]# less /rhs/bricks/brick2/.glusterfs/changelogs/CHANGELOG
"/rhs/bricks/brick2/.glusterfs/changelogs/CHANGELOG" may be a binary file.  See it anyway?

If I choose 'yes' to the above question, garbage will be printed on my screen.

Expected results:
changelog should be logged in ascii format when set via CLI.

Additional info:

Comment 2 M S Vishwanath Bhat 2013-07-23 12:19:14 UTC
The peculiarity here is, when there is no IO happening on the mount, the changelog generated will be empty. And in that case the format it ASCII

[root@mustang ~]# file /rhs/bricks/brick2/.glusterfs/changelogs/CHANGELOG
/rhs/bricks/brick2/.glusterfs/changelogs/CHANGELOG: ASCII text
[root@mustang ~]# cat /rhs/bricks/brick2/.glusterfs/changelogs/CHANGELOG
GlusterFS Changelog | version: v1.0 | encoding : 2


But whenever there is IO happening and there is actual data entry in the chaneglog, the format is binary.

Comment 3 Venky Shankar 2013-07-24 05:13:05 UTC
It's an ASCII changelog because of the content viz. GFID and other records which are persisted in it's canonical form. The records themselves are separated with '\0' (which could be why you are prompted while cat'ing it).

When the changelog is empty, there are no records and there is no prompt during viewing it.