Bug 26130 - Inconsistent nscd cache during pruning
Summary: Inconsistent nscd cache during pruning
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: nscd (show other bugs)
Version: 2.22
: P2 normal
Target Milestone: 2.33
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-17 14:01 UTC by Andreas Schwab
Modified: 2023-08-28 06:42 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
getent.c (372 bytes, text/plain)
2020-06-22 08:56 UTC, Andreas Schwab
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schwab 2020-06-17 14:01:43 UTC
During cache pruning the nscd cache is temparily inconsistent which is visible to clients that read a shared cache.
Comment 1 Andreas Schwab 2020-06-22 08:56:20 UTC
Created attachment 12633 [details]
getent.c

Run this in separate shells:

S1# while :; do touch /etc/group; done
S2# ./getent root
S3# ./getent wheel
Comment 2 Andreas Schwab 2020-09-17 16:01:52 UTC
Fixed in 2.33.
Comment 3 Florian Weimer 2023-08-28 06:42:41 UTC
commit 5e74e6f85842892bc25da8e8c70d8dadd485941a
Author: Andreas Schwab <schwab@suse.de>
Date:   Wed Jun 17 16:05:13 2020 +0200

    nscd: bump GC cycle during cache pruning (bug 26130)
    
    While nscd prunes a cache it becomes inconsistent temporarily, which is
    visible to clients if that cache is shared.  Bump the GC cycle counter so
    that the clients notice the modification window.
    
    Uniformly use atomic_fetch_add to modify the GC cycle counter.