Commit Graph

24 Commits

Author SHA1 Message Date
Pawel Jakub Dawidek
501250ba60 Now, that we have gjournal in the tree add possibility to configure
gmirror and graid3 in a way that it is not resynchronized after a
power failure or system crash.
It is safe when gjournal is running on top of gmirror/graid3.
2006-11-01 22:51:49 +00:00
Pawel Jakub Dawidek
712fe9bd7a Introduce and use delayed-destruction functionality from a pre-sync hook,
which means that devices will be destroyed on last close.

This fixes destruction order problems when, eg. RAID3 array is build on
top of RAID1 arrays.

Requested, reviewed and tested by:	ru
MFC after:	2 weeks
2006-04-10 10:32:22 +00:00
Pawel Jakub Dawidek
9bfdf5987d Update copyright for 2006. 2006-03-19 12:55:51 +00:00
Pawel Jakub Dawidek
855761d5db - Speed up synchronization process by using configurable number of I/O
requests in parallel.
  + Add kern.geom.mirror.sync_requests tunable which defines how many parallel
    I/O requests should be used.
  + Retire kern.geom.mirror.reqs_per_sync and kern.geom.mirror.syncs_per_sec
    sysctls.
- Fix race between regular and synchronization requests.
- Reimplement mirror's data synchronization - do not use the topology lock
  for this purpose, as it may case deadlocks.
- Stop synchronization from pre-sync hook.
- Fix some other minor issues.

MFC after:	3 days
2006-03-13 00:58:41 +00:00
Pawel Jakub Dawidek
d4b0268a24 - Add kern.geom.mirror.disconnect_on_failure sysctl/tunnable (default to 1
to preserve currect behaviour). When set to 0, components are not
  disconnected - gmirror will try to still use them (only first error will
  be logged). This is helpful when we have two broken components, but in
  different places, so actually all data is available.
  Such buggy component will be visible in 'gmirror list' output with flag
  BROKEN.
- Never disconnect the last valid component. If we detect errors there we
  will just pass them up. This wasn't reasonable to deny access to the
  whole provider because of one broken sector.

Prodded by:	ru
MFC after:	3 days
2006-02-11 17:39:29 +00:00
Pawel Jakub Dawidek
fe6f94ea84 Mark array as CLEAN when there are no write requests in
kern.geom.mirror.idletime seconds. Write, not any requests.
Mark array as clean immediatelly on last write close.

Prodded by:	ru
MFC after:	3 days
2006-02-11 14:42:23 +00:00
Pawel Jakub Dawidek
38ea96ac99 Remove trailing spaces. 2006-02-01 12:06:01 +00:00
Pawel Jakub Dawidek
7979b3683c Remove the hack which allowed to use gmirror for root file system,
use root_mount KPI instead.
2005-04-19 21:47:25 +00:00
Pawel Jakub Dawidek
e68909854c - Add md_provsize field to metadata, which will help with
shared-last-sector problem.
  After this change, even if there is more than one provider with the same
  last sector, the proper one will be chosen based on its size.
  It still doesn't fix the 'c' partition problem (when da0s1 can be confused
  with da0s1c) and situation when 'a' partition starts at offset 0
  (then da0s1a can be confused with da0s1 and da0s1c). One can use '-h'
  option there, when creating device or avoid sharing last sector.
  Actually, when providers share the same last sector and their size is equal,
  they provide exactly the same data, so the name (da0s1, da0s1a, da0s1c)
  isn't important at all.
- Provide backward compatibility.
- Update copyright's year.

MFC after:	1 week
2005-02-27 23:07:47 +00:00
Pawel Jakub Dawidek
0218292cdf Update copyright in files changed this year. 2005-02-16 22:14:52 +00:00
Pawel Jakub Dawidek
da84416791 Spoiling is now not possible, because we keep consumers open for writing
all the time. Remove unused code then.

MFC after:	4 days
2005-01-04 12:11:49 +00:00
Pawel Jakub Dawidek
fd6d312082 Fix 'rebuild' command (we ignore retaste event now, so don't relay on it). 2005-01-03 19:42:37 +00:00
Pawel Jakub Dawidek
9a9f504132 - Add genid field to the metadata which will allow to improve reliability a bit.
After this change, when component is disconnected because of an I/O error,
  it will not be connected and synchronized automatically, it will be logged
  as broken and skipped. Autosynchronization can occur, when component is
  disconnected (on orphan event) and connected again - there were no I/O
  error, so there is no need to not connected the component, but when there were
  writes while it wasn't connected, it will be synchronized.
  This fix cases, when component is disconnected because of I/O error and can be
  connected again and again.
- Bump version number.
- Add version change history.
- Implement backward compatibility mechanism. After this change when metadata in
  old version is detected, it is automatically upgraded to the new (current)
  version.
2004-12-22 23:09:32 +00:00
Pawel Jakub Dawidek
2fdf5be172 MFp4:
- Fix for good (I hope) force-stopping mirrors and some filure cases
  (e.g. the last good component dies when synchronization is in progress).
  Don't use ->nstart/->nend consumer's fields, as this could be racy,
  because those fields are used in g_down/g_up, use ->index consumer's
  field instead for tracking number of not finished requests.

  Reported by:	marcel

- After 5 seconds of idle time (this should be configurable) mark all
  dirty providers as clean, so when mirror is not used in 5 seconds
  and there will be power failure, no synchronization on boot is needed.

  Idea from:	sorry, I can't find who suggested this

- When there are no ACTIVE components and no NEW components destroy whole
  mirror, not only provider.

- Fix one debug to show information about I/O request, before we change
  its command.
2004-11-05 09:05:15 +00:00
Pawel Jakub Dawidek
604fce4f60 Just use MAXPHYS as maximum I/O request size, instead of using my own
#define for this purpose.
No functional change.
2004-09-28 07:33:37 +00:00
Pawel Jakub Dawidek
0217ba9893 Forgot to commit addition of ds_resync field. 2004-09-26 20:42:35 +00:00
Pawel Jakub Dawidek
887c9fd564 MFp4: Simplify code a bit:
- Remove kern.geom.mirror.sync_block_size sysctl. It is quite obvious that we
  want to use the biggest size possible.
- Do not use UMA zone for sync data allocations. There could be only one
  synchronization request per synchronized disk at a time, so allocate memory
  for one request on whole synchronization process related to one disk.

Tested by synchronizing one component (out of three) and by synchronizing
two components (out of three) in parallel.
2004-08-11 23:41:53 +00:00
Pawel Jakub Dawidek
445a4b68f2 Actually, HARDCODED flag isn't stored in metadata, so don't bother
dumping it.
2004-08-11 22:16:42 +00:00
Pawel Jakub Dawidek
2def749bb1 - Fix typo.
- Dump HARDCODED flag.
2004-08-11 22:12:44 +00:00
Pawel Jakub Dawidek
6c74f5177c - Introduce option for hardcoding providers' names into metadata.
It allows to fix problems when last provider's sector is shared between few
  providers.
- Bump version number for CONCAT and STRIPE and add code for backward
  compatibility.
- Do not bump version number of MIRROR, as it wasn't officially introduced yet.
  Even if someone started to play with it, there is no big deal, because
  wrong MD5 sum of metadata will deny those providers.
- Update manual pages.
- Add version history to g_(stripe|concat).h files.
2004-08-09 11:29:42 +00:00
Pawel Jakub Dawidek
51385a3c00 - Add two fields to bio structure: 'bio_cflags' which can be used by
consumer and 'bio_pflags' which can be used by provider.
- Remove BIO_FLAG1 and BIO_FLAG2 flags. From now on new fields should be
  used for internal flags.
- Update g_bio(9) manual page.
- Update some comments.
- Update GEOM_MIRROR, which was the only one using BIO_FLAGs.

Idea from:	phk
Reviewed by:	phk
2004-08-04 21:35:05 +00:00
Pawel Jakub Dawidek
fe7c3780c8 - Add "prefer" balance algorithm. When used, only disk with the biggest
priority will be used for reading.
- Bump version number.
2004-08-04 12:09:53 +00:00
Pawel Jakub Dawidek
484405eb8d Remove unused field. 2004-07-31 13:03:38 +00:00
Pawel Jakub Dawidek
fa4a1febf7 Add GEOM_MIRROR class which provide RAID1 functionality and has many useful
features. The gmirror(8) utility should be used for control of this class.
There is no manual page yet, but I'm working on it with keramida@.

Many useful tests provided by:	simon (thank you!)
Some ideas from:		scottl, simon, phk
2004-07-30 23:13:45 +00:00