Questions tagged [wal]

WAL, or write-ahead log, is a form of journalling used as part of crash-safety and atomic commit support in databases like PostgreSQL and SQLite.

PostgreSQL's write-ahead log is a crucial feature that permits crash-safety and atomic commit to be implemented. It's also heavily used in PostgreSQL's point-in-time recovery, streaming replication, and archive based replication features, as well as hot physical backup.

In SQLite, the default method by which SQLite implements atomic commit and rollback is a rollback journal. Beginning with version 3.7.0, a new "Write-Ahead Log" option (hereafter referred to as "WAL") is available.

229 questions
5
votes
2 answers

ios7 sqlite database with WAL never syncs the main database file

I've read many threads about the new WAL default setting in ios7 SQLite / Core Data stack. It looked like a good idea in the first place... Though I need to perform a database copy to a distant webservice from time to time according to my business…
vivien.destpern
  • 1,020
  • 1
  • 7
  • 14
4
votes
1 answer

Are transactions logged to WAL if there is no change in PostgreSQL?

I'm trying to find out whether changes are reflected on the WAL (write ahead log) files if there is no change to a row. To test it, I create a replication slot in PostgreSQL to capture changes. Here are the steps I've taken. ALTER SYSTEM SET…
4
votes
1 answer

Replication lag - exceeding max_slot_wal_keep_size, WAL segments not removed

Summary We are using max_slot_wal_keep_size from Postgresql 13 to prevent master from being killed by a lagging replication. It seems, that in our case, WAL storage wasn't freed up after exceeding this parameter which resulted in a replication…
Marcin Krupowicz
  • 536
  • 6
  • 16
4
votes
1 answer

How does write ahead logging improve IO performance in Postgres?

I've been reading through the WAL chapter of the Postgres manual and was confused by a portion of the chapter: Using WAL results in a significantly reduced number of disk writes, because only the log file needs to be flushed to disk to guarantee…
RangerRanger
  • 2,455
  • 2
  • 16
  • 36
4
votes
1 answer

Disabling WAL archiving during pg_restore?

Let's say I made a quick backup dump of my Postgres 9.3 DB through pg_dump before doing a large destructive migration and I discovered I want to undo it. No writes were performed against the DB in the meantime. Say I run pg_restore -c -d mydb <…
Alexandr Kurilin
  • 7,685
  • 6
  • 48
  • 76
4
votes
3 answers

Consequences of -wal file disappearing in SQLite?

If a SQLite database using write-ahead logging is interrupted with un-checkpointed transactions (due to a power failure or whatever), then reopened with the temporary -wal file missing, will the database open cleanly to its state as of the last…
Ertebolle
  • 2,322
  • 2
  • 18
  • 22
3
votes
1 answer

Difference between incremental backup and WAL archiving with PgBackRest

As far as I understood WAL archiving is pushing the WAL logs to a storage place as the WAL files are generated Incremental backup is pushing all the WAL files created since the last backup So, assuming my WAL archiving is setup correctly Why…
Patanouk
  • 111
  • 8
3
votes
0 answers

Journal/write-ahead-log technology for Java

We're building a Java based application that makes use of a journal/write-ahead-log (WAL). The idea is that every message that enters the system is first written into the journal before any processing. The journal acts as a single source of truth…
David Siro
  • 1,826
  • 14
  • 33
3
votes
1 answer

SQLite WAL with the C# Entity Framework

For some reason my hosting only seems to work updating my SQLite database when it is set in WAL mode. So using "DB Browser for SQLite" I edited the Pragma Journal Mode to WAL and everything seems to work. My database is now 1Mb but the accompanying…
Richard Whitehouse
  • 679
  • 3
  • 14
  • 28
3
votes
0 answers

How to build and install wal2json without also installing the package postgresql-server-dev on Debian 9?

I'm trying to stream data automatically from PostgreSQL 10 to Kafka using debezium together with the logical decoding plugin, wal2json. I followed all the instructions on how to build and install the plugin from this link by running these command…
Prince Vegeta
  • 719
  • 6
  • 21
3
votes
2 answers

Is log sequence number really monotonic in postgres?

When reading at postgreSQL documentation: WAL records are appended to the WAL logs as each new record is written. The insert position is described by a Log Sequence Number (LSN) that is a byte offset into the logs, increasing monotonically with…
Artholl
  • 83
  • 1
  • 13
3
votes
1 answer

SQLite 3 WAL mode multiple processes frequently corrupting database

I am using SQLite 3 in WAL mode compiled with these flags: #define SQLITE_ENABLE_FTS3 1 #define SQLITE_THREADSAFE 2 #define SQLITE_DEFAULT_MEMSTATUS 0 #define SQLITE_ENABLE_STAT4 1 #define SQLITE_MAX_MMAP_SIZE 0 #define SQLITE_OMIT_DEPRECATED…
strangetimes
  • 4,953
  • 1
  • 34
  • 62
3
votes
5 answers

Concurrency in SQLite database

How to achieve concurrency in SQLite database? As per documents it is possible using WAL(Write-Ahead Logging).But, I dont know how to implement it. In my app I want to read data from db on main thread and at the same time a background thread is…
Poras Bhardwaj
  • 1,073
  • 1
  • 15
  • 33
3
votes
1 answer

separate the Postgres WAL by schema?

I can't seem to find anything related to what I am trying to do. Is it possible to separate the Postgres WAL files by schema?
3
votes
2 answers

How to save the content of a MOC to a file, with no -wal and no -shm?

I want to save the content of a MOC to a file myFile.ext. Everything works well, my data is saved to the file BUT I have to auxiliary files in addition: myFile.ext-wal myFile.ext-shm Are these files necessary for my purpose (saving the content of…
Colas
  • 3,473
  • 4
  • 29
  • 68
1
2
3
15 16