Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When killing a virtual machine, sql_logs/sql/log is empty #3928

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

When killing a virtual machine, sql_logs/sql/log is empty #3928

monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working GDK Kernel major

Comments

@monetdb-team
Copy link

Date: 2016-02-19 09:35:06 +0100
From: anthonin.bonnefoy
To: GDK devs <>
Version: 11.21.5 (Jul2015)

Last updated: 2016-03-25 09:59:09 +0100

Comment 21805

Date: 2016-02-19 09:35:06 +0100
From: anthonin.bonnefoy

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0 Iceweasel/45.0
Build Identifier:

As summary says, when a virtual machine is killed, sql_logs/sql/log is empty on reboot.

The file is closed using fclose, that does not ensure the flush of kernel buffers.
In gdk_logger.c, adding the following lines seems to do the trick.

                     logger_fatal("logger_new: writing log file %s failed",
                                  filename, 0, 0);
             }
  •           if (fsync(fileno(fp)) < 0) {
    
  •                   unlink(filename);
    
  •                   logger_fatal("logger_new: Fsync %s failed",
    
  •                                filename, 0, 0);
    
  •           }
              if (fclose(fp) < 0) {
                      unlink(filename);
                      logger_fatal("logger_new: closing log file %s failed",
    

Reproducible: Always

Steps to Reproduce:

  1. Start a virtual machine (i used qemu)
  2. Create and start a dabase on it
  3. Kill the virtual machine (just a CTRL-C is enough)

Actual Results:

On reboot, sql_logs/sql/log is empty

Comment 21806

Date: 2016-02-19 10:18:46 +0100
From: MonetDB Mercurial Repository <>

Changeset 0074383d6391 made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=0074383d6391

Changeset description:

Make sure important data is on disk.
This fixes bug #3928.

Comment 21807

Date: 2016-02-19 10:20:41 +0100
From: @sjoerdmullender

I fixed this by indeed calling fsync (or fdatasync or _commit, depending on availability of system calls), but before doing that, we need to call fflush, or else the fsync still won't do anything.

Comment 21955

Date: 2016-03-25 09:59:09 +0100
From: @sjoerdmullender

Jul2015-SP3 has been released.

@monetdb-team monetdb-team added bug Something isn't working GDK Kernel major labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GDK Kernel major
Projects
None yet
Development

No branches or pull requests

2 participants