but new list not reloaded (2019-02-06) GC a busy repository in Gerrit ➨ Packfile marked corrupt and removed from pack list ➨ MissingObjectExceptions Requires node restart (2-3 times a day)
change checksum (same list of objects) if pack options are different than in original pack ➨ JGit didn‘t detect file modification but different checksum ➨ pack marked corrupt removed from in-memory packlist ➨ missing objects
inode (Unix) 3. lastModified 4. for pack files: checksum Instead of millis (long) use Instant, FileTime ➨ use higher timestamp resolution on modern filesystems
Java) + file timestamp resolution (seen from Java): ➨ timestampResolution • test minimal time interval lastModified can distinguish: ➨ minRacyInterval Store in ~/.gitconfig (5.1.9 - 5.5.1) XDG_CONFIG_HOME/jgit/config (> 5.5.1)
3,6 - 6,6 ms 1.8.0_212 ext4 Linux 3 ms 1,1 - 4,1 ms 1.8.0_212 xfs Linux 4 ms 3,7 - 3,9 ms 1.8.0_212 zfs Linux 3 ms 4,8 - 5,0 ms 11.0.3+7 btrfs Linux 3 us 0,7 - 4,7 ms 11.0.3+7 ext4 Linux 6 us 0,7 - 4,7 ms 11.0.3+7 xfs Linux 7 us 0,1 - 8,0 ms 11.0.3+7 zfs Linux 7 us 0,7 - 5,2 ms 1.8.0_212 APFS (SSD) Mac 1 s 0 11.0.3+7 APFS (SSD) Mac 6 us 0 Results
8 (Mac): 14:55:06.000000000 Java 8, 9 (Linux): 14:55:06.820000000 Java < 14: 14:55:06.820859000 Java 14 (Windows) 14:55:06.820859000 Java 14 (Posix) 14:55:06.820859430 when git index had entries from git and jgit this caused wrong git status of modified files ➨ truncate all timestamps if trailing 000 found
ref for an update" Newly added refs stopped being visible Lock failure in Gerrit IT test Looked like another case of racy JGit • PackedBatchRefUpdate created unsorted packed-refs • Higher resolution timestamp handling helped hitting this Fixed by Han-Wen J (2019-09-03)
lose data, section Timestamp semantics and granularity https://www.nayuki.io/page/subtle-ways-to-lose-data • Java: http://stas-blogspot.blogspot.com/2012/02/what-is-behind- systemnanotime.html https://web.archive.org/web/20160308031939/https://blogs.oracle.com/dholmes/entry/inside_the_hotspot_ vm_clockshttps://shipilev.net/blog/2014/nanotrusting-nanotime/ https://blog.packagecloud.io/eng/2017/03/14/using-strace-to- understand-java-performance-improvement/ https://pzemtsov.github.io/2017/07/23/the-slow-currenttimemillis.html • TIMERMETER: Quantifying Properties of Software Timers for System Analysis (2009) Uni Karlsruhe https://sdqweb.ipd.kit.edu/publications/pdfs/kuperberg2009c.pdf source code in https://github.com/akara/faban https://github.com/akara/faban/tree/master/driver/src/com/sun/faban/driver/util/timermeter • Metric-based Selection of Timer Methods for Accurate Measurements https://sdqweb.ipd.kit.edu/publications/pdfs/kuperberg2011 • Linux (2006): https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6458294 Redhat on Linux clocks: https://access.redhat.com/documentation/en- US/Red_Hat_Enterprise_MRG/2/html/Realtime_Reference_Guide/chap-Timestamping.html • timestamp accuracy on EXT4 (sub millsecond) (2013) https://stackoverflow.com/questions/14392975/timestamp-accuracy-on-ext4- sub-millsecond • mtime comparison considered harmful (2018) https://apenwarr.ca/log/20181113 also see this discussion of this blog on ycombinator https://news.ycombinator.com/item?id=18473744 • Windows: https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6440250