Bug 1459793 - [RFE] IPA GUI sorts reverse DNS alphabetically rather than numerically
[RFE] IPA GUI sorts reverse DNS alphabetically rather than numerically
Status: ASSIGNED
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ipa (Show other bugs)
7.5
Unspecified Linux
unspecified Severity high
: rc
: ---
Assigned To: IPA Maintainers
ipa-qe
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-08 04:13 EDT by mpanaous
Modified: 2018-02-06 15:05 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description mpanaous 2017-06-08 04:13:54 EDT
Description of problem:
PA GUI sorts reverse DNS alphabetically rather than numerically

Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
adding reverse DNS zones in IPA GUI

Actual results:
When looking at reverse DNS zones in IPA GUI, it sorts the IP addresses (numeric) in an alphabetical order, leading to 1, 10, 100... rather than 1, 2, 3, ... 10, 11, ... and so on. This makes no sense. Reverse DNS zones, where the keys are numeric, should be sorted numerically.

Expected results:
to sort the zones in a numerical order 

Additional info:
Comment 2 Martin Bašti 2017-06-08 06:45:57 EDT
There is no guarantee that reverse zone records contains only numbers and PTR records. Reverse zone is just regular zone with special meaning and can contain everything that can contain master zone.

For example how to sort zone delegation records, classless reverse zone delegation?


zone 10.in-addr.arpa.
@           SOA ............
10.10       NS nameserver.subzone.example.com.
0/26.20     NS nameserver.classless.zone.example.com.
1.1.1       PTR host.example.com.
1.128/26.20 PTR host2.example.com.
info        TXT ":-)"

zone 0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
8.5.0.0.4.7.8.5.0.0.0.0.0.0.0.0 PTR host2.example.com.
1.5.0.4.4.7.c.f.0.0.0.0.0.0.0.0 PTR host2.example.com.


Ugly ^^ but possible.


I agree that numerical sort may be handy with usual zones with the only one number (not even case for IPv6 reverse zones) but we have to provide generic sorting that works in all cases and I'm not sure if there is something better than alphabetical sort.


This looks like wontfix for me, I don't think that is worth to create custom sorting for reverse zones (and any custom sort will have performance impact due splitting parts, converting types, etc. count with that zones are usually huge).
Comment 3 Petr Vobornik 2017-06-08 07:34:06 EDT
In addition to "what is the right sorting" question which Martin described, there is also implementation problem.

Web UI currently uses paging. For paging to work correctly, search results needs to be sorted on server side and not on Web UI side. If it would be sorted on WebUI side then it would sort only subset of records of a full list which is sorted by other algorithm. And therefore going to next page would return results from completely different part of the thought "properly sorted list".

So the options are:

1. use Web UI side sorting, but that would confuse users even more - would not behave as expected. Easy to implement.
2. use server side sorting - this is quite complex, must be done in Directory Server and involves special kind of indexes
3. disable paging, let result be limited by search size limit, sort the result on Web UI side. It is relatively doable with consistent results. But definitely not an easy fix.

Given that numerical sorting doesn't work for some situations and the complexity of implementation I don't think it is worth implementing.
Comment 4 Petr Vobornik 2017-06-16 11:22:14 EDT
Upstream ticket:
https://pagure.io/freeipa/issue/7023

Note You need to log in before you can comment on or make changes to this bug.