]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/testing/fileid64.patch
ebl Add fix to avoid to expect the EndJob message with some
[bacula/bacula] / bacula / patches / testing / fileid64.patch
1 This patch change the FileId type from 32 to 64 bits. The 2.4.x (and previous) default type
2 don't permit to backup more than 2^32 files. (~ 4,000,000,000 files)
3
4 You will have to upgrade the catalog. It will take x2 space, so be sure to check your available
5 space before.
6
7   cd <bacula-source>
8   patch -p0 < patches/testing/fileid64.patch
9   ./configure <your options>
10   make
11   ...
12   make install
13
14   ./src/cats/update_bacula_tables
15
16 Index: src/cats/update_postgresql_tables.in
17 ===================================================================
18 --- src/cats/update_postgresql_tables.in        (révision 7513)
19 +++ src/cats/update_postgresql_tables.in        (copie de travail)
20 @@ -12,9 +12,12 @@
21  if $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
22  
23  -- Create a table like Job for long term statistics
24 +BEGIN;
25  CREATE TABLE jobstat (LIKE job);
26 -
27 +ALTER TABLE file ALTER fileid TYPE bigint ;
28 +ALTER TABLE basefiles ALTER fileid TYPE bigint;
29  UPDATE version SET versionid=11;
30 +COMMIT;
31  
32  vacuum analyse;
33  
34 Index: src/cats/cats.h
35 ===================================================================
36 --- src/cats/cats.h     (révision 7513)
37 +++ src/cats/cats.h     (copie de travail)
38 @@ -747,7 +747,7 @@
39   * In principle, the only field that really should need to be
40   *  64 bits is the FileId_t
41   */
42 -typedef uint32_t FileId_t;
43 +typedef uint64_t FileId_t;
44  typedef uint32_t DBId_t;              /* general DB id type */
45  typedef uint32_t JobId_t;
46  
47 Index: src/cats/make_postgresql_tables.in
48 ===================================================================
49 --- src/cats/make_postgresql_tables.in  (révision 7514)
50 +++ src/cats/make_postgresql_tables.in  (copie de travail)
51 @@ -29,7 +29,7 @@
52  
53  CREATE TABLE file
54  (
55 -    fileid           serial      not null,
56 +    fileid           bigserial   not null,
57      fileindex        integer     not null  default 0,
58      jobid            integer     not null,
59      pathid           integer     not null,
60 @@ -295,7 +295,7 @@
61  (
62      baseid           serial                not null,
63      jobid            integer               not null,
64 -    fileid           integer               not null,
65 +    fileid           bigint                not null,
66      fileindex        integer                       ,
67      basejobid        integer                       ,
68      primary key (baseid)
69 Index: src/cats/update_mysql_tables.in
70 ===================================================================
71 --- src/cats/update_mysql_tables.in     (révision 7513)
72 +++ src/cats/update_mysql_tables.in     (copie de travail)
73 @@ -14,7 +14,8 @@
74  
75  -- Create a table like Job for long term statistics
76  CREATE TABLE JobStat (LIKE Job);
77 -
78 +ALTER TABLE File CHANGE FileId FileId BIGINT UNSIGNED NOT NULL AUTO_INCREMENT;
79 +ALTER TABLE BaseFiles CHANGE FileId FileId BIGINT UNSIGNED NOT NULL;
80  DELETE FROM Version;
81  INSERT INTO Version (VersionId) VALUES (11);
82  
83 Index: src/cats/make_mysql_tables.in
84 ===================================================================
85 --- src/cats/make_mysql_tables.in       (révision 7514)
86 +++ src/cats/make_mysql_tables.in       (copie de travail)
87 @@ -29,7 +29,7 @@
88  
89  
90  CREATE TABLE File (
91 -   FileId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
92 +   FileId BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
93     FileIndex INTEGER UNSIGNED DEFAULT 0,
94     JobId INTEGER UNSIGNED NOT NULL REFERENCES Job,
95     PathId INTEGER UNSIGNED NOT NULL REFERENCES Path,
96 @@ -272,7 +272,7 @@
97     BaseId INTEGER UNSIGNED AUTO_INCREMENT,
98     BaseJobId INTEGER UNSIGNED NOT NULL REFERENCES Job,
99     JobId INTEGER UNSIGNED NOT NULL REFERENCES Job,
100 -   FileId INTEGER UNSIGNED NOT NULL REFERENCES File,
101 +   FileId BIGINT UNSIGNED NOT NULL REFERENCES File,
102     FileIndex INTEGER UNSIGNED,
103     PRIMARY KEY(BaseId)
104     );