Coder Social home page Coder Social logo

File sizes about ddlfs HOT 4 CLOSED

pioro avatar pioro commented on July 19, 2024
File sizes

from ddlfs.

Comments (4)

pioro avatar pioro commented on July 19, 2024

I found a bit strange behaviour, I restarted it with -f and LOGLEVEL=DEBUG

now is working fine ;)

[oracle@linuxsource ~]$ ls -l /home/oracle/test121/plsql/PIORO/PROCEDURE/
total 0
-rw-r--r--. 1 oracle oinstall 88 Jan 10 06:58 TEST.SQL

from ddlfs.

usrecnik avatar usrecnik commented on July 19, 2024

Hi,

The behaviour described is expected, although it may seem strange at first. It depends on filesize mount option.

All uncached files will report filesize of n bytes, where n is the value of filesize mount option.
Files are put into cache whenever they are opened. Except if you specify filesize=-1 - in this case files are put into cache not only on open() but also whenever they are listed (using ls for instance).

"cache" that I'm describing is actually just a regular folder on physical filesystem (such as ext4), specified by temppath mount option. You can issue ls in that cached folder to see cache contents.

In release 1.0, the cached file was deleted on close(). This is changed if you compile from latest source so that cache is deleted on umount. Features mentioned from this point on are available in latest source, but not in release 1.0:

That means, if you specify filesize >= 0, it will report:

  • correct file size for all files that were opened since mount.
  • incorrent (value of filesize) for files that were never opened since mount.

Contents of temppath can be reused after umount. Actualy, specifying (currently undocumented) keepcache mountoption will not delete contents of cache directory.

This is important, becase, as mentioned, git only works if filesystem provides (strictly) correct filesizes.
So, specifying filesize=-1 will make git work as well =)

This, however, has terrible effect on peformance if the cache is empty. But, once every .sql file is cached it is as fast as specifying filesize=0. This basically means that if you use crontab script which does git commit once a day or so, it will be ok (except for the first commit). In such scenario I would recommend setting filesize=-1,keepcache.

In the other case, if you wish to work with .SQL files interactively (like using VIM etc), I wold recommend to use filesize=0 (without keepcache).

When is the cached version invalidated?
For every cached .SQL file ddlfs also stores last_ddl_time of that object as it was when it was cached. On every file open and file listing, the last_ddl_time from dba_objects is compared to that written in cache. If it is not the same, cached version is updated (source is downloaded from database).

I would be happy to look into the issue if you find behaviour inconsistent with what I just wrote. Also, any ideas for improvement are appreciated - especially if they come in the form of code/patches :)

p.s. I'm a bit busy currently, but i do intend to put more effort in this project once I lower my backlog in "commercial" work :)

from ddlfs.

usrecnik avatar usrecnik commented on July 19, 2024

I'm still not sure what would be a better default for next release, filesize=-1,keepcache to make most software work or filesize=0,nokeepcache which is cleaner, faster and makes a lot of software (but not git) work :)

from ddlfs.

usrecnik avatar usrecnik commented on July 19, 2024

this was a bug - filesizes were always reported correctly, even when filesize parameter was not set to -1.

this was fixed in today's commit.

from ddlfs.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.